Forum Replies Created
-
AuthorPosts
-
bankzySupport Expired
Is there a way to display the stock status in a dropdown for product variations on my store?
Link to snippet resource
bankzySupport ExpiredAhh I have found what the issue is.
I am using the below snippet in functions.php to show out of stock variations and the stock levels still remaining.
When I remove this snippet the simple product pages load but fail when it’s active.
add_action( ‘woocommerce_after_add_to_cart_form’, ‘dropdown_waitlist_label’ );
function dropdown_waitlist_label() {
echo ”
<script>
jQuery(document).ready(function($) {
var variation_data = $(‘form.variations_form’).attr(‘data-product_variations’);
var variation_data = JSON.parse(variation_data);
$(‘#pa_size > option’).each(function() {
for (var i = 0; i < variation_data.length; i++) {
var variation = variation_data;
if ($(this).val() == variation.attributes.attribute_pa_size) {
if ( false == variation.is_in_stock ) {
$(this).text( variation.attributes.attribute_pa_size + ‘\u00A0\u00A0\u00A0–\u00A0\u00A0\u00A0\u00A0Out of Stock’);
}
if ( variation.min_qty == 1 && variation.max_qty == 1 ) {
$(this).text( variation.attributes.attribute_pa_size + ‘\u00A0\u00A0\u00A0–\u00A0\u00A0\u00A0\u00A01 left in stock’ );
}
}
}
});
});
</script>”;
}bankzySupport ExpiredI actually don’t know what I have done to fix this issue.
I am unsure if the theme issue mentioned in my previous reply was due to you perhaps enabling the wrong theme.
I did remove information from functions.php to the child theme functions.
What is the correct method to update this theme ? Is the method I use above incorrect ? I do it that way so that I can retain the original files before updating just in case I altered some files.
bankzySupport ExpiredHello, I seem to have an issue with the theme loading information from two theme folders ?
When updating I added the new files to “claue-NEW” in wp-content > theme then changed the folder called “claue” to claue-OLD.
The theme I have activated now isn’t correct as it’s missing the currency module I added to the top left header.
bankzySupport ExpiredHello,
I have no idea why this is happening as I left for work and it was working fine and just come back to the site not working.
I have enabled debug mode and showing errors on the frontend.
Do you still need FTP access ?
March 4, 2019 at 5:38 pm in reply to: Hide WooCommerce Sub-Category Widget from Menu when viewing Vendor Shop #29414bankzySupport ExpiredAhh fantastic! Had no idea vendor products were tagged as archive.
Thank you for the swift responses!
March 4, 2019 at 5:35 pm in reply to: Hide WooCommerce Sub-Category Widget from Menu when viewing Vendor Shop #29412bankzySupport ExpiredHello,
Yes I have tried that and thought it would work as I had hoped, however, when you click into a child category I still want the category bar to show so that customers can switch to another category very easily.
March 4, 2019 at 5:08 pm in reply to: Hide WooCommerce Sub-Category Widget from Menu when viewing Vendor Shop #29407bankzySupport ExpiredSorry I have just added the following JS but it’s also hiding it on every other WooCommerce category page which isn’t what I want. It seems to be ignoring my URL all together…
window.onload = function() {
if (window.location.href.indexOf(‘www.bdtesting.co.uk/club’)) {
//Hide the element.
document.querySelectorAll(‘.shop-top-sidebar’)[0].style.display = ‘none’;
}
}; -
AuthorPosts