Jump to content

[SOLVED] Add reference to quantities tab


Recommended Posts

open file:

adminXXXX/themes/default/controllers/products/quantities.tpl

 

there is a code:

						<table class="table">
							<thead>
								<tr>
									<th><span class="title_box">{l s='Quantity'}</span></th>
									<th><span class="title_box">{l s='Designation'}</span></th>
								</tr>
							</thead>
							{foreach from=$attributes item=attribute}
								<tr>
									<td class="available_quantity" id="qty_{$attribute['id_product_attribute']}">
										<span>{$available_quantity[$attribute['id_product_attribute']]}</span>
										<input type="text" name="qty_{$attribute['id_product_attribute']}" class="fixed-width-sm" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/>
									</td>
									<td>{$product_designation[$attribute['id_product_attribute']]}</td>
								</tr>
							{/foreach}
						</table> 

modify it to:

						<table class="table">
							<thead>
								<tr>
									<th><span class="title_box">{l s='Quantity'}</span></th>
                                    <th><span class="title_box">{l s='Reference'}</span></th>
									<th><span class="title_box">{l s='Designation'}</span></th>
								</tr>
							</thead>
							{foreach from=$attributes item=attribute}
								<tr>
									<td class="available_quantity" id="qty_{$attribute['id_product_attribute']}">
										<span>{$available_quantity[$attribute['id_product_attribute']]}</span>
										<input type="text" name="qty_{$attribute['id_product_attribute']}" class="fixed-width-sm" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/>
									</td>
                                    <td>{$attribute['reference']}</td>
									<td>{$product_designation[$attribute['id_product_attribute']]}</td>
								</tr>
							{/foreach}
						</table>
  • Like 1
Link to comment
Share on other sites

  • 2 years later...

 

open file:

adminXXXX/themes/default/controllers/products/quantities.tpl

 

there is a code:

						<table class="table">
							<thead>
								<tr>
									<th><span class="title_box">{l s='Quantity'}</span></th>
									<th><span class="title_box">{l s='Designation'}</span></th>
								</tr>
							</thead>
							{foreach from=$attributes item=attribute}
								<tr>
									<td class="available_quantity" id="qty_{$attribute['id_product_attribute']}">
										<span>{$available_quantity[$attribute['id_product_attribute']]}</span>
										<input type="text" name="qty_{$attribute['id_product_attribute']}" class="fixed-width-sm" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/>
									</td>
									<td>{$product_designation[$attribute['id_product_attribute']]}</td>
								</tr>
							{/foreach}
						</table> 

modify it to:

						<table class="table">
							<thead>
								<tr>
									<th><span class="title_box">{l s='Quantity'}</span></th>
                                    <th><span class="title_box">{l s='Reference'}</span></th>
									<th><span class="title_box">{l s='Designation'}</span></th>
								</tr>
							</thead>
							{foreach from=$attributes item=attribute}
								<tr>
									<td class="available_quantity" id="qty_{$attribute['id_product_attribute']}">
										<span>{$available_quantity[$attribute['id_product_attribute']]}</span>
										<input type="text" name="qty_{$attribute['id_product_attribute']}" class="fixed-width-sm" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/>
									</td>
                                    <td>{$attribute['reference']}</td>
									<td>{$product_designation[$attribute['id_product_attribute']]}</td>
								</tr>
							{/foreach}
						</table>

 

This only works when product has attribute. Products without attribute is this code: {$product->reference|htmlentitiesUTF8}.

But i cant get the code to work:

if {$attribute['reference']} is empty {

{$product->reference|htmlentitiesUTF8}

}

else {

{$attribute['reference']}

}

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

  • 4 years later...

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...