Page 2 of 2

Re: Data from Cart2 into FormBuilder and into Email

Posted: Sun Mar 23, 2014 3:14 am
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

Re: Data from Cart2 into FormBuilder and into Email

Posted: Wed May 07, 2014 6:15 am
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.

Re: Data from Cart2 into FormBuilder and into Email

Posted: Wed May 07, 2014 6:22 am
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?

Re: Data from Cart2 into FormBuilder and into Email

Posted: Wed Jun 11, 2014 1:29 pm
by Rolf
There is a bug in it, but {cgecomm_erasecart} should do the trick. Already told CG about it.