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

moving variable into cart

Thread began 7/21/2010 9:46 am by watercolor346374 | Last modified 9/04/2012 9:21 am by Jason Byrnes | 1973 views | 25 replies |

watercolor346374

moving variable into cart

Hi,
On my site I have price and saleprice, and sizes and backorder message. I have been able to have the item sale price show in the cart if it is on sale and the size show in the cart if it has a size. I have used the same principle for the back order message, if an item is back ordered, the message comes up on the detail page with the size that is backordered. In my columns bindings I have BO for backorder, and it is text that is unique. On the detail page I have the code:
<?php if ($row_rsSize['backordermsg'] != "0") { // Show if recordset not empty
?>
<?php
do {
?>
<p><?php echo $row_rsSize['backordermsg']?>
<?php } while ($row_rsSize = mysql_fetch_assoc($rsSize));
$rows = mysql_num_rows($rsSize);
if($rows > 0) {
mysql_data_seek($rsSize, 0);
$row_rsSize = mysql_fetch_assoc($rsSize);
}
?> <?php } else {?>
<?php }?>
This will show the backorder msg if onbackorder =1, that works. Now I want the message to show in the cart under the size. On the detail page in the ATC section I have
$ATC_itemBO = "".$row_rsInventoryid['backordermsg'] ."";// column binding
I used rsInventoryid, since that is what I used for the size to show in the cart. Even if I change the rs to rsSize it does not show
In the cart I have:
<?php echo $winkee->DisplayInfo("BO"); ?>
It seems no different than the way that I did the size and price vs saleprice and yet it does not show. How am I not passing the info to the cart in this case?
Tables in db used: products- has basic info ie description, category etc. inventory-has detail info ie: size, quantity, backorder, sku, barcode, prodid, catid, and some of the same info as the products table. All products are listed in the inventory table.
Well I did get something to show by changing on detail page the ATC_itemBO to$ATC_itemBO = "".$row_rsInventory['backordermsg'] ."";// column binding
But it does not discriminate by size...if I order a size that is on backorder and it shows the bo message, if I order the same prod in another size that is bo, it shows me the bo message for the size I already ordered. I can see now that the problem is that when items that have different sizes are added to the cart, in the cart they are given the same item number, even though they have different item numbers. Not sure how to handle this, so that as an item with different sizes gets their own item number posted to the cart.

When I change the binding for the item number and backorder message, they only show when I use the record set for the size to post to the cart. The items that have no size do not show the item number or the back order message. It is probably because I have the size recordset which is rsInventoryid set to the form variable. Any suggestions?
Thank you

Sign in to reply to this post

Jason ByrnesWebAssist

can you send a copy of your page sop I can examine how the record sets are created.

Sign in to reply to this post

watercolor346374

passing variables to the cart

Thank you Jason. Here are my files....I need to pass the item number to the cart as well as the bo message. My detail page is based on the prodid. Most of the products have sizes, some do not. So I do have an inventory table for all products regardless of size. Every item has an inventoryid and prodid. The items with size have the same prodid, but different inventoryid's. The products table and inventory table share some of the same info, but not all of it. The item number is in the inventory table as well as the bo message, since each item has its own number. So it is a matter of knowing how to get the item number and bo message into the cart in their respective places, so when the cust checks out to paypal the item number shows and tables are updated. Now I am using for ATC item_num and BO the rs that is being used for sizes, since it works for items with sizes, but does not show info in the cart for items that do not have sizes.

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

watercolor346374

passing variables to the cart

Please need help with this, especially passing the item number to the cart, since this goes to ppal and is used by the merchant for tracking.
Thank you,
k

Sign in to reply to this post

Jason ByrnesWebAssist

I need to know a little more about your table structure.

Can you send a screen shoot showing the structure of the Products and inventory tables.

it would also help to see a Product record and the related inventory record so I can get a better understanding of the relationship between the two.

Sign in to reply to this post

watercolor346374

passing variables to the cart

Thank you,
Here are my images.

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

Jason ByrnesWebAssist

these screen shots are too small to be able to read the column names.

Sign in to reply to this post

watercolor346374

moving variables

Hope this is better.
Thank you,
K

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

Jason ByrnesWebAssist

hmmm, looking at the code, I cannot see why it is not working unless there is no backorder message in the column for the selected inventoryID


to test this, look for the following line of code:

php:
// WA eCart AddToCart

if (isset($_POST["winkee_1_ATC"]) || isset($_POST["winkee_1_ATC_x"]))     {




and change it to:

php:
// WA eCart AddToCart

if (isset($_POST["winkee_1_ATC"]) || isset($_POST["winkee_1_ATC_x"]))     {
die($query_rsInventoryid);




this will write the sql for the rsInventoryid recordset to the screen.

COPY the sql statement and run it directly in PHPMyAdmin post back a screen shot showing the results.

Sign in to reply to this post

watercolor346374

passing variables to the cart

Thank you, Jason.
The file contains 3 images:
sql_tab: this is what I get when I run the message and the product has a tab (size)
sql_notab: this is what I get when I run the message and the product has no tab (size)
rsInventoryid: a picture of the rs that I am using for passing the item number and the bo message. It is based on the the tab.
thank you,
K

Attached Files
sql_rsinventoruid.zip
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...