Jump to content

Price shows 0 when product has attributes


saniaja

Recommended Posts

Hi,

Just upgraded to 1.6.12, when adding product attributes the price in Product Page shows 0 (in other cases the price is ok)

 

For info on product page please see:

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

 

As far as I can tell the problem is in /classes/Product/php file in certain lines. Can some1 take a look and help me with a solution?

 

Have aready tried the solution from (link below) but no success

https://www.prestashop.com/forums/topic/499621-1609-to-1614-item-with-combination-is-showing-incorrect-prices/

 

 

Debugging the presta it shows me following error:

Notice: Undefined index: out_of_stock in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/classes/Product.php on line 4255 Notice: Undefined index: id_category_default in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/classes/Product.php on line 4278 Notice: Undefined index: link_rewrite in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/classes/Product.php on line 4279 Notice: Undefined index: ean13 in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/classes/Product.php on line 4279 Notice: Undefined index: out_of_stock in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/classes/Product.php on line 4255 Notice: Undefined index: id_category_default in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/classes/Product.php on line 4278 Notice: Undefined index: link_rewrite in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/classes/Product.php on line 4279 Notice: Undefined index: ean13 in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/classes/Product.php on line 4279

Link to comment
Share on other sites

In console I found an error -> 
 

notice: Undefined index: BOOTSTRAP_RESPONSIVECSS_URI in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 152Notice: Trying to get property of non-object in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 152

Which might be the reason because probably some .js files are not loaded properly and the price of attribute is given by js. You should contact the guys who made your template, they should know why it is not working. When You add product to the cart the price is calculated properly.

Have You tried to clear the cache?

Link to comment
Share on other sites

Hi,

thank you for your replies.

 

The error: "notice: Undefined index: BOOTSTRAP_RESPONSIVECSS_URI in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 152Notice: Trying to get property of non-object in /var/www/vhosts/s19552268.onlinehome-server.info/sona2.dm-project.co.uk/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 152" has nothing to do with the wrong pricing. The error shows wrong catch message, the catch is turned off.

 

The .js files are alright. When i'm trying to fix /classes/Product.php on line 4255 the prices are showing almost correctly. Prices are shown but when the combinations have impact on the product price the price stays initial

Link to comment
Share on other sites

Your page is offline. But as the problem is rather common I can try an explanation anyway (and there should be other forum posts too).

 

Your javascript is correct. But it executes some ajax calls to retrieve data and those give an error. As the results of those ajax calls is wrong the javascript fails and you get a zero price. This happens only with products with attributes as their final price is calculated by javascript.

 

Evidence: the problematic files in the error message are php file. Not javascript files.

 

It is hard to say where the error is. As Hakeryk wrote, I would start with cleaning the cache. If that doesn't help I would turn off the ccc optimizations. 

 

As Hakeryk wrote - you theme is a suspect. So you could ask the maker of it. You could also do some checks for yourself whether the theme can handle combinations correctly.

 

Another suspect are always modules. You could try to disable all non-Prestashop modules (there is a switch for that). If this doesn't solve the problem it is no evidence that modules are not the cause as some modules cause even then problem when they are disabled - but it is a start.

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...