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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Rounding up of Quantities

Thread began 2/05/2010 11:27 am by markdoyle87077 | Last modified 2/10/2010 1:45 pm by Jason Byrnes | 933 views | 5 replies |

markdoyle87077

Rounding up of Quantities

Need help solving a problem. One of our customers has started ordering our products using fractions instead of whole numbers i.e they will change the default 1 to 0.5. Should eCart stop this behaviour from happening or not?

Sign in to reply to this post

Jason ByrnesWebAssist

eCart 5 will allow fractions as long as it is entered as "0.5" and not ".5"

Sign in to reply to this post

markdoyle87077

Rounding up of fractions

Is there anyway of stopping the customers entering fractions as we only want them to be able to order in whole numbers.

Sign in to reply to this post

Jason ByrnesWebAssist

in the eCart object file, find the following:

php:
if (isset($_POST[$this->CartName."_Quantity_".$n])) {

      $itemQuantity = floatval($_POST[$this->CartName."_Quantity_".$n]);
    }





and change it to:

php:
if (isset($_POST[$this->CartName."_Quantity_".$n]) && is_int($_POST[$this->CartName."_Quantity_".$n)) {

      $itemQuantity = floatval($_POST[$this->CartName."_Quantity_".$n]);
    }
Sign in to reply to this post

markdoyle87077

Rounding

Hi Jason,

Could I get that code is ASP please.

Regards

Sign in to reply to this post

Jason ByrnesWebAssist

for an asp cart, find all lines that begin with
itemQuantity = cDbl



there should be 5 of them, and change it to:
itemQuantity = Int


leave the code that follows on each line as is.

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...