Jump to content

Combinations prices displaying wrong: after upgrade to PS 1.6.1


Recommended Posts

Hello!

 

Firstly, I shall start off by saying I've searched far and wide for answers to my problem with no luck whatsoever. I am starting a new thread as this pertains to a problem that started after upgrading to Prestashop 1.6.1. 

 

In the BO, in products that already exist, I am unable to select a default combination when I add combinations to preexisting products.  Subsequently I see big problems on the product page. 

 

In my case, we can talk about a fungicide for plants available in two sizes: 30ml and 100ml. I set the price of the product itself to 9.95€ and add two combinations (30 and 100ml). The 30ml option has no price impact; the 100ml increases the price 12€.

 

The problem: combinations are displaying incorrect pricing when you go to the FO product page.

1. The product in the 100ml size shows up as costing 12€ (which is in reality the price impact).

2. The product in the 30ml size shows up as costing 0.00€ (again, the price impact).

3. When added to the cart, the price is added correctly (price impact + base price of the product).

 

You can see the product by clicking here.

 

Strangely, when the page first loads, the price appears correctly, then quickly disappears!

 

Products that I have recently added are fine, for example this one here, and do not demonstrate this problem.

 

Any help would be appreciated. I checked our currency rate (euro, set to 1) and several other possible variables (though I noticed many threads pertaining to group discounts, we have none set and furthermore just upgraded to 1.6.1 which in theory would incorporate bugs in the js from past versions).

 

We are using the latest Attribute Wizard module and I have spoken to the developer, they claim it is not originating in their module.

 

Thanks in advance! And I hope we can get some answers for the community because I know many have had similar issues!

Link to comment
Share on other sites

PS 1.6.1 is VERY unstable. I'm fighting since the day I installed it as it messes up so many stuffs.

- Discount to Groups can't be affected correctly.

- Combinations don't work properly

- When a product is part of a pack

 

And the great thing is that I can't upgrade to 1.6.1.1!

 

I don't understand why an upgrade like this can be even available to download?!!

Link to comment
Share on other sites

 

Hi Musicmaster! Unfortunately, the adjustment to the tpl files did not help, it threw off the pricing on products that were not experiencing the problem. A problem which has me scratching my head, is it something in the DB or the js that is multiplying by zero to produce the appearance of the price. Indeed, the price appears and suddenly drops to zero as the page is loaded. Then it does add correctly to the cart (base price + price increase).

 

I was taking a look at the some of the other files referenced by another thread regarding a number of recommended changes to numerous files, though the coding of their product.tpl differed from mine (mine has no + or - linking expressions, and I am no js expert!). 

Link to comment
Share on other sites

PS 1.6.1 is VERY unstable. I'm fighting since the day I installed it as it messes up so many stuffs.

- Discount to Groups can't be affected correctly.

- Combinations don't work properly

- When a product is part of a pack

 

And the great thing is that I can't upgrade to 1.6.1.1!

 

I don't understand why an upgrade like this can be even available to download?!!

 

Well, we are in the same club as you. Perhaps our problem is related to Group Discounts. Combinations are NOT working properly for us on PRODUCTS THAT ALREADY EXISTED since version 1.5.?. 

 

I found that we are unable to SET DEFAULT COMBINATIONS on these products that were already in the DB. A major pain the @$$ as we have many products with combinations from then. 

