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

Information on recordsets + ATC Function for items with size options that affect pric

Thread began 1/20/2010 4:28 pm by JLK | Last modified 1/28/2010 8:07 pm by Eric Mittman | 2122 views | 12 replies |

JLK

Information on recordsets + ATC Function for items with size options that affect pric

I see from a thread on Dec 4 with Andre363997, a tutorial on adding products with options like size and color is on it's way - can you advise where it is?

My first problem was that the recordset options (in the Add to Cart on product pages) were not displaying in browsers - was advised it was due to my using CF - have switched to PHP and am getting the list dsiplayed.

Now, I need to understand if the data for a SINGLE cart needs to be in the same recordset - in this example a product that has 3 sizes and 2 colors. My database is already built with the needed foreign keys. And I can easily build simple recordsets - one for size, one for color and one for the product. However, since I'm not a PHP programer, I really don't understand the code beyond the recordset names. So I'm relying more on the ecart's wizards to build the php.

This is situation: my DB productID is to a size and color level, with sizeID and colorID as foreign keys to their own tables. Creating the options drop downs (as seen above) has been accomplished, but I don't understand how use the columns of the cart wizard to build it correctly so that the appropriate product is added to the cart.

I can see that I will need to enter dynamic information. I did create a recordset from the product table with productID, name, weight, price, desc. But this rs is not tied to the size so can't be used as is.

