• Resolved tom3r

    (@tom3r)


    Hello there!

    I am writing a custom code in the functions.php that alters the quantities in the basket based on some criterias, after a product is added. The change is instantly shown on the cart icon in the menu, but the numbers don’t change on the product buttons itself.

    Is there a way to update the numbers shown on the plugin’s “Add to cart” button that can easily be called from the functions.php?

    I would be so greatful if this could be done.

    Thanks in advance for your help!

    Tamas

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WC Product Table

    (@wcproducttable)

    Hi Tamas,

    Thank you for using WCPT and sending in your query.

    Normally if the changes you have made are modifying the default woocommerce cart widget then they should also modify WCPT’s cart quantity badge figures. So this is a bit unusual. I would like to take a closer look at your site and customization in order to assist you.

    Please drop in a mail with further details to: [email protected]

    Regards,
    Kartik

    PS – Marking this as resolved here as we need to continue the discussion over email. Please feel free to reopen the topic if required.

    Thread Starter tom3r

    (@tom3r)

    Hi Kartik!

    Thanks for your answer. I’ve sent you an e-mail but haven’t heard from you yet.

    I am simply using the WC()->cart->set_quantity and WC()->cart->add_to_cart functions, which update the mini cart and the WCPT Cart Widget total is adjusting to the right value as well. Only the WCPT ‘Add to cart’ button quantity badge figures are not updating.

    How could we fix this?

    Thank you kindly,
    Tamas

    Plugin Author WC Product Table

    (@wcproducttable)

    Hi Tamas,

    Thank you for sending in your custom code and further details over mail.

    From my email:

    The reason why this is not working for you on WCPT Lite is because the add to cart system in WCPT Lite is not designed to support such customizations. It is only meant to support the standard add to cart system of WooCommerce.

    However, in PRO v2.0.0 onward I have entirely rewritten the add to cart system to support more complex customizations such as this one. The modification is a massive overhaul but it has improved the overall system a fair bit allowing integrations with more 3rd party woocommerce plugins and custom code.

    Your code works without any issue when used with WCPT PRO. I have just tested it (with the fixes I provided).

    If you would like to get a PRO license and download the plugin please go here. Also, you may like to check out other PRO features.

    I will be bringing the new system over to WCPT Lite as well, however the update cycle on PRO is much faster and the changes will reach Lite probably in a month.

    Regards,
    Kartik

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Update Cart Item Quantities’ is closed to new replies.