Jump to content

[1.6.0.9 To 1.6.1.4] Item With Combination Is Showing Incorrect Prices


Recommended Posts

I tried upgrading from Prestashop 1.6.0.9 to 1.6.1.4 and I found several problems. This is one of them.

 

(Please check the picture attached, it will be easier to understand)  :)

 

Basically, the prices that are showing in product page is incorrect. But when I add it to cart, it's showing the correct price.

 

In other words,

 

In BO, the combination is showing the correct additional prices, but what appears in FO is something else.

 

------------------------------------

 

I tried to create a new item and everything works well. It is simply impossible to re-creating all items.

 

Oddly, based on this, I checked ps_product & ps_product_attribute to compare the new item created & the one from 1.6.0.9, everything looks the same except ean13 (it's blank by default if I create a new product in 1.6.1.4, while from 1.6.0.9 is 0).

 

-------------------------------------

 

I tried to add a new combination such size, in the product that is imported from 1.6.0.9. It's showing the incorrect price.

 

-------------------------------------

 

I tried as well to turn on DEV MODE but there's no error report coming up.

 

I also tried to disable 3rd party modules & override, still nothing happens.

 

Please check the picture attached.

 

-------------------------------------

Prestashop Default Theme

post-839725-0-20246700-1452916717_thumb.jpg

post-839725-0-45274000-1452916729_thumb.jpg

post-839725-0-50904800-1452916641_thumb.jpg

post-839725-0-15006400-1452916823_thumb.jpg

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

Are you using default template?

If not, maybe there are some changes in 1.6.14 that affect price.

I've seen in changes log these 2 rows:

 

  • /themes/default-bootstrap/js/product.js
  • /themes/default-bootstrap/product.tpl

Check if with a default template the price are right. If yes, you have to change some code in your template.

Regards

Erik

Link to comment
Share on other sites

Are you using default template?

If not, maybe there are some changes in 1.6.14 that affect price.

I've seen in changes log these 2 rows:

 

  • /themes/default-bootstrap/js/product.js
  • /themes/default-bootstrap/product.tpl

Check if with a default template the price are right. If yes, you have to change some code in your template.

Regards

Erik

 

Yes, I am using default template. I reckon we don't need to do some code changes if we are using the default one & it is such a non-convenient way of upgrading...

Link to comment
Share on other sites

I have the same problem, also using default theme

The both files

·         /themes/default-bootstrap/js/product.js

·         /themes/default-bootstrap/product.tpl

are total different with the previous one.

 

Can i use the previous one without any problems?

Link to comment
Share on other sites

I have the same problem, also using default theme

The both files

·         /themes/default-bootstrap/js/product.js

·         /themes/default-bootstrap/product.tpl

are total different with the previous one.

 

Can i use the previous one without any problems?

 

As you stated, I tried to use 1.6.0.9 for both of the files mentioned. The result is still the same...

What's make this more difficult is there's no error message showing anywhere...

Link to comment
Share on other sites

Ben90, nobody hepls us.

I see on your screenshots that you are using discount. Can you deactivate it?

I want to verify my version: I think the problem is here.

 

Oh! You're right! The problem is with the "specific price" which also means DISCOUNT.

Do you have a solution for this?

Link to comment
Share on other sites

Unfortunately no.

Now I have disabled mass discounts and are going to try to include the discount in each product (as I remember this is possible).
I think this is a bug but poor knowledge of English does not allow me to report this error. It would be great if someone would do it. Maybe developers will fix the bug because there was not this issue before (only in 1.6.1.4.).

Link to comment
Share on other sites

Unfortunately no.

Now I have disabled mass discounts and are going to try to include the discount in each product (as I remember this is possible).

I think this is a bug but poor knowledge of English does not allow me to report this error. It would be great if someone would do it. Maybe developers will fix the bug because there was not this issue before (only in 1.6.1.4.).

 

I posted about this already on forge.prestashop but still no reply until now. It's been a few days.

 

And this subforum also pretty quiet compare to the other ones...   :(

  • Like 1
Link to comment
Share on other sites

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

i found the fix

 

change controllers\front\ProductController.php

 

line 456:

 $combinations[$row[‘id_product_attribute’]][‘price’] = (float)Tools::convertPriceFull($row[‘price’], null, Context::getContext()->currency);

 

change to:

 

$combinations[$row['id_product_attribute']]['price'] = (float)$row['price'];

 

and it will show correct price

Edited by nieman101 (see edit history)
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

k@#0%! Same bullshit here. We are trying to solve this issue ASAP because if we don't - we're gonna loose a bunch of money.

In our store the prices of the combinations in a product page looks OK and accurate. BUT ... when we add a product combination with an impact of the price to the cart, the price of the product in the cart is incorrect. In fact, extremely lower than the impact set in the admin panel.

 

We've tried the trick with the default theme but that doesn't fix the issue.
 

Will let you know if we have some positive progress.

UPDATE: The impact on prices actually works correctly with the default user groups - Visitors, Customers. It does not work with custom created user groups.

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

Well, after some precious hours spent by our development team (Thank you so much), I think we found a solution to the problem.

Here is our solution which actually work for us (Prestashop 1.6.1.4):

 

1. Locate the file  ...  /public_html/classes/Product.php
 

2. Find the code on row 3036:  

 

        // Attribute price

        //if (is_array($result) && (!$specific_price || !$specific_price['id_product_attribute'] || $specific_price['price'] < 0)) {
 
  $attribute_price = Tools::convertPrice($result['attribute_price'] !== null ? (float)$result['attribute_price'] : 0, $id_currency);
            // If you want the default combination, please use NULL value instead
            if ($id_product_attribute !== false) {
                $price += $attribute_price;
            }
        //}

 

3. There is an array named $result. Before the If the price of the attribute exists. In the If the price vanishes and there is no change in this If to disapper

 

We've put comments before the If rule and that does it - lines 3036 and 3042 in the file.

I hope this helps. Let me know if you decide to give it a try.

 

P.S. You may have different location of the file Product.php. Ask somebody who knows the code. ;)

 

Golden rule for our team: We upgrade to higher version of Prestashop only once per year. It's like the OS of a PC.

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

 

i found the fix

 

change controllers\front\ProductController.php

 

line 456:

 $combinations[$row[‘id_product_attribute’]][‘price’] = (float)Tools::convertPriceFull($row[‘price’], null, Context::getContext()->currency);

 

change to:

 

$combinations[$row['id_product_attribute']]['price'] = (float)$row['price'];

 

and it will show correct price

 

 

It doesn't work, mate. I've just tried.

 

Well, after some precious hours spent by our development team (Thank you so much), I think we found a solution to the problem.

 

Here is our solution which actually work for us (Prestashop 1.6.1.4):

 

1. Locate the file  ...  override/classes/Product.php

 

2. Find the code between lines 428 and 436 

 

        // Attribute price

        //if (is_array($result) && (!$specific_price || !$specific_price['id_product_attribute'] || $specific_price['price'] < 0)) {
 
  $attribute_price = Tools::convertPrice($result['attribute_price'] !== null ? (float)$result['attribute_price'] : 0, $id_currency);
            // If you want the default combination, please use NULL value instead
            if ($id_product_attribute !== false) {
                $price += $attribute_price;
            }
        //}

 

3. There is an array named $result. Before the If the price of the attribute exists. In the If the price vanishes and there is no change in this If to disapper

 

We've put comments before the If rule and that does it.

I hope this helps. Let me know if you decide to give it a try.

 

Golden rule for our team: We upgrade to higher version of Prestashop only once per year. It's like the OS of a PC.

 

Hi there, are you sure the location of the file is correct? There is no Product.php inside override directory.

 

However, I found it in .../classes/Product.php

        // Attribute price
        if (is_array($result) && (!$specific_price || !$specific_price['id_product_attribute'] || $specific_price['price'] < 0)) {
            $attribute_price = Tools::convertPrice($result['attribute_price'] !== null ? (float)$result['attribute_price'] : 0, $id_currency);
            // If you want the default combination, please use NULL value instead
            if ($id_product_attribute !== false) {
                $price += $attribute_price;
            }
        }

I am not really sure which part I should put the comment, I tried to comment out all of the code above and it does nothing.

I also tried to comment out the IF inside (line 3039 - 3041), but still no luck.

  • Like 1
Link to comment
Share on other sites

Put comments at lines 3036 and 3042. Row 2 and 8 below.

 

  1. // Attribute price
  2. //if (is_array($result) && (!$specific_price || !$specific_price['id_product_attribute'] || $specific_price['price'] < 0)) {
  3. $attribute_price = Tools::convertPrice($result['attribute_price'] !== null ? (float)$result['attribute_price'] : 0, $id_currency);
  4. // If you want the default combination, please use NULL value instead
  5. if ($id_product_attribute !== false) {
  6. $price += $attribute_price;
  7. }
  8. //}
Edited by guanooo (see edit history)
Link to comment
Share on other sites

So, I replace:

\controllers\front\ProductController.php

\classes\Product.php

 

with the master file of Prestashop 1.6.1.4 from

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/controllers/front/ProductController.php

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/classes/Product.php

 

It solved the problem...

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

So, I replace:

\controllers\front\ProductController.php

\classes\Product.php

 

with the master file of Prestashop 1.6.1.4 from

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/controllers/front/ProductController.php

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/classes/Product.php

 

It solved the problem...

 

Confirmed, This works for me.

 

Thanks for sharing the solution.

Link to comment
Share on other sites

So, I replace:

\controllers\front\ProductController.php

\classes\Product.php

 

with the master file of Prestashop 1.6.1.4 from

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/controllers/front/ProductController.php

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/classes/Product.php

 

It solved the problem...

 

Thanks for sharing this. Saved me hours of frustration. Works perfectly.  :)

