• Resolved marcus963

    (@marcus963)


    Hi,
    when the plugin is activated, only the Billing field is displayed in the WooCommece. Shipping fields not shown.
    How do I see both options?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author yoancutillas

    (@yoancutillas)

    Hello,

    If your cart is composed of virtual products only, the billing fields are not displayed.
    – Make sure your physical products are not virtual in Products > your product > Product data > uncheck the “Virtual” box.

    You also need to make sure that you have
    – Activated the shipping in WooCommerce > Settings > General tab > “Shipping location(s)” option
    – Configured a shipping zone in WooCommerce > Settings > Shipping tab > “Add shipping zone” button

    Regards,
    Yoan Cutillas

    Thread Starter marcus963

    (@marcus963)

    Hi,
    yes the mistake was virutal produts. Thank you.

    But I found a bug in the cart:

    I have additional product fields with a name in my product.

    I buy event 1 and add the name John in the product field and I add it to the cart.
    Everything is OK.
    But if I buy a second event 1 with the name John2, in the cart the data will be overwritten and only John2 will stay there.

    The cart should be:
    first product
    1x – event 1 – John – price
    second product
    1x – event 1 – John2 – price

    But in the cart is
    2 Pieces – Event 1 – John 2

    Is there anything you can do about it?

    Marcus

    Plugin Author yoancutillas

    (@yoancutillas)

    Hello Marcus,

    You are using a plugin for your additional product fields, Booking Activities may not be compatible with it.

    If you use Advanced Forms to add fields, the cart items are not merged because Booking Activities knows that the additional fields have different values.

    Else, when a user adds the same event to cart, the old cart item is merged with the new one and the quantity increases. Booking Activities doesn’t know about the additional fields.

    You can disable the merging by code, for example add this code to your child theme functions.php or with Code Snippets to never merge cart items:
    add_filter( 'bookacti_merge_cart_item', '__return_false', 100 );

    Ideally, replace '__return_false' with a function where you check if the additional fields have the same values and return false only if they are different.

    Thread Starter marcus963

    (@marcus963)

    Great, it works. Great job!

    Booking Activities is the best booking plugin. ??

    Maybe it would be good to include the option to enable / disable this option in the next update.

    Thanks for the help.

    Plugin Author yoancutillas

    (@yoancutillas)

    Thanks a lot!

    Well, the code above is incomplete, the cart items won’t be merged even if there is no Additional Fields, meaning that you can have two identical items in your cart.

    You need to replace the __return_false function with your own for a proper integration, and such option will end up preventing that custom function to work. So it might be counterproductive, and a quite specific use, the person who ticks that option must be aware of what he / she is doing. That’s why it may be best to keep that in the custom code field for now, but I note the idea and wait for more requests ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Billing and Shippin fields’ is closed to new replies.