**update: I was able to set the default combination in Safari, but then had trouble saving. When I saved with the proper price, and returned to the product the price was set to 0! Then I reloaded and it returned to the correct price. PS is a psychedelic nightmare labyrinth! :(((((

 

Anyone with some insight? Recalling that you are being a pioneer in solving an issue that has affected many and has so far not been met with a definitive solution.  

 

Then, those products with combinations appear as

Link to comment
Share on other sites

There is one difference on combinations in the database between 1.6.0 and 1.6.1: in the table ps_product_attribute_shop a field id_product has been added.

 

If you see a difference in behavior between old and new combinations you might check whether this new field has been filled correctly for the old combinations.

  • Like 1
Link to comment
Share on other sites

There is one difference on combinations in the database between 1.6.0 and 1.6.1: in the table ps_product_attribute_shop a field id_product has been added.

 

If you see a difference in behavior between old and new combinations you might check whether this new field has been filled correctly for the old combinations.

 

Thanks for the tip, musicmaster, I am going to check it out with my database ninja :) Will keep you all posted :D

Link to comment
Share on other sites

Hi there, the same problem here with Prestashop 1.6.1.1.

 

When a product has attributes, when selecting the attribute it's showing the price impact (instead of mainarticleprice + the price impact)

Adding a product to the shopping cart: shows the correct price

Adding a product with attributes manually via the backend: no problems
Opening a product with attributes in the backend, selecting combinations choose to edit a combination and save the combination: everything for that product works fine again

When adding products via the webservice API: the problem arises (in 1.6.0.14 it worked fine)

 

The above suggestions do not solve this.

Link to comment
Share on other sites

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

I got same problem.

 

-If product got combination, product price is 0,00€ in product page.

-When adding product to cart price is correct.

-I also got error message on product page when adding product to cart. "there aint product with this combination. Plz select other"

 

Has somebody found solution to this problem?

 

Presta 1.6.1.1

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

I found reason for my problem.

 

After update prestashop 1.6.0.9 to 1.6.1.1 non of my products wich got compination doesen't got DEFAULT compination chosen.

 

For example:

Product got two compinations

1. Buy extra batteries

2. don't buy

 

Non of these have't chosen default. I can chose default compination to product and then it will work right. 

 

Can I somehow do this to all my products from database?

Link to comment
Share on other sites

I am not that good in complex MySql command and prefer to solve it with a PHP script. In pseudo code it would be something like 

get all records from ps_product_attribute_shop ordered by id_product.
foreach record
  set in the first record default_on to 1 and then skip the rest of records for that product.

If you pm me the credentials for your phpmyadmin I could do it for you as it is rather simple.

 

Of course you need to make a backup. It is easy to make some small error. As soon as you make some changes you should check whether things work correctly now - both in the database and in the shop itself.

Link to comment
Share on other sites

Here is the code for who needs it.

 

You should fill in the credentials of your database at the top. Note that the "PS_" prefix is hardcoded at some places.

 

You can put the code at any place in your website and run it. For security reasons: remove it once you have used it.

 

The code assigns one default combination to each product. It always takes the first one it encounters. If there are products that already had a default combination, that will be changed.

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

  • 2 weeks later...

If you have already the information on the table is easy with just sql command

UPDATE ps_product_attribute_shop ppas
INNER JOIN ps_product_attribute ppa ON (ppas.id_product = ppa.id_product and ppas.id_product_attribute = ppa.id_product_attribute)
SET ppas.price = ppa.price, ppas.default_on = ppa.default_on

Just add the fields you need on the set part 

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

So I installed 1.6.1.4 today after some module issues and I've run into this combinations-pricing issue. 

 

As above, my product pages for ANY products with combinations are showing as £0.00. 

 

After reading the posts, it seems as though you solve the issue through the database but I have absolutely no idea where to start.

 

I've reverted back to 1.5.4 for the moment but I'd like to switch to the newest version asap so any advice would be great!

 

Thanks in advance!

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

  • 3 weeks later...

Last week I upgrade my Prestashop from 1.6.0 to 1.6.1.

The prices of product combinations are wrong displayed, but the cart is filled with the correct prices.

The default combinations display correct prices.

I tried to apply all the solutions proposed in this forum, but I could not get it to work properly.

 

I found that the problem is the object JavaScript 'combinations' in the sub-object 'specific_price'

 

in the previous version: combinations[0]['specific_price']['price'] = '-1.000000' as STRING

In the new version 1.6.1:  combinations[0]['specific_price']['price'] = 72.95082 as FLOAT but correct in Default Combination

 

Can someone help me?

 

VERSION 1.6.0

var combinations = {"840":{"attributes_values":{"92":"Grigio \/ Gray"},"attributes":[1365],"price":0,"specific_price":{"id_specific_price":"3408","id_specific_price_rule":"0","id_cart":"0","id_product":"2356","id_shop":"0","id_shop_group":"0","id_currency":"0","id_country":"0","id_group":"0","id_customer":"0","id_product_attribute":"0","price":"-1.000000","from_quantity":"1","reduction":"20.000000","reduction_tax":"1","reduction_type":"amount","from":"0000-00-00 00:00:00","to":"0000-00-00 00:00:00","score":"0"},"ecotax":0,"weight":0,"quantity":198,"reference":"1888","unit_impact":"0.000000","minimal_quantity":"1","available_date":"2015-03-29","date_formatted":"29\/03\/2015","id_image":-1,"list":"'1365'"},"838":{"attributes_values":{"92":"Marrone \/ Brown"},"attributes":[1364],"price":0,"specific_price":{"id_specific_price":"3408","id_specific_price_rule":"0","id_cart":"0","id_product":"2356","id_shop":"0","id_shop_group":"0","id_currency":"0","id_country":"0","id_group":"0","id_customer":"0","id_product_attribute":"0","price":"-1.000000","from_quantity":"1","reduction":"20.000000","reduction_tax":"1","reduction_type":"amount","from":"0000-00-00 00:00:00","to":"0000-00-00 00:00:00","score":"0"},"ecotax":0,"weight":0,"quantity":199,"reference":"1890","unit_impact":"0.000000","minimal_quantity":"1","available_date":"2015-03-29","date_formatted":"29\/03\/2015","id_image":-1,"list":"'1364'"},"836":{"attributes_values":{"92":"Panna \/ Cream"},"attributes":[1363],"price":0,"specific_price":{"id_specific_price":"3408","id_specific_price_rule":"0","id_cart":"0","id_product":"2356","id_shop":"0","id_shop_group":"0","id_currency":"0","id_country":"0","id_group":"0","id_customer":"0","id_product_attribute":"0","price":"-1.000000","from_quantity":"1","reduction":"20.000000","reduction_tax":"1","reduction_type":"amount","from":"0000-00-00 00:00:00","to":"0000-00-00 00:00:00","score":"0"},"ecotax":0,"weight":0,"quantity":198,"reference":"1889","unit_impact":"0.000000","minimal_quantity":"1","available_date":"2015-03-29","date_formatted":"29\/03\/2015","id_image":-1,"list":"'1363'"[spam-filter];
 
VERSION 1.6.1
var combinations = {"840":{"attributes_values":{"92":"Grigio \/ Gray"},"attributes":[1365],"price":0,"specific_price":{"id_specific_price":"2323","id_specific_price_rule":"0","id_cart":"0","id_product":"2356","id_shop":"0","id_shop_group":"0","id_currency":"0","id_country":"0","id_group":"0","id_customer":"0","id_product_attribute":"0","price":72.95082,"from_quantity":"1","reduction":"20.000000","reduction_tax":"1","reduction_type":"amount","from":"0000-00-00 00:00:00","to":"0000-00-00 00:00:00","score":"32"},"ecotax":0,"weight":0,"quantity":198,"reference":"1888","unit_impact":0,"minimal_quantity":"1","available_date":"2015-03-29","date_formatted":"29\/03\/2015","id_image":-1,"list":"'1365'"},"838":{"attributes_values":{"92":"Marrone \/ Brown"},"attributes":[1364],"price":0,"specific_price":{"id_specific_price":"2323","id_specific_price_rule":"0","id_cart":"0","id_product":"2356","id_shop":"0","id_shop_group":"0","id_currency":"0","id_country":"0","id_group":"0","id_customer":"0","id_product_attribute":"0","price":72.95082,"from_quantity":"1","reduction":"20.000000","reduction_tax":"1","reduction_type":"amount","from":"0000-00-00 00:00:00","to":"0000-00-00 00:00:00","score":"32"},"ecotax":0,"weight":0,"quantity":199,"reference":"1890","unit_impact":0,"minimal_quantity":"1","available_date":"2015-03-29","date_formatted":"29\/03\/2015","id_image":-1,"list":"'1364'"},"836":{"attributes_values":{"92":"Panna \/ Cream"},"attributes":[1363],"price":0,"specific_price":{"id_specific_price":"2323","id_specific_price_rule":"0","id_cart":"0","id_product":"2356","id_shop":"0","id_shop_group":"0","id_currency":"0","id_country":"0","id_group":"0","id_customer":"0","id_product_attribute":"0","price":"-1.000000","from_quantity":"1","reduction":"20.000000","reduction_tax":"1","reduction_type":"amount","from":"0000-00-00 00:00:00","to":"0000-00-00 00:00:00","score":"32"},"ecotax":0,"weight":0,"quantity":198,"reference":"1889","unit_impact":0,"minimal_quantity":"1","available_date":"2015-03-29","date_formatted":"29\/03\/2015","id_image":-1,"list":"'1363'"[spam-filter];
 
 
Thanks!
Link to comment
Share on other sites

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

i am also having this issue.

 

The product page is only showing 2 price variations on pages that i did not maunally choose the default product and only 1 price variation on the products that i did not manually change the default on.

yesterday this was not a problem i had multiple price points and they all showed on the product display page when i clicked on different options. What is going on ?

 

i have only added prestashop modules and i havent changed any files or anything.

 

I set up fedex shipping and spent forever adding products weight and package size once i was done i was checking if the shipping was accurate and suddenly started having the price problem. I have tried disabling ifedex, debug mode and I have added new products with less attributes this does not work.

 

i have the newest version of prestashop, i just started the site a few days ago.

 

Please help

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

  • 1 month later...

Ok... Now here is the issue I am having.

 I have a $1000 product with $0 combinations and I apply a discount to that category of $150.

Works fine if the customer is not logged in.

 

But any logged in customer 

The price shows correctly on the product list and in the shopping cart but shows wrong on the Product details page.   It seems that it takes the $1000 - 150 + Tax on 150....  For some reason it add the tax back on the 150.      $867.50 it should just show $850

 

If I remove all the combinations .. it works fine.

Link to comment
Share on other sites

  • 1 month later...

Has anyone found a solution for this?  I'm having to go through over 400 products and regenerate the combinations because for half of my combinations (jumpers) the $20 impact on price has just disappeared and the cart is now charging customers the same amount for the base product as the jumpers.  I'm losing money at a rapid rate.  It's going to take days to manually generate all the new combinations and then I'm worried that with the next software update, I'll be in the same boat again.

 

Is there any fix to this issue?

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

I had the same kind of issue. I solved it like this:

Go to controllers/front/ ProductController.php

Change this:

$combinations[$row['id_product_attribute']]['price'] = (float)($row['price'], null, Context::getContext()->currency, false);

To this:

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

 

This fixed my problem anyways. Hope it helps!

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