Link to comment
Share on other sites

So, I replace:

\controllers\front\ProductController.php

\classes\Product.php

 

with the master file of Prestashop 1.6.1.4 from

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/controllers/front/ProductController.php

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/classes/Product.php

 

It solved the problem...

This works for me too!!

Thanks for your help. I can't believe such error from Prestashop!

Edited by mxmart.mx (see edit history)
Link to comment
Share on other sites

So, I replace:

\controllers\front\ProductController.php

\classes\Product.php

 

with the master file of Prestashop 1.6.1.4 from

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/controllers/front/ProductController.php

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/classes/Product.php

 

It solved the problem...

 

It worked for me too!!! Great job. 

Thanks

 

Needs an urgent update from Prestashop for this error.

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

can someone help me?
I have the same problem after updating from version 1.5.4 to 1.6.1.4 prices do not remain but returns the first selection.
I have two websites: 
 
in one of the combinations only work for users without group discounts, in practice does not update the price of the selection.
in the other the selection of the combination after a few seconds returns to the first choice.
 
Example of combination link 1:http://micelimoto.it/it/60-cavalletto-new-revers.html#/1-coloreruote-rosse/60-misura_perno-ducati_o_425_2745
Example of combination link  2:http://www.micelimoto.com/it/174-cavalletto-reversibile.html#/1-colore-ruoterosse/41-misura-pernoducati-425-3631
 
