close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart Add to Cart - Error "At line 907...has no properties"

Thread began 11/30/2009 7:43 am by webassistdotcom261883 | Last modified 2/08/2010 2:04 pm by Jimmy Wu | 4556 views | 11 replies |

thetypehouse

eCart Add to Cart - Error "At line 907...has no properties"

Hello

PHP/MySQL server model
eCart 4.5.2 (uninstalled and reinstalled)
DW CS4 (on WinXP SP3)


I can successfully connect to my remote database.
I have added a Cart.
However, when I click the Add to Cart icon, and choose Look up item ID from recordset I get the error

"While executing onClick in WA eCart AddToCart.htm, the following JavaScript error(s) occurred:
At line 907 of file "C:\Program Files\Adobe\Adobe Dreamweaver CS4aConfiguration\Commands\WA eCart AddToCart.js":
document.generalWP.document.column.options[document.generalWP.document.column.selectedIndex] has no properties"


(A previous thread (showthread.php?p=27737&mode=linear&highlight=At+line+907#post27737) also mentioned this, but no solution was given.)

Incidentally, the path shown in the DW error message above is incorrect, as the AddToCart.js file mentioned is actually in
C:\Documents and Settings\user_name\Application Data\Adobe\Dreamweaver CS4\en_US\Configuration\Commands

I don't expect that this path error is helping much...

For info, line 907 in AddToCart.js reads
var ColumnName = document.generalWP.document.column.options[document.generalWP.document.column.selectedIndex].text;


Also, could you clarify for me if it's OK for the WA_eCart directory to be outside the webroot (although it's in the root of the local site, there is a webroot folder that forms the root of the remote site -- you can just see this in the site structure at the right-hand side of the attached file).

I have uninstalled and reinstalled the eCart 4.5.2 extension, and deleted the DW cache file (both of these were done while DW was closed).

I'd be really grateful for help. I've been tearing my hair out for days over this, and the project's running very late.

Many thanks
Alistair

Sign in to reply to this post

thetypehouse

update/clarification

Hi again.

Here's some more info.

Dreamweaver: Version 10.0 Build 4117
URL: index_dynamic.php

I've copied all the Dreamweaver files to another computer, and reset my WA activations so I could test the problem on that laptop, but am still getting the same response (brand new installation of eCart 4.5.2).

I can see that the database connection is working properly as the first table under the heading "Downloads" has two columns, consisting of the two entries in the database (the second table beneath this is static text).

Thanks in advance for any help you can give!

Alistair
PS I have 7 years experience of HTML/CSS, 3 years of PHP and 1 year with MySQL. I thought I knew a reasonable amount, but this has got me stumped...

Sign in to reply to this post

Dani Chankhour

Before Clicking the OK Button, Did you add the appropriate values to the cart column under the Binding Tab?

If yo could give me a screen shot of what you have specified under the Binding Tab.

Sign in to reply to this post

thetypehouse

Hi Dani
Thanks for replying.

1. Following my posting to the forum, I made several more attempts, before realising that I could still proceed to the bindings panel, even though it wasn't being populated by the look-up (the original problem).

2. So I clicked on the lightning bolts to add the bindings from the database (DB).
Clicking OK produced an Add to Cart button for the Resources (henceforth 'catalogue') page.
However, first of all, it was treating all the rows the same (i.e. they all had the same value passed to the shopping cart (shopping-cart.php), then I realised that I must have had the option for "Add static item to cart" (even though I'd added the dynamic bindings).
So I reopened the Server Behaviour and made sure that "Look up item ID from recordset" was selected, and double-checked the bindings.

3. Now the catalogue page passed the correct the values to the shopping cart. However, as the 'catalogue' page wasn't redirecting to the shopping cart page after adding an item to the cart, I manually entered the URL to this row:
$ATC_RedirectAfter = "../shop/shopping-cart.php";

4. Now the catalogue page reloads, but seems to lose the recordset values (i.e. ProductName, ProductShortDesc & ProductPrice). It seems that only by clicking on the Add to Cart button for a second time are values are added to the cart, and then they're only from the second DB row!

There's something wrong somewhere!

I've attached screenshots of the General tab (after the OP error message comes up) and of the Bindings tab.

In the code, the bindings now show (if I've got this right!):

<?php
// WA eCart AddToCart
if (isset($_POST["eCart3_1_ATC"]) || isset($_POST["eCart3_1_ATC_x"])) {
$ATC_itemID = $_POST["eCart3_1_ID_Add"];
$ATC_AddIfIn = 4;
$ATC_RedirectAfter = "../shop/shopping-cart.php";
$ATC_RedirectIfIn = "";
if (isset($totalRows_romeroRecordset1) && $totalRows_romeroRecordset1 > 0) {
$row_romeroRecordset1 = WAEC_findRecordMySQL($romeroRecordset1, "", $ATC_itemID);
if ($row_romeroRecordset1) {
$ATC_itemName = "".$row_romeroRecordset1['ProductName'] ."";// column binding
$ATC_itemDescription = "".$row_romeroRecordset1['ProductShortDesc'] ."";// column binding
$ATC_itemWeight = floatval("0");// column binding
$ATC_itemQuantity = "".$_POST["eCart3_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".$row_romeroRecordset1['ProductPrice'] ."");// column binding
mysql_data_seek($romeroRecordset1, 0);
$row_romeroRecordset1 = mysql_fetch_assoc($romeroRecordset1);
}
}
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$eCart3->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice);
if ($ATC_RedirectAfter != "" && $eCart3->redirStr == "") {
$eCart3->redirStr = $ATC_RedirectAfter;
}
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
}
else {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
}
}
}
?>
<?php
// WA eCart Redirect
if ($eCart3->redirStr != "") {
header("Location: ".$eCart3->redirStr);
}
?>


and the Form part:

<form name="eCart3_1_ATC_<?php echo $row_romeroRecordset1['ProductID']; ?>" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="eCart3_1_ID_Add" value="<?php echo $row_romeroRecordset1['ProductID']; ?>" >
<input type="text" name="eCart3_1_Quantity_Add" value="1" size="4" >
<input type="image" src="../../WA_eCart/Images/Desert Spice/Btn1_EN_addtocart.gif" border="0" value="Add to Cart" name="eCart3_1_ATC" alt="Add to shopping basket">
</form>


Thanks again!
Alistair

Sign in to reply to this post

Dani Chankhour

I have opened a support ticket to further assist you, please reply to your ticket at:

supporthistory.php

Sign in to reply to this post

tom113673

If this is dealt with via support ticket, will the results still be posted here? I think several people have reported this issue. It would be useful if it were fixed.

The problem seems to be that the record id cannot be entered using the interface so of course nothing is sent to the cart page. I expect your problem has been resolved now Alistair but in case it hasn't yet, I think the problem is the missing ID field between the "" below:

$row_romeroRecordset1 = WAEC_findRecordMySQL($romeroRecordset1, "", $ATC_itemID);

eg $romeroRecordset1, "item_id", $ATC_itemID

Tom

Sign in to reply to this post

Jimmy Wu

We have an error logged regarding this error. The Add to cart server behavior throws an error if the recordset being used has sort applied to it. There is a workaround for this however. If you open the recordset and remove the sort, then apply the add to cart server behavior and then go back into the recordset and add the sort back again, you will be able to add the add to cart server behavior successfully. I apologize for the inconvenience.

Sign in to reply to this post

tom113673

Thanks Jimmy - that's very helpful.

Tom

Sign in to reply to this post

thetypehouse

Thanks for looking at this, Tom.

In fact, I had already removed the recordsets and started again with the server behaviours, and this seems to have fixed the problem. :)

All the best
Alistair

Sign in to reply to this post

Jimmy Wu

Glad that worked out for you. If you run into any additional issues, feel free to open a new thread.

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