Jump to content

Accessing "Unit price" "Per" on category listing page


netmechanics

Recommended Posts

I was sexcited to se a field allowing sales "Per" a text field is now in on the product page. This is great for me as we sell "per 100" and "per 1000".

 

I can not at the moment get the "per" field to print on the "product-list.php" template page - does anybody know the best way to print to screen the variables/objects available on that page - or how to print it to screen?

 

Many thanks,

 

Gwilym

post-20564-0-09023800-1336678159_thumb.png

Edited by Staple (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 2 months later...

I'm also interested in this feature.

 

In a product page the price can be shown like this:

{$product_unity = $product->unity|escape:'htmlall':'UTF-8'}
{$product_unit_price_ratio = $product->unit_price_ratio|escape:'htmlall':'UTF-8'}
{if !$priceDisplay || $priceDisplay == 2}
 {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL)}
 {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
{elseif $priceDisplay == 1}
 {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL)}
 {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
{/if}
{* display unit price of the product *}
{if !empty($product_unity) && $product_unit_price_ratio > 0.000000}
  {math equation="pprice / punit_price"  pprice=$productPrice  punit_price=$product->unit_price_ratio assign=unit_price}
 <p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product->unity|escape:'htmlall':'UTF-8'}</p>
{/if}

 

But in the "category>product-list.tpl", there is no access to the "product->getPrice" function.

 

Does anyone know how to show the unit price in the category view?

Link to comment
Share on other sites

  • 3 months later...
  • 3 weeks 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...