How can I change the shape of a product to show modifier stock when using Exp: resso Store in Expression Engine?

When creating a product page for my store, it’s easy to show {total_stock}. But how can I display the modifier stock or disable the modifier based on its stock?

For example, when selling clothes, I only want to include the size that is in stock.

+4
source share
1 answer

The problem is that stocks are linked to SKUs, and SKUs are not always matched directly to the modifier. For example, if the product “Shirt” has a size and color, then you can’t say conclusively whether “Big” is in stock because it also depends on the color.

However, if your products have only one modifier, then there is a 1-1 display. You must have access to the stock level using {option_stock_level} inside the loop {modifier_options} , for example:

 {modifiers} <select name="{modifier_input_name}"> {modifier_options} <option value="{option_id}"> {option_name} ({option_stock_level} remaining) </option> {/modifier_options} </select> {/modifiers} 
+4
source

Source: https://habr.com/ru/post/1443958/


All Articles