Guest Posted April 10, 2010 Share Posted April 10, 2010 I've found something really weird in de QPBPP mod. I tested a lot to minimize the situations in which cases it fails. I added a product with a price of 2.50 (Retail) The price for customer_group 1 is 0.99 In product_listing.php en product_info.php the right price is shown. When I add the product to the shopping_cart the price changed to 2.50 (Retail price) In product_listing.php, at the end of the addition for QPBPP (around line 240) I added an echo statement to see what the values of the variables became. // BOF QPBPP for SPPC $price_breaks_from_listing = array(); if (isset($price_breaks_array[$listing[$x]['products_id']])) { $price_breaks_from_listing = $price_breaks_array[$listing[$x]['products_id']]; } $pf->loadProduct($listing[$x]['products_id'], $languages_id, $listing[$x], $price_breaks_from_listing); $lc_text = $pf->getPriceStringShort(); echo '(line_244) $lc_text= '. $lc_text.' '; echo ' $listing[$x][\'products_price\']='.$listing[$x]['products_price']; echo '<br>';// EOF QPBPP for SPPC The initial values are: (line_244) $lc_text= €0,99 $listing[$x]['products_price']=0.9900 Which is correct. After adding the product to the shopping_cart the values changed to (line_244) $lc_text= €2,50 $listing[$x]['products_price']=0.9900 The price in the shopping_cart becomes 2.50 too It only happens in case the price of customer_group is lower than 1.00 If I change the retail_price to 0.70 and the customer_group price is 0.99 the price becomes the retail price (even when it is lower) So in case the customer_group price is lower 1.00 the price will always chang to the retail price if the price has a special_price everything looks ok. If the customer_group price is 1.00 or higher everything looks ok too. So as far as I can see the fault only happens in case a customer_group price is lower than 1.00. Now I'm stuck because I'm not sure where the price alteration happens. Please help me find the solution. Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted April 11, 2010 Share Posted April 11, 2010 I've found something really weird in de QPBPP mod. It only happens in case the price of customer_group is lower than 1.00 It is a mistake in the class PriceFormatterStore.php around line 86 which looks for the customer_group_price to see if it NULL. It looks if the integer of the new price is larger than 1.... If you change to check if it is numeric (haven't checked a price value of 0.0000) than it works again with prices lower than 1: // customer group price can be NULL so use retail if empty if (is_numeric($new_prices[$i]['products_price'])) { Quote Link to comment Share on other sites More sharing options...
Guest Posted April 11, 2010 Share Posted April 11, 2010 It is a mistake in the class PriceFormatterStore.php around line 86 which looks for the customer_group_price to see if it NULL. It looks if the integer of the new price is larger than 1.... If you change to check if it is numeric (haven't checked a price value of 0.0000) than it works again with prices lower than 1: // customer group price can be NULL so use retail if empty if (is_numeric($new_prices[$i]['products_price'])) { Jan, you're the BEST. it works. I changed PriceFormatterStore.php to // customer group price can be NULL so use retail if empty // if ((int)$new_prices[$i]['products_price'] > 0 ) { if (is_numeric($new_prices[$i]['products_price'])) { $product_info[$x]['products_price'] = $new_prices[$i]['products_price']; } I tested also with a customer_group price of 0.00 and that works too. The price stays 0.00 instead becoming retail price. When customer_group price is ommitted it becomes the retail price. THANKS!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.