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

Order History/ No UserID in Store Summary Database

Thread began 4/12/2010 4:34 am by Nature Photographer | Last modified 8/25/2010 1:20 pm by Jason Byrnes | 1361 views | 10 replies |

Nature Photographer

Order History/ No UserID in Store Summary Database

Hi,

I'm using eCart5 with PayPal Standard, I set up the store with all files etc and it works great and have now moved on to setting up the order history BUT when I go into the eCart Store Summary in Database server behavior there is no listing to bind OrderUserID. There is two entries relating to payPal which wasn't there in ecart 4.

The mySQL does have a column for orderUserID and everything else is there which is mentioned in the guide except this one binding entry of OrderUserID

I've attached a screenshot of my bindings available.

Thanks for your assistance.

Sign in to reply to this post

Jason ByrnesWebAssist

to create an order history, you must be requiring the users to login before the can checkout.


see the "Applying Register/Login to your checkout" tutorial on the eCart support page:
ecart/

Sign in to reply to this post

Nature Photographer

Hi, yes I have done all that, as in login required, if you had checked the attached screen shot you would have seen the various bindings.

As I said originally. everything works fine up to the history pages I was trying to save you guys some time by keeping my question simple.

So Ok!

1. I have read the "Getting started with eCart guide"

a. I have checked the php mySQL Database that all required table columns are available
b. I have completed eCart Object
c. I have added eCart buttons to pages as required
d. I have applied the Display Manager wizard
e. I have applied Checkout wizard

Everything works, I can add to cart, I can Check out, details are added to database


2. I read and applied "applying Registrer/Login to your checkout"

Everything works fine, people are redirected to login page when not already login etc etc

3. Have read and applied "Automatically populate form fields on your checkout page"

Everything works fine, details from data base are filling form during checkout

4. Have read and applied "How to create an order history" but when I go into the eCart Store Summary in Database server behavior there is no listing to bind OrderUserID in the session list

Sign in to reply to this post

Jason ByrnesWebAssist

the session variable name to use may be different. to determine what the correct session variable name is, open the security assist login page and double click the security assist authenticate user server behavior, on the third page the session variables will be listed, make note of the session variable name for the ID column.

If this session variable is not listed on the bindings panel, you can add it manually. on the bindings panel, click the plus button and select Session Variable, then type the name for the user ID session variable.
NOTE: PHP is case sensitive, when adding the binding, make sure to use the correct case.

Sign in to reply to this post

Nature Photographer

Thanks Jason,

Sign in to reply to this post

jbarron397794Beta Tester

Cannot store in UserID column!

Great instruction in this thread, however I set my store up before we purchased Security Assist so all of my pages are using the standard Dreamweaver authentication sign in with the exception of my log in page which is using WebAssist cookie toolkit. (...I recently changed my login page so that I could have the remember me feature, in which it does.) So now every time I put in what I believe the session name to be that was set by the Dreamweaver extension I get an error that says "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@myemail.com)' at line 1"

I have a column in my orders database called "OrderUserID" but I just can't get it to store. Please advise so I can finally get beyond the 2nd paragraph of your "Build History Page" PDF.

Thanks~

Sign in to reply to this post

Jason ByrnesWebAssist

this error suggests that the session parameter is being treated as a number.


in the recordset where you are using the email address session variable in the parameter, set the type to text instead of number.

Sign in to reply to this post

jbarron397794Beta Tester

Thanks Jason. That worked because my userID session is actually set as the user's email address. (Again, I purchased the DataAssist and SecurityAssist AFTER I had already purchased ecart.) It is now storing the username (email) of the person who logged in into the UserID column. HOWEVER, after following the step by step directions and completing all pages correctly, it is now displaying ALL orders for everyone, not just for that specific user. Any suggestions on what might be happening? I have a attached a screenshot of my recordset and I have pasted the code for the session here. Please advise why when I am following the tutorial, it still will not work? Thanks for your help!

