close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Not allowing a certain number of items in cart

Thread began 1/17/2011 9:48 pm by brianw101189 | Last modified 1/20/2011 3:46 pm by CraigR | 1122 views | 4 replies |

brianw101189

Not allowing a certain number of items in cart

I'm needing to modify the cart to NOT allow 13 items. Any other number of items can be sold, just not 13.

Does anyone have any ideas where to start on this? Could it be a validation rule using the Validation Tool kit?

Any ideas would be great.

Sign in to reply to this post

Jason ByrnesWebAssist

13 items of the cart total quantity, or 13 of just one item in the cart?

what should happen if the quantity is at 13? Adjust the quantity up? or down? show a message?

Sign in to reply to this post

brianw101189

Both, it shouldn't allow 13 items in the cart, or 13 of one item.

Ideally a message would come up saying quantities of 13 are not allowed, or something like that.

Sign in to reply to this post

Jason ByrnesWebAssist

you would need to use a javascript function on the onClick event of the add to cart button.

this example assumes that:
1: the cart object is named "eCart1"
2: the add to cart button form is named "eCart1_1_ATC_1"
3: the quantity element is named "eCart1_1_Quantity_Add"

you will need to make modifications to the javascript if your code uses different names

the on click event for the button would be:


onClick="return if13(<?php echo $eCart1->TotalColumn("Quantity"); ?>,document.eCart1_1_ATC_1.eCart1_1_Quantity_Add.value);"

the javascript function would look like:
<script type="text/javascript">
function if13(alreadyIn, qtyAdded) {
//alert(parseInt(alreadyIn)+parseInt(qtyAdded));
if(parseInt(alreadyIn)+parseInt(qtyAdded) == 13) {
alert('no');
return false;
}
}
</script>


keep in mind that this is really not something that is supported in eCart and we will not be able to offer extensive support for it

Sign in to reply to this post

CraigRBeta Tester

If a customer edits the quantities whilst on the cart page, then the number of items in the cart could be also be changed to 13.

in this instance, you could count the number of items in the cart, and if it is equal to 13, disable the checkout button and show a suitable message

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