close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

issue when item added to cart is >= 1000

Thread began 1/10/2010 6:44 pm by sam308940 | Last modified 2/16/2010 12:02 pm by sam308940 | 1012 views | 6 replies |

sam308940

issue when item added to cart is >= 1000

I have an issue with any items added to the cart that end up being 1000 or more.

If i add 250 of an item to the cart and its $4 each its shown/calculated ITEM TOTAL is $1. anything over $1000 from my testing, looses the 3 zeros. so if its $2000 it shows as $2.

however, if i add 100 of item A and 150 of item B, the totals are calculated correctly. There is no error.

SO I have an issue that is related specifically to the calculting of the ITEM TOTALS ONLY, the subtotal of the entire order is fine.

Is there something I can do to fix this?

Thanks in advance
Sam

Sign in to reply to this post

Jason ByrnesWebAssist

it sounds like you have some calculations in your cart that are causing the issue.

can you send a copy of your cart include file so I can take a look.

Sign in to reply to this post

sam308940

Thank you!

Attached Files
pcccart_PHP.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the cart object you have sent does no exhibit the error you reported in the initial post, in the cart object you have sent, no matter what I set the quantity to for an item, the item total is always the price.


If i have an item that costs $4 and add it to the cart, then change the quantity to 10, the total is still $4. This is because you have changed the TotalPrice calculation to:
TotalPrice: [Price]


it should be:
TotalPrice: [Price] * [Quantity]

Sign in to reply to this post

sam308940

hi - no this is correct
because i am calculating the total before it reaches the cart i set it up that way on purpose as i do not wany quantity changeable or even 2 of same item.

ie if someone purchases 500 of item $2, it passes to the cart as 1 item of $1000.
The description shows the qty.

if you go here you can see:
card_view.php?P=487&C=B&S=BM

BUT... you hit on something for me.
use the link above, and pick a quantity that will total more than $1000
(you dont have to enter anything on the personalize/second page-just continue)
you will see that after you add to cart, you get the error amount shown.

I also have an alternative payment page - this just passes an amount to the cart.
(enter any order # and any amount over 1000)
payment.php
when i use this to add to the cart, i DONT get that error amount.

im attaching the file here for that page that passes the price to the cart and gives an error.

anything that jumps out in my add to cart code?
(i realize this is getting beyond basic tech support as its my edited code....i understand if you cant help on this one).

Attached Files
card_personalize.zip
Sign in to reply to this post

Jason ByrnesWebAssist

I think for some reason, the comma in the price is causing the problem.


change the following line:

php:
$ATC_itemPrice = floatval("".((isset($_POST["TOTAL"]))?$_POST["TOTAL"]:"")  ."");// column binding




to:

php:
$ATC_itemPrice = floatval("".((isset($_POST["TOTAL"]))?str_replace(",","",$_POST["TOTAL"]):"")  ."");// column binding
Sign in to reply to this post

sam308940

THANK YOU
that worked perfectly


sorry i took so long to get back on this item
but i wanted to post that it solved the issue in case anyone else ever runs into it.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...