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

How can I create a "bundled" group of products with options that are added to the cart as a single object?

Thread began 8/28/2013 8:07 pm by troyd | Last modified 9/11/2013 11:09 am by Jason Byrnes | 774 views | 7 replies |

troyd

How can I create a "bundled" group of products with options that are added to the cart as a single object?

The short version of what I am trying to do: (please also see diagram)
- Bundle, or "kit" of products that are selected in steps. A main item, associated items and their options.
- Some items are a choice in a category. A minimum of one must be selected.
- Some items will have options. Some options will affect price.
- Lastly, combine the items as a group (single object), when added to cart.


Larger Version

I realize this isn't a supported eCart feature. And I don't expect a full step by step tutorial, but if you can point me in the right direction, that would really help.

What I have tried so far:
Adding multiple items with checkboxes using eCart & DA Search. This works fine but adds individual items which are independent of each other.

I also tried posting the selected items to a second page and stringing the details together into a hidden field which then would be used to bind to the "Add To Cart" behavior. My thought here was that I could create a single object from the previous page and then create an "Add To Cart" behavior from there.
This isn't completely working for me because the options and option prices are not getting posted to the page.

I have several tables setup as relationships between the Products table and the Options tables. And my JOINS contain all of the data for the products including prices, options, etc.
All the tables and joins work fine on individual products and the items that have "price affecting options" work by passing the id from the select. Here, I created a recordset just for Prices. It's filtered by both the ProductID and the $_POST['os1'] and bound to price in the "Add To Cart".
I created 2 versions of the "os1" form fields. They are Shown or not, based on if their "OptionTitle" is NULL. So if an item has an option, the "OptionTitle" won't be NULL and the "os1" Select drop down is presented and used to pass the ID for that option. If an item has no option, then a hidden field for "os1" is used and it has the ID for that price.

For some reason, this doesn't work for me in a repeat region, to pass all of the prices to the second page and total them as one amount. Am I going about this wrong? Should I use javascript instead, to update prices as they are selected?

Thanks,
TroyD

Sign in to reply to this post

Jason ByrnesWebAssist

I would set the cart up to treat all of the individual "products" as options:

so add columns for:
lighting
lightingPriceIncrement
solidShelfQTY
solidShelfPriceIncrement
glassShelfQTY
glassShelfPriceIncrement
lining
liningPriceIncrement

Instead of using the checkboxes, just set the initial quantity value for the solid and glass shelf, and let the users increase the quantity if they like, a positive quantity would be the same as checking the box, the checkbox just adds an un needed layer of complexity.

you could then create calculations to set the product price based on the selections that where made.

If you need help setting this up, we could do this in a premiere support appointment.

Sign in to reply to this post

troyd

Thank you Jason,

A couple of followup questions as I explore this idea.
Would you create a new eCart object or alter the currently functioning cart? I need to allow the user to "Continue Shopping" as usual even with the bundle in the cart.
Can two carts be merged at some point during the checkout process, or am I over thinking this again?

I see where you are going with this. The main item would be setup as if it where the product and everything else would be like an option that affects the price incrementally. Right? If so, what would I do with the items that have options themselves? It's like an option within an option. Would you break those options out as individual items rather than using the select lists?

Bravo on pointing out that there is no need for the check boxes here. They where carried over from when I tried the multiple insert method and I just didn't realize I didn't need them anymore. Funny how that happens. It's always good to have someone look at what you are doing.

This helped me a lot and I appreciate it. If you don't mind the additional questions, I will give this a try.

Thanks,
TroyD

Sign in to reply to this post

Jason ByrnesWebAssist

no need to have multiple carts, just add the needed columns to the already functioning cart.

keep in mind that when you add cart columns, you will also need to edit any add to cart button behaviors to have the code regenerated.

as for other options with other products, you would create a column for those options like size or color.

Sign in to reply to this post

troyd

As always, thanks for the help. I will see if I can work this out.

TroyD

Sign in to reply to this post

Jason ByrnesWebAssist

Originally Said By: troyd
  As always, thanks for the help. I will see if I can work this out.

TroyD  
Sign in to reply to this post

troyd

Originally Said By: Jason Byrnes
  ...
Instead of using the checkboxes, just set the initial quantity value for the solid and glass shelf, and let the users increase the quantity if they like, a positive quantity would be the same as checking the box, the checkbox just adds an un needed layer of complexity.
...  



I changed the checkbox to a hidden field, and this, along with the Qty field, works fine if I am sending it straight to the eCart object like I was originally.

But I need to add a step in-between. So rather than "Add To Cart", I am posting the form to the search and recordset and printing it out as a string that will then be added to the cart as single item later.
But I can't figure out how to filter or trigger the results based on if the Qty boxes have a value or not.

The current Search comparison is:

//comparison list additions
$WADbSearch1->addComparisonFromList("ProductID","hiddenfield","AND","=",1);


Which returns all of the products since they are always true. So I need to add the Qty text field in here some how.

Would I add a comparison to the Search behavior that requires a value of > 0 before it grabs the product ID? If so, how would I do that? Or should I add some kind of WHERE clause to my recordset that is filtered by the Search.

Thanks
Troy

Sign in to reply to this post

Jason ByrnesWebAssist

You cant do this with data assist search.


you would need to create code to create a comma separated list of Product ID's where the matching qty field has a positive value and use that in the recordset.

This is hand coding we could help implement in a premiere support appointment.

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