close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Simple eCart Setup w/Color Option

Thread began 5/19/2010 3:02 pm by bledford407228 | Last modified 5/25/2010 1:04 pm by Eric Mittman | 2370 views | 5 replies |

bledford407228

Simple eCart Setup w/Color Option

Ok... I've spent the past three days reading forums and trying every different thing I can to figure out something that should be simple, out of the box.

My Setup:
Super Suite / Dreamweaver CS5 / PHP / MAMP / On A Mac / Using the provided WA database.

Background:
I have a site that was previously built to sell 2 items that each come in your choice of color. The shopping cart was part of the paypal system. Due to lack of features, I wanted to implement my own shopping cart for more control.

The database is setup as follows:
Products: 2 items. 1. is the large handbag, and 2.) is the small handbag.
OptionGroups: 1 entry Color
Options: I've listed all the colors options
ProductOptions: Filled in accordingly based info from this post: showthread.php?t=12841

Question:
With-in this prebuilt website I have two product pages. One for large handbag, and the other for a smaller redesigned version.

Large Handbag has 3 color choices.
Small Handbag has 8 color choices.

Up to this point I have created the eCart object with a extra column for color, set to text, and unique.

Working with only the Small Handbag page I created and add to cart button. I'm pulling form the rs_WADAproducts with the id set to product id. On the bindings, Id is set to a default of 2 (productID is 2 for the small handbag in products table) all the rest are set to there corresponding column within the products table. Color is not binding to anything with in this setting, but it is set to up-dateable and with list.

