Jump to content

[SOLVED] Add number of sold items counter on the product page


Recommended Posts

Hello.

I need to add a counter of sold items on the product page. I have already found this two methods for achieving this goal, but both of them are not compatibly with 1.5 version:

 

1) http://alvinjiang.bl...splay-sold.html

This method suggests to find two small lines and add some code before them:

include_once(dirname(__FILE__).'/init.php');

in product.php

 

and

 

<p class="price">

in product.tpl

 

But there is no such lines in 1.5 version.

 

2) http://www.prestasho...counter-module/

this modul also needs some coding and requests for the lines:

<!-- Out of stock hook -->
<p id="oosHook"{if $product->quantity > 0} style="display:none;"{/if}>
{$HOOK_PRODUCT_OOS}
</p>

 

and

'HOOK_EXTRA_RIGHT' => Module::hookExec('extraRight'),
'HOOK_PRODUCT_OOS' => Hook::productOutOfStock($product),
'HOOK_PRODUCT_FOOTER' => Hook::productFooter($product, $category),

 

in product.tpl

And there is no such lines also.

 

I have even thought about modifying the "products in stock" counter on the product page by adding a simple arithmetics (like if there was 1000 items in stock in the beginning then the number of sold items will bw 1000-"items in stock") but this was also unsuccessful because I did not manage to find the parameters to change in the product.php (and how to code this too).

 

Can you please suggest me something.

Thank you

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

  • 1 month later...
  • 3 weeks later...
  • 2 months later...
  • 1 year later...
×
×
  • Create New...