Jump to content

[MODIFICATION] RRP (Recommended Retail Price)


Zenith
 Share

Recommended Posts

  • 2 weeks later...

There are some issues with the 1.4.5.1 latest block layered module.

When active it shows RRP : 0 everywhere on product-list and nothing is shown on the product page (RRP : 0).

 

When not active , the product-list problem is solved but not the product page.

 

 

 

@rebirth : I think it's because of this condition

 

{if $rrp_price}
{/if}

 

I really don't understand what is this condition for.

 

I mean it should be something more like :

 

{if $rrp_price >=0}
{/if}

 

@philee , if you do this change , you'll probably have a "RRP : 0" too.

Share this post


Link to post
Share on other sites

Sorry fellas, had had a few issues lately, had a main HDD crash on my main PC and have just got it back yesterday, spent the most part of today re-installing all software, and my shop is getting busier and busier by the day so haven't had much time for custom coding.

 

OK so. The product listing page is at the moment broken, I was working on a fix when my HDD died and will get back to that as soon as I can. The product page should be working fine on any updated versions, I'm using 1.4.6 (SVN) and still works as it did, so check over your edits.

 

This condition "{if $rrp_price}" is correct, basically if there is a RRP price it will include the code in the condition, thus showing the RRP function.

Share this post


Link to post
Share on other sites

Sorry fellas, had had a few issues lately, had a main HDD crash on my main PC and have just got it back yesterday, spent the most part of today re-installing all software, and my shop is getting busier and busier by the day so haven't had much time for custom coding.

 

OK so. The product listing page is at the moment broken, I was working on a fix when my HDD died and will get back to that as soon as I can. The product page should be working fine on any updated versions, I'm using 1.4.6 (SVN) and still works as it did, so check over your edits.

 

This condition "{if $rrp_price}" is correct, basically if there is a RRP price it will include the code in the condition, thus showing the RRP function.

 

 

You're back! :)

 

So if I install the latest RRP version it will work with 1.4.5.1?

Share this post


Link to post
Share on other sites

It should, it's working fine on 1.4.6 for me, there have been no changes over the last few PS versions so it should not have effected the RRP feature on the product page. (Note: category page is not working on latest PS versions)

Share this post


Link to post
Share on other sites

That's most likely due to you overwriting your old PS files with the newer ones. If you do this you'll need to re-apply the file edits for RRP. Database field should still exist though. This applies to any modification.

Share this post


Link to post
Share on other sites

@sudhakarm1

 

It works with 1.4.5.1, I installed Zenith latest version to my store and it works fine for the product.php. I am still trying to figure out why it doesn't show up in my product-list page though.

Share this post


Link to post
Share on other sites

The product list isn't showing as it does not read from the controller file where the calculation is now done. I haven't had any time lately to figure out a new solution to this, so if anyone has any ideas, let's hear them!

Share this post


Link to post
Share on other sites

RRP works on the product page in all 1.4.x versions. Check you have done all file edits correctly if it is not working for you.

 

Hi Zenith,

 

After editing the file, this is how the product page is shown. The RRP is shown as striked. and I am not able to install the module provided at your loc site.

 

regards,

Sudhakar

post-287397-0-01196900-1320383761_thumb.png

Share this post


Link to post
Share on other sites

Ah figured out why. After installing that module, it changed my product.tpl to

 

