close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Prepopulate the cart with items

Thread began 10/19/2009 1:12 am by stodan1378060 | Last modified 10/20/2009 4:14 pm by stodan1378060 | 1573 views | 3 replies

Eric Mittman

Sorry for that last part being so short. For the unique id I'm just referring to the item id that you assign in the add to cart server behavior. The item's id will need to be unique to that item only. Each item that you have an add to cart for should have a unique id so this is no different than the other items.

Once you have the add to cart on the page you can update the trigger for the add to cart, it might look like this by default:

php:
// WA eCart AddToCart

if (isset($_POST["WA_Store_Cart_1_ATC"]) || isset($_POST["WA_Store_Cart_1_ATC_x"]))     {



You will need to update it with the eCart code that will check for the specific item in the cart, this check is based on the item id. In this example the item has an id of 5.

php:
// WA eCart AddToCart

if ($WA_Store_Cart->InCart("5") != true)     {



This code is saying 'if item 5 is not in the cart then proceed'. The rest of the code is just the regular add to cart code so it will just add this item to the cart. In this code it works like this:

this part represents the name of your cart

php:
$WA_Store_Cart



This part is checking for the item

php:
->InCart("5")



This final part just says 'if not true' meaning the item is not in the cart

php:
!= true

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