Is there an addon currently out there that allows you to display a "Max Stock Number" on the product page?
For example, I have three products. Product A, Product B, Product C.
I always want it to show a maximum of 15 in stock.
In my inventory, and listed, I have:
- 10 Quantity of Product A
- 18 Quantity of Product B
- 25 Quantity of Product C
However, I want to have it display for customers:
- Product A: 10 Quantity
- Product B: 15 Quantity
- Product C: 15 Quantity
If there is no current add-on, where would I hardcode this so it displays as such on my product pages?
Hello ,
Sorry but I think these type of addon is not available at marketplace , We are ready to your help . please write here: https://webkul.com/ticket/open.php
Regards
Vivek GUpta
I am mainly just looking for help on adjusting some code so that it puts a max across all items on the site. It seems like it would be a small piece of code. I already have a developer if I need to pay for a large addon.
I am mainly just looking for help on adjusting some code so that it puts a max across all items on the site. It seems like it would be a small piece of code. I already have a developer if I need to pay for a large addon.
if you want to go with hardcode then goto in common/product_data.tpl & do here hard code for availabilty as per product wise .
I hope it will help you.
You can do hard code here:
Override product_amount hook
{hook name="products:product_amount"}
{if $show_product_amount && $product.is_edp != "Y" && $settings.General.inventory_tracking == "Y"}
{if !$product.hide_stock_info}
{if $settings.Appearance.in_stock_field == "Y"}
{if $product.tracking != "ProductTracking::DO_NOT_TRACK"|enum}
{if ($product_amount > 0 && $product_amount >= $product.min_qty) && $settings.General.inventory_tracking == "Y" || $details_page}
{if ($product_amount > 0 && $product_amount >= $product.min_qty) && $settings.General.inventory_tracking == "Y"}
{__("availability")}:
{$product_amount} {__("items")}
{elseif $settings.General.inventory_tracking == "Y" && $settings.General.allow_negative_amount != "Y"}
{__("in_stock")}:
{$out_of_stock_text}
{/if}
{/if}
{/if}
{else}
{if ((($product_amount > 0 && $product_amount >= $product.min_qty) || $product.tracking == "ProductTracking::DO_NOT_TRACK"|enum) && $settings.General.inventory_tracking == "Y" && $settings.General.allow_negative_amount != "Y") || ($settings.General.inventory_tracking == "Y" && $settings.General.allow_negative_amount == "Y")}
{__("availability")}:
{__("in_stock")}
{elseif $details_page && ($product_amount <= 0 || $product_amount < $product.min_qty) && $settings.General.inventory_tracking == "Y" && $settings.General.allow_negative_amount != "Y"}
{__("availability")}:
{$out_of_stock_text}
{/if}
{/if}
{/if}
{/if}
{/hook}
I will try this out. Thanks vive.
vive, I tried to mess around with it, and even got to the point where I set
{if ($product_amount > 11 && $product_amount >= $product.min_qty) && $settings.General.inventory_tracking == "Y" || $details_page}
{if ($product_amount > 11 && $product_amount >= $product.min_qty) && $settings.General.inventory_tracking == "Y"}
How would I integrate an else command in there to build the two situations?
Sorry I am not a coder.
Why not just use:
{assign var="my_max_qty" value="11"}
{if $settings.General.inventory_tracking == 'Y' || $details_page}
{$product_amount = $product_amount|min:$my_max_qty}
[/if}
Seems a lot cleaner to me.
Note: this is just a recode of your logic.
Why not just use:
{assign var="my_max_qty" value="11"}
{if $settings.General.inventory_tracking == 'Y' || $details_page}
{$product_amount = $product_amount|min:$my_max_qty}
[/if}
Seems a lot cleaner to me.
Note: this is just a recode of your logic.
This worked great! Thanks EZ