close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Maximum quantity of any item per transaction

Thread began 4/18/2011 1:01 pm by marovios@yahoo.com | Last modified 4/25/2011 10:26 am by Jason Byrnes | 1040 views | 5 replies |

marovios@yahoo.com

Maximum quantity of any item per transaction

Hi all, I have an unusual question.
I need to limit the quantity of any item being purchased to 40 per transaction.

A sample scenario would be like this: I'm a user and I purchase 12 items of one product, another 12 from another product and 16 from a third product. I end up with 40 items total. In this case I can continue to check out. But, if I try to purchase more than 40 items I should be stopped by the system. As a user I shouldn't be allowed to purchase more than 40 items (of any products, that doesn't matter) on the same order. If I need to purchase 45 items for example, then I should place an order for 40 items and then another order for 5 items.

Is this possible? I guess I would have to deal with the "Total of Quantity" session if it exists, am I right here? How can I achieve this?

Thanks much!.

Sign in to reply to this post

Jason ByrnesWebAssist

on the cart page, add an if statement around the checkout button to check the c=total cart quantoty and only show the checkout button if the quantity is 40 or less:

php:
<?php if($<your cart name>->TotalColumn("Quantity") <= "40") { ?>

<checkout button>
<?php ?>




you can use a similar if statement to show an error message if the quantity is greater than 40:

php:
<?php if($<your cart name>->TotalColumn("Quantity") > "40") { ?>

error message
<?php ?>



in both of these if statements, replace "<your cart name>" with the name of your eCart object.

Sign in to reply to this post

marovios@yahoo.com

Thanks much for your help Jason. I will give it a try and let you know, seems it's what I have been looking for, a piece of code to handle the max quantity. Thanks!.

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

marovios@yahoo.com

Just wanted to let you know that your code worked perfectly. Thanks much!!!!

Sign in to reply to this post

Jason ByrnesWebAssist

Great, glad to hear it is working.

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