Home Forums WoodMart support forum Product quantity input not present in the related/upsells/cross-sell ribbons

Product quantity input not present in the related/upsells/cross-sell ribbons

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #570019

    dimmisel
    Participant

    I have enabled Quantity input for products https://prnt.sc/LSbIOpfUHjeB

    Then I found out that the input, although present, is not functional for variable products, meaning that clicking on the +/- buttons, doesn’t trigger the quantity to change. This had an easy fix; all I had to do was to forcibly load the related JS files site-wide. https://prnt.sc/1gjsZPtUO5cW

    But I also noticed that the +/- buttons are not present on the related/up-sell/cross-sell ribbons. https://prnt.sc/3loKLEpS6ffm

    Shouldn’t the above setting work for these ribbons also?

    #570221

    Luke Nielsen
    Keymaster

    Hello,

    Is there any chance that you could give me access to the dashboard area so I can have a look at the settings on your website, please?

    Thank you in advance.

    Kind Regards

    #570379

    dimmisel
    Participant

    I was able to remedy it. Of course this is only temporary as we have to present the website to the customer tomorrow, and it has to work perfectly.

    So at first, I set Product view under Related & Upsells to Carousel https://prnt.sc/PQpit-mPIKt- (the whole workaround doesn’t work if set to Grid).

    Then I overrode woodmart_loop_prop() in functions.php to always return true when prop is product_quantity.

    function woodmart_loop_prop( $prop, $default = '' ) {
        woodmart_setup_loop();
    
        if ( is_product() && $prop === 'product_quantity' ) {
            return true;
        }
    
        return isset( $GLOBALS['woodmart_loop'], $GLOBALS['woodmart_loop'][ $prop ] ) ? $GLOBALS['woodmart_loop'][ $prop ] : $default;
    }

    And finally I studied the DOM of a correctly working product ribbon, and the malfunctioning one, and found out what were the missing classes, so I wrote some JS to add the missing classes to the appropriate elements in the DOM for the variation selection popup when the product is variable, etc…

    		$('div[id^=carousel-]').each(function () {
    			if ($(this).hasClass('wd-products-with-bg')) {
    				$(this).addClass('wd-quantity-enabled');
    			} else if ($(this).hasClass('wd-quantity-enabled')) {
    				$(this).addClass('wd-products-with-bg');
    			}
    		});

    As for the credentials, I’ll duplicate the website in a subdomain and send you the creds for that (after cancelling all the above, so that you see the problem in action). I’ll update the topic tomorrow.

    #570569

    Luke Nielsen
    Keymaster

    Hello,

    Okay, understood. I will wait for your response.

    Have a good day!

    Kind Regards

    #570654

    dimmisel
    Participant

    Please take a look in the extra info section.

    #570868

    Luke Nielsen
    Keymaster

    Hello,

    May I disable 3rd party plugins for testing?

    I await your response.

    Kind Regards

    #570875

    dimmisel
    Participant

    Yup, do whatever you need! It’s a staging site!

    #571332

    Luke Nielsen
    Keymaster

    Hello,

    In the next update, we will fix that issue, if you want to fix that now, find these files:

    woocommerce/single-product/related.php
    woocommerce/single-product/up-sells.php

    find this string: 'product_quantity' => woodmart_get_opt( 'product_quantity' ) and change to this one: 'product_quantity' => woodmart_get_opt( 'product_quantity' ) ? 'enable' : 'disable',

    Kind Regards

    #571568

    dimmisel
    Participant

    No it’s OK I think for now! Thanks a lot for your support! 😀

    #571692

    Luke Nielsen
    Keymaster

    Hello,

    Always remember that you can reach out to us with any questions you may have.

    We wish you a splendid day!

    Kind Regards

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

The topic ‘Product quantity input not present in the related/upsells/cross-sell ribbons’ is closed to new replies.