close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Access eCart Variable for Universal E-Mail

Thread began 9/23/2011 11:40 am by Mike Perry | Last modified 9/26/2011 1:13 pm by Mike Perry | 2603 views | 9 replies |

Mike Perry

Access eCart Variable for Universal E-Mail

I want to insert the Total Price from an e-Cart into the template for a Universal E-Mail response. I'm using success.php to trigger the e-mail -- I don't want the e-mail to go unless the transaction is approved. The Blank.php template file does not have access to the eCart object, and the Session variables from the eCartCheckoutForm do not include the $TotalPrice from the eCart object.

How can I access the $TotalPrice from Blank.php??

Mike

Sign in to reply to this post

Jason ByrnesWebAssist

you would need to add code to attach the eCart object, to the email template page and show the total, for example:

php:
<?php

//WA eCart Include
require_once("../../../WA_eCart/yourCartName_PHP.php");
?>
<?php
$yourCartName
->GetContent();
?>
<?php 
echo WA_eCart_DisplayMoney($yourCartName$total); ?>




where "yourCartName" is the name of your eCart object.

Sign in to reply to this post

Mike Perry

Originally Said By: Jason Byrnes
  you would need to add code to attach the eCart object, to the email template page and show the total, for example:

php:
<?php

//WA eCart Include
require_once("../../../WA_eCart/yourCartName_PHP.php");
?>
<?php
$yourCartName
->GetContent();
?>
<?php 
echo WA_eCart_DisplayMoney($yourCartName$total); ?>



where "yourCartName" is the name of your eCart object.  


Got it -- thanks!!

Sign in to reply to this post

Mike Perry

Jason -- when I try to use this the bookfair server behavior for Blank.php has a red exclamation mark next to it; all other instances of the bookfair cart object show up as okay. When I try to use the file accessing success.php which calls Blank.php in the UE script I get the following server error:

  Notice: Undefined variable: bookfair in /data/20/1/110/39/1925365/user/2098047/htdocs/ccdsnet/webassist/email/templates/Blank.php on line 6

Fatal error: Call to a member function GetContent() on a non-object in /data/20/1/110/39/1925365/user/2098047/htdocs/ccdsnet/webassist/email/templates/Blank.php on line 6  



bookfair is the name of the eCart object.

success.php/Blank.php attached. . .

Thanks,

Mike

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

Jason ByrnesWebAssist

perhaps the require once line needs to go down one more directory:

change
require_once("../../../WA_eCart/bookfair_PHP.php");


to:
require_once("../../../../WA_eCart/bookfair_PHP.php");

Sign in to reply to this post

Mike Perry

Originally Said By: Jason Byrnes
  perhaps the require once line needs to go down one more directory:

change
require_once("../../../WA_eCart/bookfair_PHP.php");


to:
require_once("../../../../WA_eCart/bookfair_PHP.php");  


That triggers the Dynamically-related files DW error, and does not clear the red exclamation point. . .

Sign in to reply to this post

Jason ByrnesWebAssist

what about running it in the browser?

the red excamation point only means that Dreamweaver does not recognize something. It may be a problem, it may not. If it runs OK in the browser, then you can ignore it.

it all boils down to the require once line. I dont know the exact structure of the files in your site, so cannot give the exact code that will be needed.

the require once line is a relative link to the ecart file in the WA_eCart directory, you may need to play with it to get the relative path ot go down the required number of directories to get to the root of the site.

Sign in to reply to this post

Mike Perry

Originally Said By: Jason Byrnes
  what about running it in the browser?

the red excamation point only means that Dreamweaver does not recognize something. It may be a problem, it may not. If it runs OK in the browser, then you can ignore it.  


If I ignore the exclamation point and try to run from the server I get the two errors first noted. It seems (according to the errors) that the eCart object isn't being found (per your reference to the include statement).

  it all boils down to the require once line. I don't know the exact structure of the files in your site, so cannot give the exact code that will be needed.

the require once line is a relative link to the ecart file in the WA_eCart directory, you may need to play with it to get the relative path ot go down the required number of directories to get to the root of the site.  



I understand that -- I think the site structure is okay when the Dynamically-related files error doesn't appear in DW. There are no page sub-directories (other than those created by the WA extensions). Apparently DW and running on the server see the same error as indicated by the exclamation point. Am I correct in presuming that the error means the cart object isn't available? FWIW -- I am using cookies to store the cart.

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

Mike Perry

Originally Said By: Jason Byrnes
  I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.  


Thanks Jason - I've responded to the ticket initiation. . .

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