Resolvedhow to disable the emty cart when change branch

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #37774
    amba.fr
    Participant

    hi, i didn’t find an option for disable the action that empty the cart when client change branch or delivery/pickup
    i need that empty only when changing branch but if the client choose delivery or pick in the same branch i need the cart don’t empty
    is it possible ?
    or if not is it possible to disable all empty cart ?
    best regards

    #37780
    Alex
    Keymaster

    Hello amba.fr,

    We’ve checked in our test environment and the cart stays intact between branch changes.

    Could you send us temporary admin account so we can check? Please use the “Set as private reply” checkbox.

    Regards,
    Alex

    #37786
    amba.fr
    Participant

    the code of empty cart is in lfka-plugin /incl/shipping-areas/includes/class-lafka-branch-locations.php on ligne 272
    $options_branches = get_option( ‘lafka_shipping_areas_branches’ );
    if ( ! empty( $options_branches[‘products_by_branches’] ) ) {
    //WC()->cart->empty_cart();
    }
    I have commented it and it works for me but it will be great to have the option to choose if we empty or not the cart…
    best regards

    #37807
    Alex
    Keymaster

    Hello amba.fr,

    Yes, you are right.
    But we made this in purpose because as you can see from the code, the cart is cleared only when you have enabled the “Different Products in Branches” option.
    And if someone adds a product from one branch, then switches to another there is possibility that this product is not available in the new branch. That’s why we are clearing the cart.

    Regards,
    Alex

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register