The links are different..
I can not find the solution, help Thanks!
 

Elio Miceli

 

 

 

Italian

qualcuno può aiutarmi?
ho lo stesso problema dopo aver aggiornato da 1.5.4 alla versione 1.6.1.4 i prezzi non rimangono ma torna la prima selezione.
ho due siti web:

  • in uno le combinazioni funzionano solo per utente senza gruppo di sconti, in pratica non aggiorna il prezzo della selezione.
  • nell'altro la selezione della combinazione dopo qualche secondo ritorna alla prima scelta.

link articolo con combinazione 1: http://micelimoto.it/it/60-cavalletto-new-revers.html
link articolo con combinazione 2: http://www.micelimoto.com/it/174-cavalletto-reversibile.html
 
esempio di link con combinazione 1: http://micelimoto.it/it/60-cavalletto-new-revers.html#/1-coloreruote-rosse/60-misura_perno-ducati_o_425_2745
esempio di link con combinazione 2: http://www.micelimoto.com/it/174-cavalletto-reversibile.html#/1-colore-ruoterosse/41-misura-pernoducati-425-3631

 

i link sono differenti..

io non riesco a trovare la soluzione ;( Grazie!

Link to comment
Share on other sites

I solved the problem in this world ..
I went B.O. Settings> Products
Here I selected the anchor separator product and I saved, Done!
it worked for me.. Thanks 
 
il problema l'ho risolto in questo modo..
sono andato in B.O. Impostazioni>Prodotti
qui ho selezionato il separatore dell'ancora dei prodotti ed ho salvato, Fatto!
con me ha funzionato.. Grazie

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 3 months later...
  • 3 months later...

So, I replace:

\controllers\front\ProductController.php

\classes\Product.php

 

with the master file of Prestashop 1.6.1.4 from

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/controllers/front/ProductController.php

https://raw.githubusercontent.com/PrestaShop/PrestaShop/master/classes/Product.php

 

It solved the problem...

Thanks a lot. It worked for me :)

Link to comment
Share on other sites

  • 1 month later...

Hi,

tried changing the files (Product.php and ProductController.php), still ending up with Price 0 when product has attributes. When selecting "Enable JqZoom" instead of "Fancybox" the price of first attribute shows correctly but when switching to the other ones the price shows 0.

 

http://sona2.dm-project.co.uk/ru/podushki/20-manima-blue.html

 

Any other solutions?

Link to comment
Share on other sites

  • 2 years later...

I have 1.6.1.4 version, and for users with group discount the price of products with combinations are not shown correctly

if i put in cart, the price is ok

I tried the @Ben90's above solution, but the page of products was not loaded at all.

This page isn’t working
www.xyz.com is currently unable to handle this request.
HTTP ERROR 500

Maybe isn't compatible yet, i know that 1.6.1.4 is to old. 

Maybe someone has resolved this issue

thanks

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