Jump to content

[SOLVED] Stock left display in product attributes


Recommended Posts

Solved.

In product.tpl

 

Find this:

	<div class="attribute_list">
	{if ($group.group_type == 'select')}
		<select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print">
	{foreach from=$group.attributes key=id_attribute item=group_attribute}
	<option value="{$id_attribute|intval}"
    {if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) 
    || $group.default == $id_attribute} selected="selected"
    {/if} 
    title="{$group_attribute|escape:'html':'UTF-8'}">	
    {$group_attribute|escape:'html':'UTF-8'}</option>
	{/foreach}
	</select>

And changes to this:

	<div class="attribute_list">
	{if ($group.group_type == 'select')}
		<select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print">
	{foreach from=$group.attributes key=id_attribute item=group_attribute}
	<option value="{$id_attribute|intval}"
    {if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) 
    || $group.default == $id_attribute} selected="selected"
    {/if} 
    title="{$group_attribute|escape:'html':'UTF-8'}">	
    {$group_attribute|escape:'html':'UTF-8'} ({$group.attributes_quantity[{$id_attribute|intval}]} in stock)
    </option>
	{/foreach}
	</select>

Result:

s3ey6o.jpg

Edited by funstad (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...