Thanks, Nick - makes good sense.
Announcement
Collapse
No announcement yet.
Difference between Product inv_available and inv_level
Collapse
X
-
lesliekirk In Miva you can set your out of stock level to something other than 0. So if you have the Out of Stock Level set to something greater than 0 then the check if inv_available is equal to 0 will not work. The inv_level variable is a better condition because it takes into account the Out of Stock Level setting.
Leave a comment:
-
Originally posted by Nick View Postlesliekirk That code is not specific to Shadows it can be used anywhere. It is just a matter of if it works for the business rules of the store.
The l.settings:product:inv_level variable is only going to be available if the product/store has the Track Out of Stock Level setting checked. If that setting is not checked then the variable will not be available.
So if you have a condition with the l.settings:product:inv_level variable and the Track Out of Stock Level setting unchecked then that condition will be true. If the setting is checked and the product has 0 inventory then the condition will not be true because it will equal 'out'
The condition is basically checking if the track out of stock products is activated.
Leave a comment:
-
lesliekirk That code is not specific to Shadows it can be used anywhere. It is just a matter of if it works for the business rules of the store.
The l.settings:product:inv_level variable is only going to be available if the product/store has the Track Out of Stock Level setting checked. If that setting is not checked then the variable will not be available.
So if you have a condition with the l.settings:product:inv_level variable and the Track Out of Stock Level setting unchecked then that condition will be true. If the setting is checked and the product has 0 inventory then the condition will not be true because it will equal 'out'
The condition is basically checking if the track out of stock products is activated.
Leave a comment:
-
Originally posted by Nick View Postlesliekirk This is how it is done in the default Shadows framework: https://github.com/mivaecommerce/sha...isplay.mvt#L87
Leave a comment:
-
lesliekirk This is how it is done in the default Shadows framework: https://github.com/mivaecommerce/sha...isplay.mvt#L87
Leave a comment:
-
Difference between Product inv_available and inv_level
I'm trying to understand whyCode:<mvt:if expr="l.settings:product:inv_available GT 0">
Code:<mvt:if expr="l.settings:product:inv_level NE 'out'">
Code:<mvt:if expr="l.settings:product:inv_available GT 0">
Code:<mvt:if expr="l.settings:product:inv_available GT 0"> <button id="js-add-to-cart" class="button button-block uppercase add-to-cart button-secondary white bold">Add <span class="small-inline-block hide">to Cart</span></button> <mvt:else> <button id="js-add-to-cart" class="button button-block uppercase add-to-cart button-secondary white bold" disabled="disabled">Sold Out</button>
Code:<mvt:if expr="l.settings:product:inv_level NE 'out'">
Tags: None
Leave a comment: