close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

adding options

Thread begun 7/19/2016 8:55 am by Jamie | Last modified 7/19/2016 2:14 pm by Ray Borduin | 2312 views | 12 replies |

Jamie

adding options

Hi Ray

Am trying to get the options on the attached product detail page to be passed to the cart but not able to. Have updated the ecart object and atc (attached) but not figuring out what I am doing wrong. Have also attached the product detail page as well as the cart page

Cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

I'd have to debug where the issue is. Since you are building the options into a string on the top of the page on lines 93-115 my guess is that the error in the logic would be debugged there. It appears you would be adding the options to the cart with the code you have, so I'd guess that the options aren't being built into the AddOption variable correctly to begin with.

I'd start by adding debug code in the IF and two FOR loops like:

if (isset($_POST['ProdOptions'])) {
echo("in IF ");
for ($x=0; $x<sizeof($_POST['ProdOptions']); $x++) {
echo("first FOR ");
for ($y=0; $y<sizeof($_POST['Option_'. $_POST['ProdOptions'][$x]]); $y++) {
die("second FOR ");

That would hopefully identify if the add option code is even running.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

ok, added the debug code but nothing showing. live page in pm

Sign in to reply to this post

Ray BorduinWebAssist

That tells you it isn't getting into the code at all. Which means that the trigger isn't getting satisfied... Which mean there is no form element named "ProdOptions" being submitted.

I can see that hidden form element exists, but the <form> tag wraps around just the add to cart button and not the <select> and hidden form elements.

I think it may just be a matter of moving the <form> tag so it wraps around all of the form elements.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

OK, thats showing the debug now (in IF first FOR second FOR ) - I have removed it but the option selected isnt being passed to the cart it just shows : (underneath product name).

attached updated file and link to product in PM to add to cart

Sign in to reply to this post

Ray BorduinWebAssist

Now add debug code to the end (lines 112-114)

}
}
die("options: ".$AddOption);
}



See if it has the correct value before the add to cart code.

Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

ok,getting

options: :
Sign in to reply to this post

Ray BorduinWebAssist

OK that means your recordset isn't returning a result. Add more debug information like:

}
}
echo($ProductOptionsSelected);
var_dump($SelValue);
die("options: ".$AddOption);
}
Sign in to reply to this post
Did this help? Tips are appreciated...

Jamie

ok, now its

Resource id #11bool(false) options: :
Sign in to reply to this post

Ray BorduinWebAssist

Looks like you are missing this after line 99:

$selOption = $_POST['Option_'. $_POST['ProdOptions'][$x]][$y];

Sign in to reply to this post
Did this help? Tips are appreciated...
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...