IF I have the rsSize include the sizeID (in its recordset for the page) AND the rsproduct include the sizeID (in its recordset page), will this somehow tie together (because it's in the same cart) so that when a customer is on this product page and chooses size L, that will translate to the appropriate price for the product ID that is associated with the productID/sizeID?? From the thread I referenced (up above), it seemed like maybe all info that affects the price would need to be in one recordset. But IF I can figure how to create a more complicated rs that combines all the needed data, I would have 3 records of the same product (same in all respects except size). But the page only needs one actual product. (EDIT - I did create a rs that included all information, but the same color was listed multiple times. And it would seem that I would need a separate recordset for separate data that I wanted sorted differently.)

Issue 2:
I'm assuming that since I've paid all this $ for this product, I will need to perservere until I grasp it and create the Add to Cart buttons. My next "problem" is going to be changing the presentation. Mostly with CSS, which for my first page was quite a bit of work. If I have pages with add to cart areas with similar options. Is there a way that I can copy the add to cart code from one page and paste it to another page, then hand code some changes - like recordset names? I know I will have to add the actual Add to Cart button to each page to ge the functionality, but want to be able to copy and paste as much as possible. Is there information on your site how I could do this?

Hope to hear from someone at WA soon. I've really really tried to figure this out on my own, but so far have not.
thanks

Sign in to reply to this post

Eric Mittman

The guide for the product options is not yet available, it is still in the works. I think that there is a bit going on in this post and it will be difficult to address all of these things in a single response. I think it would be best to concentrate on one part of this, like adding the items with multiple options into the cart first.

Once we get that down we can look into the design or other add to cart scenarios. So rite now you have items that can have two type of options. In your example you mentioned an item that had size and color. So the first thing to do is determine how you would like to make the options available. If all of the items have the same options available this would be easiest. If only certain options go with certain items then you may need an additional table or tables in your db to hold the relationship between the options and products.

Either way you go the key to having the items add to the cart correctly is creating the recordsets for all of the info you would need. For example, if you have a simple scenario where the user can select the size and color of an option you could have recordsets on the page for just the sizes and colors. You could then bind the recordsets to select lists to have the user select the options they would like. Then when you add the item to the cart you would use bindings from these select lists or you would filter recordsets on the selected values to get back more details like the price for the option.

So the next question is how are the prices for the items determined, do the options figure into the price? If so are you storing the price or additional cost of an option currently in your options tables? You will need to make this determination and have this part worked out before you will be able to start crafting your add to cart pages. Please post back with the details for how you would like this to work from the perspective of the user and how the prices are figured. I will use your info to help you come up with a strategy to implement this.

Sign in to reply to this post

JLK

Eric,
The size chosen affects the price. Color doesn't, but color is tied to the productID which is tied to the price. All vpages need different recordsets(options), but I am tackling the rs OK now.

[On other pages I haven't developed yet, there are other product attibutes that the customer needs to select that don't affect the price, but that info will need to be on the checkout page (and input into my database, but I haven't gotten that far yet). For this I anticipate that I will have recordsets for the dynamic data and that can be transferred to the check-out page and my database, but my immediate problem now is for the product that has options that affect the productID/price.]

I understand from your reply that I do need one single recordset to hold all of the data that will affect the productID/price. I did create a rs earlier today to include ALL columns of data that I would need for this web page*
[* excluding quantity which I have as a separate rs with the quantity being a select list i/o of input and that seems to be working fine - multiple quantities is multiplying the price in the checkout page.]

This 1st page is a very simple rs with only 2 sizes and 1 color on this page. The result:

1. At first the dynamic lists didn't display correctly (showing the code as one of the options), but I made the following changes in the dynamic wizard in the properties inspector,
>Added Static Option label (Select),
>Options from Recordset: I choose the appropriate rs (the one with all data)
> And chose the Value and Label from that rs
>Nothing in Select Value Equal To:
This elimated the code as part of the drop down list. I include this info here because what I did may be causing my problems below.

2. In the broswer, the drop down lists include the Static Option label as the top selection in the list along with the other options in the list so it looks like:
Select
Select
Small
Medium
Large
Is there a way to remove the Static option label from the drop down list?

3. For the color, which has one option on this page, the drop down list, lists that color 5 times - the same number of options as in the size list. Naturally, I would like all lists to only list what is the selected column of the rs.

4. When I add various items to my cart, only the first option is actually added (ie when I choose size large - size small goes into check out page. When I add size Medium, it adds the quantity to the small item already in there. If I reorder the list, then it's always the first option in the rs that is added to cart. I tried binding the size value in the dynamic option in property inspector to the productID, but that didn't help. Can't figure this out.

Since I'm not sure what is causing this problem, I'm adding my rs statement, although it test out to be what I expected.
SELECT product.productID, product.desc1, product.name, product.weight, product.price, size.nameAbbrev, fabriccolor.name, size.sizeID
FROM product, size, fabriccolor
WHERE product.sizeID = size.sizeID AND fabriccolor.fabricColorID = 'Blk' AND(productID = '5' OR productID = '6' OR productID = '7')
ORDER BY sizeID

Note: As for cart appearance - think I have tackled that by making a list of things that I need to do to have appearance consistent - for me a non-coder, a better option than copying and pasting and trying to change php code. CSS and html not as difficult for me.

I hope i have explained appropriately. Look forward to hearing from you!

Sign in to reply to this post

Eric Mittman

I will address these in the order you posted them.

Is there a way to remove the Static option label from the drop down list?

Yes, you can select the list in design view and click on the dyanamic button to alter the selections, the static entry will appear at the top of the list of entries that you see. You can add or remove any static options you would like from here. You can also do this in the code by selecting the select list and going into split view, you will see an option that does not have a value but has a label like this:

<option value="">Select</option>


For the color and size options I think it would be best to have individual recordsets to populate these options. You can filter the recordsets on the product id to limit it to only certain options.

In order to get the chosen option to show correctly in the cart you will need to have additional recordsets on the page. These additional recordsets will select from the size and color tables based on the values the user selected.

As I see it now you will have at least 5 recordsets on your product page, they will be:

rs 1
products, this will be to get the info for the product

rs 2
sizes, this will be to populate the size select list

rs 3
color, this will be to populate the color select list

rs 4
sizes2, this will be to select the record for the size based on the user's selection

rs 5
color2, this will be to select the record for the color chosen by the user

Look over the details here to see if you think it will work for you, if you need help with getting the recordsets straight on this page let me know what parts you are having trouble with.

Sign in to reply to this post

JLK

Eric,
Thank you for your reply, and it's very important and urgent, but I haven't been able to implement because I've had sooo much trouble with PHPMyAdmin/MySQL since I sent my last detailed msg.

- I have the WAMP configuration and had just uninstalled and re-installed it (b/c of password and config files that were not clear to me). My site was saved before reinstalling and no work had been done on those pages until today.

- After finally getting phpmyAdmin/mysql working, I went back to implement your instructions. I fixed some recordsets on the first php product page that I'm working on - I tested it and get this error msg in all browsers:

Warning: require_once(../Connections/pinmates_php.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\pinmates\pages\banner_VelJan25.php on line 4

Fatal error: require_once() [function.require]: Failed opening required '../Connections/pinmates_php.php' (include_path='.;C:\php5\pear') in C:\wamp\www\pinmates\pages\banner_VelJan25.php on line 4

This is the code at top of the page (that includes line 4):
<?php
//WA eCart Include
require_once("../WA_eCart/websitename_PHP.php");
?><?php require_once('../Connections/websitename_php.php'); ?>
<?php
$websitename->GetContent();
?>

If I take out this code (just as a test to see what would happe)- I get similar error msgs about other lines.

Both of the above referenced file folders are in my site folder. Below is the content of the ../Connections/websitename_php.php file. And becuase it has a password which I just added over the weekend, it may have something to do with that. When I tested the page in the broswers, I was connected to all the wamp services.

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_websitename = "localhost";
$database_ websitename = " websitename ";
$username_ websitename = "root";
$password_ websitename = "mypassword";
$pinmates = mysql_pconnect($hostname_ websitename, $username_ websitename, $password_ websitename) or trigger_error(mysql_error(),E_USER_ERROR);
?>

I really want to tackle my problem about the options in the cart, but I need to figure this out first - the code listed in the error refers to WA code, so can you help with this?
Need your urgent help - thanks!
Jana

Sign in to reply to this post

Eric Mittman

The errors you are getting are telling you that the included file cannot be found in the location specified. So for the connection it is going to the parent directory of the current page and looking for the Connections folder then the connection file.

Based on the paths you have it seems that the page you are working with is in a sub directory of the site. You will need to ensure that the WA_eCart and Connections folder are in the root of the site if this page is in a sub directory.

When you have the paths to the files matched up correctly you will not get this error.

Sign in to reply to this post

JLK

Eric,

1. Regarding your error msg correction - that worked perfectly - thank you!! And thanks for getting back to me quickly!

2. Regarding my inquiry: Is there a way to remove the Static option label from the drop down list?
- What your instructions stated is what I tried(ie, alter Dynamic dialog box and have 1 static option with no value) with it's own recordset, but I still got the top static option as the top select option. And even with no value, the list is as written in Jan 21 thread. It doesn't make the list unfunctional, it's just kind of silly to offer an invalid option in the drop down list. And even if I keep it blank, so there is no default option showing, the drop down list has the blank option at the top of the list. Is there any way around this? Or is this the way it was set up to be? PS: I think that I'm doing this correctly, because I rec'd a screen shot of the dynamic box on Jan 13 from Jason.

3. Regarding recordsets: I can make as many recordsets as needed, but so far, I can only see that they can be applied at the Add to Cart dialog box or (as above) directly in the DW dynamic box. What would I do with rs: size2 or color2? It seemed like if I had a product rs that included the size ID and the color ID that was tied to the productID, AND - I had the sizeID and the colorID as the values from their own recordsets in their dynamic box, that that would link them up? It appears not to be the case, so how do I apply the 2nd size and color recordsets?
BTW, I've revised my 3 main recordsets to include the it's own ID as well as the productID, to help facilitate the AddtoCart SB link all the appropriate data for the cart, but nothing improves.

Also, The product that is added to the cart is only the top option in the option list no matter what is selected.
Am quite looking forward to seeing how this mystery is solved!

thanks,
Jana

Sign in to reply to this post

Eric Mittman

Please post back with a copy of this page so that I can take a look to see if I can spot any issues. I will examine the select list and try to get it to not have the blank default option for you and check on the recordsets.

Sign in to reply to this post

JLK

ERic,
Do you want the code? For the entire page? Can I send it privately? Wld I copy it and paste onto this site or is there another way?

Jana

Sign in to reply to this post

JLK

2nd Post today with more information

I will be happy to send you any information you require that will help me resolve this quickly. But I need answers to my previous inquiry before I know what to send, as my page is not published - still working in localhost. And I don't want to send all the code in this forum.

My situation - I have the site all developed except for the cart portion.
My products have various options. Some options affect the price and some do not.
-For situation of products that have options that affect price, I'll call Situation A.
-For products with options that do not affect price, I will call Situation B.
For these examples, my products will be tops.

Situation A:
Top 1 comes in 2 colors and 2 sizes. Tops in each color are the same price. Tops is the two sizes are different prices.
Important: Cuurently, the product price is tied to the product at the size, color level.
The ProductID is for a product that has a group(tops), an item(top 1), a color(blue) and a size(S), which then has a product ID, which = price. I need it this way for my inventory.
Q: For the purposes of the cart, must the productID only represent the product with no color or size? (From another thread, this is what seems to have been indicated). I prefer not to have a "base price" for the product, then add on to it if another size is chosen. (I'm not saying I won't, I just prefer not to, due to the inventory situation, if possible)

The cart layout that I want is a typical select layout where the customer chooses from a drop down list of colors, then from a drop down list of sizes, then chooses from a drop down list of quantities, then clicks on the cart button, which enters the appropriate info in the cart page.

I have tried very simple recordsets for quantity, size, color and product that include only the applicable columns from their own tables ie: sizeID, sizeName, sizeAbbrev and so on for the other tables.

I have also tried combining all the required data into one recordset.

And have tried individual recordsets that include data from other tables, ie, products table includes productID, productName, price, weight, productDesc, colorID, colorName, sizeID, sizeName.

None have worked for me - the result is NOT getting the chosen item in the cart. No matter what I do, it's always the first item in the product recordset.

Situation B:
This should be easier. There are attirbutes that the customer must choose from that are informational only. In this situation, the customer must choose measurements. Inches and frations for four separate dimensions. For each of the 4 dimensions, the customer must choose from a drop down list of inches, first of whole numbers and another list of fractions. But they do not affect the productID or price. I just want the selections from the drop down lists to appear in the cart (and ultimately in my MySQL database)

Lastly, if I can't find a quick workable solution to Situation A, what other options of cart display do I have?
For instance I could list the products with a quantity text box beside it so the customer can enter a quantity and add that to the cart. But I don't see how this will work either. But here is another product cart layout, if this may be more workable:
Order Form:
New York Tee, in Black, size Small ____
New York Tee, in Black, size Medium ____
New York Tee, in Red, size Small ____

I don't prefer this method, but I am looking for a workable, relatively quick solution.
If you need more information, please be detailed, so I can respond with the appropriate info.

thank you
JLK

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