• Resolved Gal Baras

    (@galbaras)


    After adding a product with a minimum of 4 to the cart, it’s possible to reduce the quantity using the standard WooCommerce mini-cart block.

    This should not be possible, but it seems that the mini-cart block doesn’t apply the same filters as the cart page/shortcode.

    Please fix.

    See also https://github.com/woocommerce/woocommerce-blocks/issues/11422

    • This topic was modified 1 year, 1 month ago by Gal Baras. Reason: Added GitHub issue reference

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Saiful Islam

    (@codersaiful)

    Hello @galabaras,

    Not clear, what did you mean? Can you explain more please.

    Plugin Contributor Fazle Bari

    (@fazlebari)

    Hello Gal Baras,

    If I normally try to update from the default cart page, it does not let me. https://prnt.sc/R4wyaM0H-bxd

    But i can see that, I can do that from the side cart. I need some information about that to check.

    1. Is it a plugin? If, them give me the plugin name.
    2. If it comes with the theme, give me the theme name.

    Thanks
    Fazle Bari

    Thread Starter Gal Baras

    (@galbaras)

    • Go to https://pacificsprings.com.au/product/15litre-spring-water-bottle/ – the default quantity is 4
    • Try to reduce it – it’s impossible, even with JS disabled
    • Click “Add to Cart”
    • Go back to the product page and open the mini-cart widget – the quantity is >= 4
    • Try to reduce it – it’s possible all the way down to 1
    Plugin Contributor Fazle Bari

    (@fazlebari)

    Hello,

    https://prnt.sc/lr8Y74VZMINA is it a plugin of default theme cart?

    Please give us the theme or plugin name. See my previous reply.

    Thanks

    Thread Starter Gal Baras

    (@galbaras)

    No plugin. It’s the WooCommerce Mini-cart block used via a site editor header template.

    Thread Starter Gal Baras

    (@galbaras)

    @fazlebari Please take a look at this GitHub reply and add the Store API filters to your plugin with the same values as those used in the current filters from the plugin settings.

    Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    Hello,

    WooCommerce mini-cart block doesn’t contain any hook to control min-max or step quantity. That’s why it’s not possible to control quantity there. You may try a different way.

    Hope you understand! Have a nice day!

    Thread Starter Gal Baras

    (@galbaras)

    Yes, I know, and it’s a problem for me (and likely others).

    Please read the GitHub reply I’ve linked and ADD those hooks to the plugin. If that’s not possible, please participate in the discussion to help direct the WooCommerce team towards a solution that works.

    Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    Hello Gal,

    We were unable to find your GitHub Issue. Could you please check again? If you’re interested in contributing to our plugin, feel free to reach out through our support channel or GitHub repository. Your participation is highly valued.

    Thanks!

    Thread Starter Gal Baras

    (@galbaras)

    Thread Starter Gal Baras

    (@galbaras)

    What makes you think this issue is resolved? I think it still exists and needs addressing.

    Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    The link you shared is on WooCommerce itself. WooCommerce is not our plugin. And we have nothing to do as the WooCommerce mini-cart block doesn’t contain any hook. Thanks!

    Thread Starter Gal Baras

    (@galbaras)

    The link I shared contains instructions for you to change your plugin, which is a WooCommerce addon. Basically, unless you do this, you can’t claim full compatibility with the way WooCommerce handles the cart.

    Plugin Contributor Md. Ibrahim Khalil

    (@mdibrahimk48)

    Hello Gal,

    Thanks for your reply!

    Our technical team started analyzing this. We will give you an update as soon as possible. Thanks for your cooperation!

    Best regards,
    Ibrahim

    Thread Starter Gal Baras

    (@galbaras)

    Here’s some sample code that’s confirmed to work and you can adapt.

    add_filter( 'woocommerce_store_api_product_quantity_minimum','return_20_for_now', 10, 2 );
    add_filter( 'woocommerce_store_api_product_quantity_multiple_of','return_20_for_now', 10, 2 );
    function return_20_for_now( $qty, $cartItemData ){
        $product_id = $cartItemData->get_id();
        return 20;
    }

    Why is this taking so long?

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Mini-cart not enforcing rules’ is closed to new replies.