Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

QPBPP with SPPC / Prices under $1 not working


toughmama

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

Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...