{if $rrp_price}
<p id="rrp_price">{l s='MSRP :'} <strike>
{convertPrice price=$rrp_price}
{if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
 {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
{/if}
</strike></p>
<p id="reduction_percent">{l s='You save:'}<span id="reduction_percent_display">
{if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
 {if $priceDisplay == 1}
  {convertPrice price=($rrp_price - $product->getPrice(false, $smarty.const.NULL))}
  {l s='('}{round((($rrp_price - $product->getPrice(false, $smarty.const.NULL)) / $rrp_price) * 100, 0)}%{l s=')'}
 {else}
  {convertPrice price=($rrp_price - $product->getPrice(true, $smarty.const.NULL))}{/if}
  {l s='('}{round((($rrp_price - $product->getPrice(true, $smarty.const.NULL)) / $rrp_price) * 100, 0)}%{l s=')'}
{/if}
</span></p>
{/if}

 

Then I changed it back to:

 

{if $rrp_price}
<p id="rrp_price">{l s='MSRP :'} <strike>
{convertPrice price=$rrp_price}
{if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
 {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
{/if}
</strike></p>
<p id="reduction_percent">{l s='You save:'}<span id="reduction_percent_display">
{if !$priceDisplay || $priceDisplay == 2}
 {convertPrice price=($rrp_price - $product->getPrice(true, $smarty.const.NULL))}
 {l s='('}{round((($rrp_price - $product->getPrice(true, $smarty.const.NULL)) / $rrp_price) * 100, 0)}%{l s=')'}
{elseif $priceDisplay == 1}
 {convertPrice price=($rrp_price - $product->getPrice(false, $smarty.const.NULL))}
 {l s='('}{round((($rrp_price - $product->getPrice(false, $smarty.const.NULL)) / $rrp_price) * 100, 0)}%{l s=')'}
{/if}
</span></p>
{/if}

 

 

Reduction amount is now back on. :)

Share this post


Link to post
Share on other sites

Hi, this is a great module and has helped me out a lot. Thank you for that.

 

I'm having a problem with it unfortunately. On the Product page, it seems to be adding tax on top of the RRP, which already has tax included. How can I fix this? therefore from that, the You Save in percentage and amount is incorrect.

 

Also, I can't seem to get the RRP displaying on the product list page.

 

Any help would be appreciated. Thanks.

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Hi all! I agree, great module! I'm having one problem though...

 

The rrp shows perfectly in the products page (linked to products.tpl) but on the products list page, I'm, getting nothing. Checking the logs, I'm, getting this error:

 

 mod_fcgid: stderr: PHP Notice:  Undefined variable: rrp_price in /var/www/ 

 

Any idea what's going on? Seems that smarty isn't being passed the variable from the php backend. Any help would be greatly appreciated!

 

mustard.

Share this post


Link to post
Share on other sites

  • 2 weeks later...

I'm using 1.4.6.2 and for the product.list I use this code

{if $product.recommended_retail_price != 0}
 <div><span class="old_price" style="display: inline;"><span class="bold">
 {l s='RRP:'} <strike>{convertPrice price=$product.recommended_retail_price}
 </strike></span></span></div>
 {/if}

You put it just after

<div class="right_block_product_vertical">

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 2 weeks later...

Ive attempted to install this mod on my store using the black and white template. I have the option to ann the rrp in admin but it doesnt show up on the storefront. Any ideas please i'm a total newbi. Oh and im using PrestaShop™ 1.4.6.2 if that helps any lol

 

Thanks Dawny

 

 

Managed to get it installed on the original prestashop template but now the price impact isnt updateing on my products with attributes. Anyone else had that problem?

 

Dawny

Share this post


Link to post
Share on other sites

Hi,

 

i just did all the updates on my website http://www.sympthome.com/fr/ (Version 1.4.3)

 

I work with a template I bought and then I updated the corresponding folders in this theme (not in the original theme prestashop)

 

I have the possibility to enter a RRP in my back office, but nothing appears on my product pages.

 

Do I have to update also all files concerned in the original theme Prestashop?

 

Does anyone has an idea?

 

Thanks,

 

Geoffrey

Share this post


Link to post
Share on other sites

  • 2 weeks later...

@ peeke: That is code from an old version and will not include tax or work with currency conversions.

 

At the moment there is no code for the category page that includes these functions and works.

 

Hello Zenith,

 

any idea how to make this work on category page?

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Just started using the modification, but its a massive downside that it doesnt work on the product list page. Does anyone have any idea how to make this work? Zenith are you closer to getting this working?

 

Nice mod, but a big shame it doesnt work on the product list page.

Share this post


Link to post
Share on other sites

  • 3 weeks later...

I use this mod and love it the only small issue I have is that I have products with attributes of different price and different RRP would there be anyway of making this mod change the RRP when the attribute of different price and RRP is selected? I'm guessing that there would have to be a RRP input box added to the Attribute creator but I don't have anywhere enough know how or experience to start playing with this.

 

Thanks Dawny

Share this post


Link to post
Share on other sites

Could someone/ anyone edit the code of this mod to make it work on the category page, with currency and language? Don't know about everyone else, but I'd be happy to make a donation to whoever would be kind enough to do it.

Share this post


Link to post
Share on other sites

  • 2 weeks later...

Also on block new products... it works on product-list but not when going into categories :(

 

 

EDIT : It's working for me now ( 1.4.5.1 ).

I don't know what I've done to make it work, I think it was when I updated my blocklayered module with the latest Tools.php you can find here :

 

http://www.prestashop.com/forums/topic/138036-mise-a-jour-du-module-navigation-a-facettes-pour-1451-et-maj-040412/

 

 

 

Please have a backup of your old Tools.php in case it doesn't work.

Edited by LEDestock (see edit history)

Share this post


Link to post
Share on other sites

I think I've installed this correctly but it's not showing the RRP for me. I use RRP on the base price and then discount this for every visitor. This means that 'price' and 'rrp' are technically the same value. Could this be my problem? If so, is there a way to display the RRP regardless of whether it's greater than the sale price?

Share this post


Link to post
Share on other sites

  • 2 months later...
  • 3 months later...
  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...

Adds a RRP feature that shows on the product and product list pages. Includes BO import feature.

 

This modification is for PrestaShop v1.4.4.1 (Code may be different for previous versions)

 

Feedback and requests for additional features are always welcome.

 

Installation instructions are contained in the attached archive.

 

I guess I'm a bit late, but does this still work for lastest version 1.5.3.1?

Thanks in advance :)

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 4 weeks later...

Hello,

I have prestashop version 1.4.7.3 and I did all points as zenith version v1.6a (2011-09-18).

I have checked all steps but still do not display RRP price on category-list. Does anybody has a solution for this?

Share this post


Link to post
Share on other sites

Hi all!

I have a problem, I would like to generation unit price/product, For example: 1 bottle (0,75 liter) wein cost 10 Euro, unit price = 10/0,75= 13,33 euro-unit price / liter. I can it make manual, bur i have 1400 piece weij my shop.

version 1.4.8.2

how can it make automatic generation of unit prices

thx

Share this post


Link to post
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

To display rrp price on product-list.php i've used this :

 

 

                       {if ($product.recommended_retail_price > 0)}
                       <span>{convertPrice price=$product.recommended_retail_price}</span>
                       {/if}

 

I simply used {$product|@var_dump} to know how the rrp was referenced in the array.

Share this post


Link to post
Share on other sites

  • 4 weeks later...
  • 2 months later...

Hello,

I realized the modificationmais I encounter a problem when there is no reduction in the rpp shows me:

 

You realize a savings of € -59.80 (0%)

 

 

 

I want it to be hidden when 0% discount.

 

Thank you.

Share this post


Link to post
Share on other sites

1.4.9.0. works on product page, doesn't on product-list page.

 

Doesn't work with product combinations like sizing / color of product with different prices.

 

e.g. I have product with sizes

M for $30

L for $50

but I can set only one RRP. Anybody fixed this?

Share this post


Link to post
Share on other sites

  • 1 month later...
  • 4 months later...
  • 3 weeks later...

When you change code like in manual it will looks like on my page:

in product-list: http://www.luxusnakupelna.sk/3-sanitarna-keramika

in product: http://www.luxusnakupelna.sk/umyvadla/402-kolo-aplauz-zapustne-umyvadlo-s-otvorom-60-x-47-cm-41860-5906976002367.html

RRP is in my language Bezna cena

 

Here is the manual:

1.
#
#----------[ DATABASE SQL ]----------
#
ALTER TABLE `ps_product` ADD `recommended_retail_price` DECIMAL(20,6) NOT NULL DEFAULT '0.000000' AFTER `price`;

2.
#
#----------[ OPEN ]----------
#
classes/Product.php

#
#----------[ FIND ]----------
#
/** @var float Price in euros */
public $price = 0;

#
#----------[ AFTER, ADD ]----------
#
/** @var float Recommended Retail Price in euros */
public $recommended_retail_price = 0;

3.
#
#----------[ OPEN ]----------
#
controllers/front/ProductController.php

#
#----------[ FIND ]----------
#
$ecotax_tax_amount = Tools::ps_round($ecotax_tax_amount * (1 + $ecotax_rate / 100), 2);

#
#----------[ AFTER, ADD ]----------
#
// RRP
$rrpPrice = Tools::ps_round($this->product->recommended_retail_price, 2);
if (Product::$_taxCalculationMethod == PS_TAX_INC && (int)Configuration::get('PS_TAX'))
$rrpPrice = Tools::ps_round($rrpPrice * (1 + $tax / 100), 2);

#
#----------[ FIND ]----------
#
'ecotaxTax_rate' => $ecotax_rate,

#
#----------[ AFTER, ADD ]----------
#
'rrp_price' => Tools::convertPrice($rrpPrice),

4.
#
#----------[ OPEN ]----------
#
themes/prestashop/product.tpl

#
#----------[ FIND ]----------
#
{*close if for show price*}

#
#----------[ BEFORE, ADD ]----------
#
{if $rrp_price}
<p id="rrp_price">{l s='RRP :'} <strike>
{convertPrice price=$rrp_price}
{if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
{/if}
</strike></p>
<p id="reduction_percent">{l s='You save:'}<span id="reduction_percent_display">
{if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=($rrp_price - $product->getPrice(true, $smarty.const.NULL))}
{l s='('}{round((($rrp_price - $product->getPrice(true, $smarty.const.NULL)) / $rrp_price) * 100, 0)}%{l s=')'}
{elseif $priceDisplay == 1}
{convertPrice price=($rrp_price - $product->getPrice(false, $smarty.const.NULL))}
{l s='('}{round((($rrp_price - $product->getPrice(false, $smarty.const.NULL)) / $rrp_price) * 100, 0)}%{l s=')'}
{/if}
</span></p>
{/if}

5.
#
#----------[ OPEN ]----------
#
themes/prestashop/css/product.css

#
#----------[ FIND ]----------
#
/* prices */

#
#----------[ AFTER, ADD ]----------
#
#primary_block #buy_block p#rrp_price {
font-size: 0.9em;
text-align: right
}

#
#----------[ INFO ]----------
#
The following code will add RRP to the product listing (category) page.

6.
#
#----------[ OPEN ]----------
#
themes/prestashop/product-list.tpl

#
#----------[ FIND ]----------
#
{if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE}

#
#----------[ BEFORE, ADD ]----------
#
{if $product.recommended_retail_price != 0}
<div><span class="old_price" style="float:left;display:inline;margin:2px 0px 5px 0px;color:#666666;font-size:12px"><span class="normal">
{l s='RRP:'} <strike>{convertPrice price=$product.recommended_retail_price}
</strike></span></span></div>
{/if}

  • Like 1

Share this post


Link to post
Share on other sites

  • 7 months later...