Jump to content

How to implement base-price in product-list PS 1.6.1.1


Recommended Posts

Hi,

 

i´ve got a question concerning base-prices for the german market. Afaik it is requested to inform any customer about the base-price of products in realtion to for example 100mg of a product. So if i trie to sell for example flour and the package contains 1kg, you are forced to inform the customer about the base-price of 100mg flour.

 

Now the main problem is, that concerning the product-page, my shop already displays the main price for the products, it is requested to do so. But actually, in germany, you are also forced to show this price, where there is a possibility for the customer to put the product in the cart in a close area to the porduct description. This fact means, that on any page where i have a product listing, no matter how many products are shown, every product that is countable needs to show its base-price.

 

I then searched the whole internet for a "hack" for prestashop to implement the base-price into the product-list. I found some solutions that where acually coded for older PS-Versions and unfortunately did not word on my page.

 

So now questeion 1: Is there any posibility to show the base-price of a product right under the main price (see picture=?

 

Now question 2: Is it possible to implement additionally to every product, the brand? Becorse afaik it is not possible to implement brands in Prestashop separately. There is only a possibility to insert the manufaturer which, in many casese, is actually not the brand name, for exmple: A Choclate bar called Bobby, the brand would be named Alice but the Manufacturer is actually Billy Ltd.?

 

example.jpg

 

 

I would appreciate any help concerning these two questions!

 

Greetings

MrBrown

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

This should definitely be part of the advancedeucompliance module because in Germany you actually can't legally sell all the different kinds of products where the price is quantity dependent (250ml/g, 1Liter/kg/Meter etc.) without declaring the price/quantity ratio (5€/1kg, 0,68€/100ml etc). Actually its quite simple, always when a price is shown it is necessary to show incl. VAT, incl. or excl. Shipping, price per quantity and delivery time.

Link to comment
Share on other sites

  • 5 months later...

Hello forum,

I m new to prestashop and close to launch a shop system. Now Im struggeling exactly with this problem, the base-price is not shown in the product listing.

We use a 1.6.14 version and latest version of  eu advanced eu compliance module is installed.

Is there somewhere a option (eaem module? product property?) to dispĺay the base price (EUR per liter / kg) in product page? Or do I have to change a template somewhere? It is really important to show this price near the product price!

Any help is welcome,

thank you dirk

Link to comment
Share on other sites

Hi,

we found the following code and placed it in product-list.tpl

{if $product.unit_price_ratio && $product.unit_price_ratio > 0}
{math equation="b/a" a=$product.unit_price_ratio b=$product.price assign=realunit}
<div class="unit-price productlist_preis_unit">
<span id="unit_price_display">{convertPrice price=$realunit}</span>
<span id="unit_price_display_unit"> {l s='per'} {$product.unity|escape:'html':'UTF-8'}</span>
</div>
{hook h="displayProductPriceBlock" product=$product type="unit_price"}
{/if}
  • Like 1
Link to comment
Share on other sites

Hi kampfi,

thank you very much!

I just also got a similar solution by comparing the product.tpl (here the view is correct) with product_list.tpl in /themes/default-bootstrap/ wich I will post here.

The line which shows the right lines were  (line 307)

{if !empty($product->unity) && $product->unit_price_ratio > 0.000000}
	blahsometext {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:'html':'UTF-8'}</p>
	{hook h="displayProductPriceBlock" product=$product type="unit_price"}
{/if}

Just copying these lines did not work, but having a look to the code above suggested not to use "->" operator.

Having a look to the product controller in shop/classes/Product.php gave a sight into the class variables. Good!

And what finally worked was this (around line 98):

{* show unit price *}

	{if !empty($product.unity) && $product.unit_price_ratio > 0.000000}
          {math equation="pprice / punit_price" pprice=$product.price  punit_price=$product.unit_price_ratio assign=unit_price}
          {*  display something {$product.price} by {$product.unit_price} and by {$product.unit_price_ratio} is {$unit_price} *}
	  <p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='pro'} {$product.unity|escape:'html':'UTF-8'}</p>
	  {hook h="displayProductPriceBlock" product=$product type="unit_price"}
	{/if}
{* end show unit price *}

and it looks like what I want to have. Thank you again for your quick response, thats really great!

- dirk

 

edit: the trick is not to search for a "base_price", but "unit_price". There are already other older threads in the forum... egal :)

Edited by dizz (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...