I am trying to hide the variants of my product that are unavailable or sold-out to make it easier for shoppers.
I have two variants per product, size and pages, and the combination of both are not always available or is sold out. How can I only display the options available for the client.
I am using the Shopify 2.0 version of the theme Prestige. This is my website
Thank you, I tried that, but what the code is doing is combining available options and making them into one value on both dropdown menus, but when selected, it displays as unavailable (I am guessing because it can’t be matched with the inventory tracking)
I would want each dropdown menu to display only available options for that variant, so what size and what paper is available in that size.
Thank you, I tried that, but what the code is doing is combining available options and making them into one value on both dropdown menus, but when selected, it displays as unavailable (I am guessing because it can’t be matched with the inventory tracking)
I would want each dropdown menu to display only available options for that variant, so what size and what paper is available in that size.
In case if you are still looking, I have created a function for both sold outs and unavailable variants, you can use that to hide soldouts or unavailable variants.
{
key: ‘_updateVariantsNSD’,
value: function _updateVariantsNSD(newVariant, previousVariant) {
var varForm = this.element.querySelector(‘.ProductForm__Variants’);
var varForm1= varForm.childNodes[1].childNodes[1];
for (var i = 0; i < varForm1.childNodes.length; i++) {
var li = varForm1.childNodes[i];
if(li !== null && varOptions !== null){
for (var j = 0; j < varOptions.length ; j++){
console.log(varOptions[j]);
For this if you wanted for your complete products then by debuging the variation product listing section in Prestige theme only that can be manageable with your mentioned required conditions. If you have any issue we will do it for your store if you will provide us collaboration access to your theme so that we can mondify the code inside your Prestige theme as per as standards of Shopify2.0 without affecting any thing elese of normal functionalities.
You can add this function above updateProductPrice function and call it in variant change handler, you would need to have a bit of coding knowledge to understand how this works.