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
- This topic has 9 replies, 2 voices, and was last updated 5 months ago by Luke Nielsen.
-
AuthorPosts
-
June 2, 2024 at 5:20 am #570019
dimmiselParticipantI 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?
June 3, 2024 at 3:02 pm #570221
Luke NielsenKeymasterHello,
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
June 4, 2024 at 2:38 am #570379
dimmiselParticipantI 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.
June 4, 2024 at 3:39 pm #570569
Luke NielsenKeymasterHello,
Okay, understood. I will wait for your response.
Have a good day!
Kind Regards
June 4, 2024 at 11:58 pm #570654
dimmiselParticipantPlease take a look in the extra info section.
June 5, 2024 at 4:56 pm #570868
Luke NielsenKeymasterHello,
May I disable 3rd party plugins for testing?
I await your response.
Kind Regards
June 5, 2024 at 5:25 pm #570875
dimmiselParticipantYup, do whatever you need! It’s a staging site!
June 7, 2024 at 3:20 pm #571332
Luke NielsenKeymasterHello,
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
June 9, 2024 at 1:08 am #571568
dimmiselParticipantNo it’s OK I think for now! Thanks a lot for your support! 😀
June 10, 2024 at 10:55 am #571692
Luke NielsenKeymasterHello,
Always remember that you can reach out to us with any questions you may have.
We wish you a splendid day!
Kind Regards
-
AuthorPosts
The topic ‘Product quantity input not present in the related/upsells/cross-sell ribbons’ is closed to new replies.
- You must be logged in to create new topics. Login / Register