Jump to content
toughmama

QPBPP with SPPC / Prices under $1 not working

Recommended Posts

Re. QPBPP with SPPC / Prices under $1 not working

 

I found that products under $1 do not calculate properly.

 

If an item is listed for $0.45, and distributor pricing is @ $0.25 – Pricing is listed as 45 cents in the Shopping cart, NOT 25 cents as it should be, (when logged in as a Distributor)

 

The pricing is also the same when on the products listing page... (refer pic below)

 

Examples tried and tested...

I changed pricing to $2, and Dist price to $0.80 - it shows $2

I changed pricing to $2, and Dist price to $1.00 - it shows $1

I changed pricing to $2, and Dist price to $1.20 - it shows $1.20

I changed pricing to $2, and Dist price to $0.99 - it shows $2

 

Any idea where to fix the code ?

 

Thanks,

Todd

post-134054-0-02147100-1394498091_thumb.png

post-134054-0-09700100-1394498098_thumb.png

Share this post


Link to post
Share on other sites

Yes, this is a bug.

 

The issue is caused in file catalog/includes/classes/PriceFormatterStore.php. The file compare the "new price" that is retrieved for the customer group via a special query with the default price and replace it, if condition is met

 

			 if ((int)$new_prices[$i]['products_price'] > 0 ) {
				 $product_info[$x]['products_price'] = $new_prices[$i]['products_price'];
			 }

 

Problem is, that condition is typecasting the new price to (int), this is of course a problem for decimal prices, should not be used

 

Code will work like this

 

			 if ($new_prices[$i]['products_price'] > 0 ) {
				 $product_info[$x]['products_price'] = $new_prices[$i]['products_price'];
			 }

Edited by multimixer

Share this post


Link to post
Share on other sites

Fix works great... all good now.

Thanks George.

 

FYI - Running 2.2 oscommerce for 6yrs..., Now using Mini Template System, and has been the best upgrade. Great support too.

Share this post


Link to post
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

×