Data from Cart2 into FormBuilder and into Email

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
User avatar
polodesign
Forum Members
Forum Members
Posts: 55
Joined: Sun Jan 03, 2010 1:58 am

Re: Data from Cart2 into FormBuilder and into Email

Post by polodesign »

Thomahawk, I needed something similar and found that the simplest way was to call the Cart2 template directly in the html email template rather than using the IncludeCart field.

Penny
scotch33
Dev Team Member
Dev Team Member
Posts: 280
Joined: Tue Feb 14, 2006 9:56 pm

Re: Data from Cart2 into FormBuilder and into Email

Post by scotch33 »

A little late to this party. I've just done this. I just drop the cart2 call into the email template that gets sent. So for example my full email template in the 'Email results to set addresses' template is...

<h1>A order request has been submitted to you from the ES Rowing Services Website</h1>
<hr />
{if $fld_31 != "" && $fld_31 != "[unspecified]" }<strong>Name</strong>: {$fld_31}<br />{/if}
{if $fld_30 != "" && $fld_30 != "[unspecified]" }<strong>Email Address</strong>: {$fld_30}<br />{/if}
{if $message != "" && $message != "[unspecified]" }<strong>Message</strong>: {$message}<br />{/if}
{if $fld_31 != "" && $fld_31 != "[unspecified]" }<strong>Phone</strong>: {$fld_31}<br />{/if}
<hr />
{Cart2 action='viewcart' viewcarttemplate='mailcart'}

This works fine.
scotch33
Dev Team Member
Dev Team Member
Posts: 280
Joined: Tue Feb 14, 2006 9:56 pm

Re: Data from Cart2 into FormBuilder and into Email

Post by scotch33 »

One thing I am struggling with is how to empty the cart after the mail gets sent. When I did this with cart rather than cart2 a few years back the following worked as a udt...

$cart = cge_utils::get_module('Cart'); $cart->EraseCart();

Thus I was hoping...

$cart2 = cge_utils::get_module('Cart2'); $cart2->EraseCart();

...Might work :-). But no such luck. What are other people using to clear the cart?
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Data from Cart2 into FormBuilder and into Email

Post by Rolf »

There is a bug in it, but {cgecomm_erasecart} should do the trick. Already told CG about it.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Modules/Add-Ons”