Once the button is created i selected the dropdown menu and changed the dynamic setting to include a label of "Select A Color" pulling options from rsColor (created following the "Product Options with eCart" tutorial - left out anything related to size or price increases b/c I didn't need it). The values are set to ProductOptionID and labels set OptionName.

Problem 1 - This products should show all 8 color choices, but instead it only shows 3 of them. At first I thought it was giving me the choices for the large handbag, but noticed only 2 of the colors matched the large and the other color is only for the smaller handbag.

Problem 2 - When testing this page with only three colors, I'm taken to the shopping cart with all the information from the large handbag (name, price, sku, etc) but where it should display the color it just says 1... and when adding another bag to the cart with a different color it just increases the quantity of the first bag.

I'm completely lost and tired of spending hours (past 3 days, all day) trying find to information on what I'm doing wrong. Any help would be greatly appreciated.

Now for My Rant: (WA don't skip) -

WA Staff please take the advice from other forum members and provide more in depth documentation for your products. For example there is no information at all on how the WA database should be filled out if you want to include options. If it weren't for the post I mentioned above and finding a program called navicat to edit said database, I would have no idea whats going on. (not that I really do now). Mainly for a product that is pitched to be easy to use out of the box, with a high price tag (w/Super Suite), it shouldn't take days of searching your forums to find basic answers. I can understand it might seem easier to answer questions as they arise, but it creates nothing but frustration when trying to figure out how another user might have asked the questions you are researching. Save the forum questions for the more advanced things. The provided documentation doesn't provide near the amount of answers it should for the basic setup of a simple shopping cart. Don't get me wrong, based on past experience, I do realize how helpful your tools are with the automatic coding they provide... but when you offer a trial period for a product, you don't want your users spending that time constantly searching for answers in a forum... wouldn't you rather they spend it enjoying your products b/c they found all the information then needed it one simple place. Not worrying if they've made the wrong decision and consider returning them. (I'm still in my trial period and this thought has crossed my mind... as much effort as I've put into hunting down answers and trying this and that, I might have been better off to spend my money taking a php class)

Simply put... out of all they years I've been on the internet, I've never had to post in a forum to find the answers to something that seems so simple. So as my very first post ever, I hope you've enjoyed reading my book. ;-)

Thanks for reading!

Sign in to reply to this post

Eric Mittman

Thanks for taking the time to post in the forum. I think that based on what you have described you are probably most of the way there. I would like to look into these issues one at a time though to make sure that we get through one completely before we look into another.

The first issue is:
Problem 1 - This products should show all 8 color choices, but instead it only shows 3 of them. At first I thought it was giving me the choices for the large handbag, but noticed only 2 of the colors matched the large and the other color is only for the smaller handbag.

You mention that the select list for the colors is coming from your db. How do you relate the colors to the different sized handbags? The recordset that populates the colors select list will need to be crafted in a way that it only pulls the colors for that particular size. This means that you will need some way to identify what colors are for what size in your db, then in the recordset that is pulling in the colors you will need to filter it on this criteria so that you are only getting the colors for that particular size item.

Also, this might help with part of the second issue. In the select list whatever you have specified as the value is what you will see when you add it to the cart. So if you would like to see the color when adding it to the cart you need to make sure that the value is set to the name of the color.

Sign in to reply to this post

bledford407228

the whatever

Ok... I see where you are going. But it has created another issue.

Based on what you said, heres what I did. I went in and added 3 columns to the options table. The first one is called categoryID (b/c on the products table the large bag is productID #1 and #2 is the small one. So for all the colors that would correspond with that handbag, I just entered that products number. Then when in the recordset I can filter by that productsID with the value contains setting.

I also added a column for each bags sort order. B/c I need them to appear in an order that matches a color swatch that customers can rollover to change the color of said bag. I figured I could use the sort option within the recordset to accomplish this.

Ok... so heres where the other problem comes in. So I built my recordset based on the "Product Options for eCart" tutorial. Remember I skipped over anything size related. But still entered all the coding for the rsColor along with the variable. (I'm guessing this code somehow bridges the ProductOptions table and the Options table... but i'm still unsure what this code actually means) So with that being said, within the advanced tab of the rsColor recordset I have no options for selecting the filter option or sort option as you would within the simple view.

Is this code necessary or do I just need to add something to it?

Thanks so much for your help!

Sign in to reply to this post

Eric Mittman

If you are limited to the advanced recordset view you can manually add in the sorting by adding an order by clause to the end of your query, it might look like this:

SELECT * FROM table
........
........
ORDER BY 'column to sort by' ASC

This would sort by the column specific in ascending order.

Sign in to reply to this post

bledford407228

Ok... I don't know Php outside what Dreamweaver will automatically generate for me.
Sooo... I"m going to need a little more hand holding.

Below is the code I already have within the recordset (based on the "Product Options w/eCart" tutorial)

Here are the names of the 3 columns I crated within the options table.
CategoryID (this the column I'm using to filter which colors should be displayed for that product. The column should contain the number 1 for large handbag, or 2 for small handbag.)

LargeBagList: (This is the order for how to the corresponding colors should be listed) I need this column to be sorted in an ascending order.

SmallBagList: (This column is the same as the LargeBagList. But contains the list order for the Colors available the small handbag.) I also need this sorted in an ascending order.

So what I'm guess you are telling me to do is to add the filter and sort options by hand coding it. This is where I'm going to need the help. What do I need to add to the code below to in order to filter by the CategoryID column with a value that contains the product number (1 or 2 based on the product page)

Then I will need the LargeBagList column sorted in an ascending order.



(Again this is the code I already have... what do I need to add to it?)

SELECT productoptions.OptionPriceincrement, productoptions.ProductOptionID, options.OptionName, options.OptionGroupID, optiongroups.OptionGroupName
FROM options INNER JOIN productoptions ON options.OptionID = productoptions.ProductOptionID INNER JOIN optiongroups ON options.OptionGroupID = optiongroups.OptionGroupID
WHERE optiongroups.OptionGroupName = 'color' AND productoptions.ProductID = paramItem


Thanks!

Sign in to reply to this post

Eric Mittman

In the query to filter on the category you can just add to the where clause like this:

WHERE optiongroups.OptionGroupName = 'color' AND productoptions.ProductID = paramItem AND options.CategoryID = <the category id to compare to>



If you are working in the advanced view then you will need to add a query parameter and set it to the variable that this value comes from. If the pages are setup for the large and small bags then you can just enter the category id number for the size of bag you are working with.

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