• Resolved volmohammed

    (@volmohammed)


    “error”: {
    “type”: 1,
    “message”: “Uncaught Error: Call to a member function get_shipping_packages() on null in wp-content/plugins/flexible-shipping/vendor_prefixed/wpdesk/wp-wpdesk-fs-shipment/src/WPDesk/FS/Shipment/Checkout/ShipmentCreator.php:62”,
    “line”: 62
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter volmohammed

    (@volmohammed)

    public?function?create_shipping_for_order_and_cart($order,?$cart)

    ????{???

    ????????global?$fs_package_id;

    ????????//?Check?if?the?cart?is?null?and?log?an?error?if?it?is.

    ????????if?(is_null($cart))?{

    ????????????error_log('Cart?is?null.?Cannot?proceed?with?creating?shipping?for?order.');

    ????????????return;?//?Exit?the?function?if?the?cart?is?null

    ????????}

    ????????//?Get?shipping?methods?from?the?order

    ????????$order_shipping_methods?=?$order->get_shipping_methods();

    ????????//?Get?shipping?packages?from?the?cart

    ????????$packages?=?$cart->get_shipping_packages();

    ????????$current_package?=?-1;

    ????????foreach?($order_shipping_methods?as?$shipping_id?=>?$shipping_method)?{

    ????????????$current_package++;

    ????????????//?Get?the?package?ID?based?on?the?current?package?index

    ????????????$package_id?=?array_keys($packages)[$current_package];

    ????????????$fs_package_id?=?$package_id;

    ????????????//?Retrieve?the?shipping?method?details

    ????????????$fs_method?=?$this->get_fs_method_from_order_shipping_method($shipping_method);

    ????????????if?(!empty($fs_method['method_integration']))?{

    ????????????????$integration?=?$fs_method['method_integration'];

    ????????????????//?Check?if?the?shipment?integration?exists?and?is?supported?by?the?order?type

    ????????????????if?(fs_shipment_integration_exists($integration)?&&?$this->is_order_type_supported_by_integration($order->get_type(),?$integration))?{

    ????????????????????//?Create?a?shipment?for?the?order?and?the?shipping?method

    ????????????????????$shipment?=?$this->create_shipment_for_order_and_fs_shipping_method($order,?$fs_method,?$shipping_id,?$shipping_method,?$packages,?$package_id);

    ????????????????????/**

    ????????????????????*?Do?actions?when?shipment?is?created?via?checkout.

    ????????????????????*

    ????????????????????*?@param?\WPDesk_Flexible_Shipping_Shipment?$shipment?Created?shipment.

    ????????????????????*/

    ????????????????????do_action('flexible_shipping_checkout_shipment_created',?$shipment);

    ????????????????}

    ????????????}

    ????????}

    ????}

    i change this function and working successfully

    Plugin Support tograczyk

    (@tograczyk)

    Hi @volmohammed, thank you for reporting this.

    This is a non-standard behavior of the plugin. I reported the issue to our developers and got confirmation that we will fix it as part of the next update.

    I will let you know in a separate message when the update is live.

    Best regards,
    Tomek

    Plugin Support tograczyk

    (@tograczyk)

    Hi @volmohammed,

    We addressed this issue in the latest plugin update (5.0.0).

    Again, thanks for bringing this to our attention.

    Best regards,
    Tomek

    Thread Starter volmohammed

    (@volmohammed)

    Thank you @tograczyk

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.