<?php
// WA eCart Store Cart Summary in Db
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) // Trigger
{
$WA_connection = $rsmyconnect;
$WA_table = "orders";
$WA_redirectURL = "";
$WA_indexField = "OrderId";
$WA_fieldNamesStr = "OrderReferenceId|OrderVisitorID|OrderDeptCode|OrderShipping|OrderTax|OrderTotal|OrderCompany|OrderShipAddress1|OrderShipAddress2|OrderShipCity|OrderShipStateId|OrderShipZip|OrderShipCountryId|OrderUserID";
$WA_fieldValuesStr = "".session_id() ."" . "|" . "".$_SESSION['eCartCheckoutForm_email'] ."" . "|" . "".$ecart1->GetTax() ."" . "|" . "".$ecart1->GetShipping() ."" . "|" . "".$ecart1->GrandTotal() ."" . "|" . "".((isset($_POST["deptcode"]))?$_POST["deptcode"]:"") ."" . "|" . "".((isset($_POST["shipping_company"]))?$_POST["shipping_company"]:"") ."" . "|" . "".((isset($_POST["shipping_street1"]))?$_POST["shipping_street1"]:"") ."" . "|" . "".((isset($_POST["shipping_street2"]))?$_POST["shipping_street2"]:"") ."" . "|" . "".((isset($_POST["shipping_city"]))?$_POST["shipping_city"]:"") ."" . "|" . "".((isset($_POST["shipping_state_province"]))?$_POST["shipping_state_province"]:"") ."" . "|" . "".((isset($_POST["shipping_postcode"]))?$_POST["shipping_postcode"]:"") ."" . "|" . "".((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"") ."" . "|" . "".$_SESSION['MM_Username'] ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_sessionName = "ecart1_OrderID";
$WA_Sql = "";
$NeedInsert = false;
$indexFieldIndex = -1;
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_rsmyconnect;
$updateFieldValue = "";
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
if ($WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos('?', $WA_redirectURL) === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
for ($i = 0; $i < sizeof($WA_fieldNames); $i++)
{
if ($WA_indexField == $WA_fieldNames[$i])
{
$indexFieldIndex = $i;
break;
}
}
$deleteFieldValue = "";
$updateColType = "none,none,NULL";
if ($indexFieldIndex >= 0) $updateFieldValue = $WA_fieldValues[$indexFieldIndex];
if ($updateFieldValue == "" && isset($_SESSION[$WA_sessionName])) $updateFieldValue = $_SESSION[$WA_sessionName];
if ($indexFieldIndex >= 0) $updateColType = $WA_columns[$indexFieldIndex];
if ($updateFieldValue != "") {
$updateParamsObj = WA_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, $indexFieldIndex);
$valueForWhere = WA_generateInsertParams(array($WA_indexField), array($updateColType), array($updateFieldValue), -1);
$WA_Sql = "update " . $WA_table . " SET " . $updateParamsObj->WA_setValues . " where " . $WA_indexField . " = " . $valueForWhere->WA_dbValues;
$WA_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = $updateFieldValue;
$result = mysql_query("SELECT * FROM " . $WA_table . " where " . $WA_indexField . " = " . $valueForWhere->WA_dbValues, $WA_connection);
$num_rows = mysql_num_rows($result);
$NeedInsert = (mysql_num_rows($result) === 0);
}
if ($updateFieldValue === "" || $NeedInsert) {
$updateFieldValue = "";
$insertParamsObj = WA_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "insert into " . $WA_table . " (" . $insertParamsObj->WA_tableValues . ") values (" . $insertParamsObj->WA_dbValues . ")";
$WA_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
}
if ($WA_redirectURL != "") {
header("Location: ".$WA_redirectURL); exit;
}
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

judging by the screen shots of your recordsets, it is not possible for it to display all records unless the code on the server does not include the update recordsets. make sure that the pages are being uploaded properly.

Sign in to reply to this post

jbarron397794Beta Tester

Hi Jason, thanks... The pages have definitely been uploaded to the server! I even ftp'd them again just to be on the safe side before I retested. It is still displaying all records no matter whom I sign in as. Please help!

Also, when I click on the Order ID from the customer_history page it comes up as 'No results for your search'! As if it is not linked properly. Again, please help!

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