Home › Forums › WoodMart support forum › Product quantity input not present in the related/upsells/cross-sell ribbons › Reply To: Product quantity input not present in the related/upsells/cross-sell ribbons
dimmisel
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.