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 5 - success page authorization

Thread began 9/23/2010 1:13 pm by rob75685 | Last modified 10/13/2010 6:31 am by rob75685 | 1391 views | 10 replies |

rob75685

eCart 5 - success page authorization

hi there

In eCart 4 the checkout success page used to automatically update the database with an order status : StatusDetail.. and a Vendor TX Code

... however in eCart 5 this doesn't seem to be the case.

I've set up an Update Record behaviour to try and do this, and added a status field to my orders table, but in the behaviour I just need to know what ID I should set... eCart gives me a session ID and an ID but these don't relate to the order ID stored on the database...

thanks

Sign in to reply to this post

Dani Chankhour

The order ID should be stored in a session after you make the first insert to the the database in the confirm page and usually that session is named 'OrderID'.

In regard to eCart v4, i don't believe eCart v4 updated the order status on the success page, but i will do a quick test to confirm.

Sign in to reply to this post

rob75685

hi Dani

Thanks for your help. I'm just tying to update the order with a status once checkout_success has been reached.

In my update record behaviour I have set the Key Column 'OrderID' to equal <?php echo $_SESSION['OrderID']; ?>

... but this doesn't update the record...

here's my full update code:

<?php
// WA Application Builder Update
if ("" == "") // Trigger
{
$WA_connection = $hellolittleone;
$WA_table = "orders";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "OrderID";
$WA_fieldNamesStr = "StatusDetail";
$WA_fieldValuesStr = "Authorised";
$WA_columnTypesStr = "',none,''";
$WA_comparisonStr = "=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);

$WA_where_fieldValuesStr = "".$_SESSION['OrderID'] ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);

$WA_connectionDB = $database_hellolittleone;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>

Sign in to reply to this post

Dani Chankhour

We need to confirm that the order is session is named OrderID. On the top of success page, please includes these lines of code:

<?php
session_start();
echo $_SESSION['OrderID'];
var_dump($_SESSION);
?>

Please post back with the output you get on the success page with those lines included.

if you can just copy the output to a text file and attache it to your reply.

Sign in to reply to this post

rob75685

hi Dani

Here you go:

array(34) { ["price"]=> string(6) "105.00" ["desc"]=> string(9) "68 cards " ["special"]=> string(0) "" ["productpic"]=> string(19) "Ark_blue_BTY_NP.jpg" ["priceqty"]=> string(16) "105.00:68 cards " ["newimage"]=> string(0) "" ["newimage2"]=> string(0) "" ["introduction"]=> string(6) "asdasd" ["eCart1_Items"]=> string(257) "0|WAECART|Baby Thank You Cards - Ark Blue|WAECART|Description: 68 cards

Text: asdasd
|WAECART||WAECART|0|WAECART|1|WAECART|105|WAECART||WAECART|Ark_blue_BTY_NP.jpg|WAECART||WAECART|0|WAECART|105|WAECART|1 Baby Thank You Cards - Ark Blue (0)" ["WAEC_ContinueRedirect"]=> string(44) "/preview/prodstep3_btycards2.php?PROD_ID=248" ["eCartCheckoutForm_firstname"]=> string(6) "Robert" ["eCartCheckoutForm_lastname"]=> string(5) "Smith" ["eCartCheckoutForm_email"]=> string(17) "rob@rtmedia.co.uk" ["eCartCheckoutForm_phone"]=> string(12) "01242 577339" ["eCartCheckoutForm_fax"]=> string(12) "01242 577339" ["eCartCheckoutForm_street1"]=> string(18) "6 Fairfield Avenue" ["eCartCheckoutForm_street2"]=> string(11) "Leckhampton" ["eCartCheckoutForm_city"]=> string(10) "Cheltenham" ["eCartCheckoutForm_state_province"]=> string(7) "Gloster" ["eCartCheckoutForm_postcode"]=> string(8) "GL53 7PN" ["eCartCheckoutForm_country"]=> string(2) "GB" ["eCartCheckoutForm_optin"]=> string(0) "" ["eCartCheckoutForm_shipping_firstname"]=> string(6) "Robert" ["eCartCheckoutForm_shipping_lastname"]=> string(5) "Smith" ["eCartCheckoutForm_shipping_email"]=> string(17) "rob@rtmedia.co.uk" ["eCartCheckoutForm_shipping_phone"]=> string(12) "01242 577339" ["eCartCheckoutForm_shipping_fax"]=> string(12) "01242 577339" ["eCartCheckoutForm_shipping_street1"]=> string(18) "6 Fairfield Avenue" ["eCartCheckoutForm_shipping_street2"]=> string(11) "Leckhampton" ["eCartCheckoutForm_shipping_city"]=> string(10) "Cheltenham" ["eCartCheckoutForm_shipping_state_province"]=> string(7) "Gloster" ["eCartCheckoutForm_shipping_postcode"]=> string(8) "GL53 7PN" ["eCartCheckoutForm_shipping_country"]=> string(2) "GB" ["eCart1_OrderID"]=> int(536) }

Sign in to reply to this post

rob75685

eCart1_OrderID works !

Sign in to reply to this post

rob75685

hi Dani

Thanks for your help so far. This works great

Could also give advice on how to include the SagePay order reference number on the confirmation email and also save to the database ?

thanks

Sign in to reply to this post

Dani Chankhour

Are you using VSP Server or VSP Form. Most likely the transaction ID is returned and stored in a session. You can try outputting the session on your success page to see if the transaction key is listed.

Sign in to reply to this post

rob75685

hi Dani

I'm using VSP Form - yes I did a session output before - see a couple of posts back...

Sign in to reply to this post

Dani Chankhour

Sorry it looks like the values are stored in a query string. To get the value, open the success page and open the bindings panel, and click the + button. choose eCart -> Checkout -> Check out from response and choose and select sage pay vsp form. if you expand the check out from response in the binding panels, you can then see all the values that are returned. You can then update your update server behavior to store the values you want to store from the response.

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