Jump to content

Pricing Issue - Specific Price Suddenly Stopped


Recommended Posts

Prestashop 1.6.1.2

at 3:00 pm all my products were showing correct pricing

at 3: 45 after adding 5 more products, specific pricing for all 100 products stopped working.

 

When I click on edit product - specific price for all products is visible but in the Front Office and Back Office final price of the product does not include specific price.

 

Basically after adding 5 product more to my list  - Specific pricing completely stopped working.

 

What is the possible issue?

Please help.

 

P.S 

No other changes were made since only I have access to Back Office.

Link to comment
Share on other sites

  • 2 weeks later...

Okey dokey, they've changed the getSpecificPrice code between 1.6.1.1 and 1.6.1.2 and the new function to create the query is filtering out previous some previous parts of the query.

 

1.6.1.1

SELECT *, ( IF (`id_group` = 1, 2, 0) +  IF (`id_country` = 21, 4, 0) +  IF (`id_currency` = 2, 8, 0) +  IF (`id_shop` = 1, 16, 0) +  IF (`id_customer` = 0, 32, 0)) AS `score`
FROM `ps_specific_price` USE INDEX (id_product_2)
WHERE `id_product` IN (0, 1)
AND `id_product_attribute` IN (0, 0)
AND `id_shop` IN (0, 1)
AND `id_currency` IN (0, 2)
AND `id_country` IN (0, 21)
AND `id_group` IN (0, 1)
AND `id_customer` IN (0, 0)
AND
(
(`from` = '0000-00-00 00:00:00' OR '2016-03-19 09:06:00' >= `from`)
AND
(`to` = '0000-00-00 00:00:00' OR '2016-03-19 09:06:00' <= `to`)
)
AND id_cart IN (0, 0)
AND IF(`from_quantity` > 1, `from_quantity`, 0) <= 1 ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC

1.6.1.2

SELECT *, ( IF (`id_group` = 1, 2, 0) +  IF (`id_country` = 21, 4, 0) +  IF (`id_currency` = 2, 8, 0) +  IF (`id_shop` = 1, 16, 0) +  IF (`id_customer` = 0, 32, 0)) AS `score`
FROM `ps_specific_price`
WHERE `id_shop` IN (0, 1)
AND `id_currency` IN (0, 2)
AND `id_country` IN (0, 21)
AND `id_group` IN (0, 1)
AND `id_product` IN (0, 1) AND `id_customer` = 0 AND `id_product_attribute` = 0  AND (`from` = '0000-00-00 00:00:00' OR '2016-03-19 00:00:00' >= `from`) AND (`to` = '0000-00-00 00:00:00' OR '2016-03-19 00:00:00' <= `to`)
AND IF(`from_quantity` > 1, `from_quantity`, 0) <= 1 ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC, `to` DESC, `from` DESC

When you call the getPrice from front office or back office controller it passes null for id_customer and id_cart, which drops them from the query which means it'll return all the records with an id_cart set (in my case); so i'm still pretty confident it's a bug, I can't see a way to change the entry on the specific price table so that it is filtered out by this query.

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