Jump to content



Photo

Prices Are Not Getting Correct - Cart


  • Please log in to reply
8 replies to this topic

#1 vikky

vikky

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 4 April 2017 - 4:10 AM

If my price of the product is less than thousand then the prices are correct after update or any calculation.

 

For example - if I am increasing or decreasing the quantity.

 

But if the price of the product is above thousand than it is giving the wrong answers.

 

And in practical scenario the cost or price of the product can be any digit.

 

thanks in advance.

 


  • 0

#2 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4698 posts
  • LocationState College, PA (USA)

Posted 5 April 2017 - 11:36 AM

I think you'll need to change the column definition for the price. What is it currently?


  • 0

#3 vikky

vikky

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 8 April 2017 - 7:20 AM

The column definition for the price currently is INT UNSIGNED NOT NULL which is 4,294,967,295 and my current prices are below this numeral.

 

For example: (1) When I increased the price of the Kona::Half Pound - decaf - ground from $5.00 to $50.00 (added one 0). It is showing the correct result. $50.00 x 21 (qty) = $1,050.00.

 

(2) When I increased the price of Kona::1 lb. - caf - whole from $7.50 to $750.00. It is giving the correct answer. $750.00 x 2 = $1,500.00. BUT

 

(3) When I increased the price of Kona::1 lb. - caf - ground from $8.00 to $8,000.00. It is not giving the accurate answer.

 

(4) When the price of Kona::1 lb. - decaf - ground is increased from $8.50 to 8,500.00 and the quantity is increased from 1 to 2. It is showing $16.00 instead of $17,000.00.


  • 0

#4 vikky

vikky

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 8 April 2017 - 7:23 AM


  • 0

#5 vikky

vikky

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 8 April 2017 - 8:10 AM

Below is the screen shot of the cart

 


  • 0

#6 vikky

vikky

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 8 April 2017 - 8:12 AM

Sorry I tried to paste the screen shot but it is not showing anything.


  • 0

#7 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4698 posts
  • LocationState College, PA (USA)

Posted 10 April 2017 - 10:05 PM

Okay, um...nothing obvious coming to mind. Could you confirm that you're seeing this on the page for viewing the cart's contents (i.e., cart.php)? And are you using stored procedures? 


  • 0

#8 vikky

vikky

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 16 April 2017 - 5:22 AM

Yes, this page is localhost/cart.php and I am using stored procedures.

 

 

I have not changed anything from downloaded codes other than prices.


  • 0

#9 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4698 posts
  • LocationState College, PA (USA)

Posted 19 April 2017 - 4:08 PM

Hmmm...okay. I still don't have an obvious answer here. What I would do to debug this is first run the stored procedure directly to confirm whether the problem is on the database side or the PHP -> HTML side. If the stored procedure is also turning out wrong results, I'd run a subset of the stored procedure's query to see if that's working. 

 

Sorry I don't have an obvious "this is the problem" answer for you but I haven't seen this before and don't know of the clear problem.


  • 0