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

Populate Cart Item

Thread began 7/06/2010 1:48 pm by mrobben375515 | Last modified 7/22/2010 10:57 am by Jason Byrnes | 1553 views | 13 replies |

mrobben375515

Populate Cart Item

I'm creating a step by step process for creating a photo book online. On the last step I want them to upload their photos and when they hit submit go to the cart.php page with their photobook already in their cart so they don't have to hit "add to cart" and can go ahead and select the quantity and pay. Is that possible?

Sign in to reply to this post

Eric Mittman

This is no different than adding a regular item to the cart, expect that you will be referencing values that are either static or already entered. You just need to add in an add to cart server behavior to the final page in the process, then set the redirect page to the cart display page. You can then have some text on the page or even rite above the quantity column that lets the user know to adjust the quantity here.

Sign in to reply to this post

mrobben375515

I added the "Add to Cart" behavior but nothing is added to the cart when I click the button. Also, the page doesn't redirect to the cart.php page so I'm obviously doin something wrong. I've attached the page, can you point me in the right direction? thanks

here's the url
quote_thank_you3.php

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

Eric Mittman

The problem is that there is no initial quantity so the add to cart code is not being executed fully. You will need to default the quantity to at least 1 in order for the item to be added to the cart. You can do this with a hidden form element in your form like this:

php:
<input type="hidden" name="WA_Store_Cart_1_Quantity_Add" id="WA_Store_Cart_1_Quantity_Add" value="1" />
Sign in to reply to this post

mrobben375515

When the item is added, it is like a new product is being created instead of pulling the product from the database. I set the ID to the item I want it to add, but it doesn't pull the price, description, name, options, or image for that product. How do I get it to add one of the products I've already created? I've attached the page...thanks

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

Eric Mittman

To get the details of an item to appear on a particular detail page you will need to filter the recordset for that specific product. You would normally do this with a URL parameter like the items id. You would have the recordset crafted and filtered on this value, then wherever you use the bindings for this recordset on the page it will show the details for that specific item.

The add to cart should make use of these recordset values and add them to the cart. Please describe how you have the page setup in this regard and the exact result that you are getting. Also post back with a link where I can see the issue and make sure that I have the current version of that page available. If it is in the current zip archive you have attached then just let me know.

Sign in to reply to this post

mrobben375515

Yes, it's in that zip folder. By url parameter do you mean I need the whole url such as domainname.com/Products_Detail.php?ProductID=7 for the id setting in the add to cart setup? All I have right now is the number "1" for the ID.

Sign in to reply to this post

Eric Mittman

Yes, this is precisely what I mean by URL parameter. The details page should be filtering a recordset based on the id or some other unique value to ensure that you have only a singe record coming back. You can then use the bindings from this recordset wherever you need the details for that item.

I'm not understanding exactly what the problem is that you are currently experiencing. Please post back with a link where I can see this along with the precise steps that I should take to see the behavior. Having a detail page show the details for a particular item is not a very difficult task and it seems there is a fundamental misunderstanding either about the situation or the result that you are getting.

Sign in to reply to this post

mrobben375515

I'm not going to the detail page, I'm trying to go straight to the cart.php page. The add to cart function right now doesn't pull an item from the database, it just creates a new item based on the input you in the bindings tab of the add to cart behavior. I would like it to populate the item from the database along with the product image, price, weight, options..etc. I've attached the page where I added the behavior and a screen shot of the selections. I put Products_Detail.php?ProductID=1 where the ID goes, but it still doesn't work how I would like it to.

The url is quote_thankyou.php if you click the deposit link you should have a product populate in the cart but it doesn't have the settings of the product I'm trying to pull from the database. There's no description, no image, no options, and the price is wrong.

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

Eric Mittman

Ok, thanks for explaining that. You are missing some parts for this. Firstly you will need to add another recordset to this page to pull the details for the item. You should add in a recordset and have it filter by the id for the item. If you have only the one then you can just hard code the filtered value.

Once you have the recordset created you can then go into the add to cart server behavior and bind the cart columns with their corresponding values from the recordset. When you do it like this you will be adding the item to the cart, and the details will be coming from your db based on the id that you filter the recordset on.

Sign in to reply to this post
loading

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