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
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

Data from Cart2 into FormBuilder and into Email

Post by thomahawk »

After trying a lot about this, I still did not get it. I have all the newest versions of CMSMS and modules. I have a template from Cart2, and by using a Module Interface field in FormBuilder, the data does show on the form page in frontend, but my problem still is: it does not get sent in the email from FormBuilder.

The FormBuilder form has a Module Interface Field with this tag:
{Cart2 action='viewcart' viewcarttemplate='bestellform'}

This works so far as the cart content is displayed correctly on the form page in frontend. The Cart2 template 'bestellform' contains nothing regarding to FormBuilder. It is just tags and html that does produce a list of products and prices which are in the cart. Nothing to fill in, no input fields.

The help page of the Module Interface field explains to use {$FBid} to tie back into FormBuilder. But I would not know where to place such a tag in my Cart2 template, and anyway as it already works getting the data into FormBuilder, I suppose it is not needed in my case?


This is the Cart2 template

Code: Select all

<div class="cart">


  {foreach from=$cartitems item='oneitem'}

<div class="artikel">
  {$oneitem->summary}
</div>

<div class="anzahl">
           {$oneitem->quantity}   
</div>

<div class="preis">    
{$currencysymbol} {$oneitem->item_total|number_format:2}
 </div>     

<div style="clear: both;"></div>
  {/foreach}

<div class="artikel">
Versandkosten
</div>
<div class="anzahl">
</div>
<div class="preis">    
{$currencysymbol} 9.00
 </div>    
<div style="clear: both;"></div>

<div class="total">
{assign var="inklversand" value=$carttotal+9}
Total: {$currencysymbol} {$inklversand|number_format:2}
</div>


</div>
Stikki

Re: Data from Cart2 into FormBuilder and into Email

Post by Stikki »

So where do you need formbuilder?

Does user fill any forms? Or is this just for sending email?
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

Re: Data from Cart2 into FormBuilder and into Email

Post by thomahawk »

Thanks for your post, Stikki.
Its an order form. Cart2 creates the list of products to order and FormBuilder displays the list (in one Module Interface field) together with fields for name, address etc. on one page. By clicking on the "order" button, all this data is then sent by email to our office for processing.

The Cart2 data (product list) does show up on the order form on top of the entry fields for name, address etc. but the resulting email does not contain the Cart data.

Of course the corresponding field id is set in the html email template.
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

Re: Data from Cart2 into FormBuilder and into Email

Post by thomahawk »

I have made a provisional solution to this. Basically I use two things:

The Module interface field on top of the formbuilder order form displays products listed nice like set in cart template. But as this data does not get along with the email sent out by FB:

a hidden text input field receives the same data, but without css formatting, inside the link URL from a button on the cart template. This data goes with the email, and it works. (The same approach Velden teached me on this topic http://forum.cmsmadesimple.org/viewtopi ... =7&t=69532 )

This works, except I dont know how long such an URL is allowed to get. However, I am still interested to know how to use the data from the Module interface field directly to be sent with the order email. Or to know why this does not work?

Regards
Thomas
chandra

Re: Data from Cart2 into FormBuilder and into Email

Post by chandra »

Why do you want to use FormBuilder for that?

Have you checked the Orders module if it can do what you want?
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

Re: Data from Cart2 into FormBuilder and into Email

Post by thomahawk »

I have the FormBuilder module already set up and styled, did not want to do all this again just for another module that does the same thing. Furthermore, I have used the order module in the past and it was much too complex as I only need a single step checkout (Address input with send button).
chandra

Re: Data from Cart2 into FormBuilder and into Email

Post by chandra »

thomahawk wrote: (Address input with send button).
OK, but in my opinion FormBuilder is oversized too for this simple task ;).

Suggest a slim plugin.
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

Re: Data from Cart2 into FormBuilder and into Email

Post by thomahawk »

For only this, yes, but I need several different forms and functions on that site.
chandra

Re: Data from Cart2 into FormBuilder and into Email

Post by chandra »

To the first - plugins are a lot faster than modules cause there is no API overhead.

To the second - a (mail) plugin can use templates too. So you can define different templates for different tasks but with the same plugin. The needs are simple too.

What do you mean with other functionalities?
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

Re: Data from Cart2 into FormBuilder and into Email

Post by thomahawk »

There is a simple plugin available for creating contact and order forms?
chandra

Re: Data from Cart2 into FormBuilder and into Email

Post by chandra »

I'm using a Smarty plugin for sending template based forms.

What you want to send is your choice, contact information, orders, what you want ;).
Stikki

Re: Data from Cart2 into FormBuilder and into Email

Post by Stikki »

Let's take example:

go to: http://www.nopsa.fi/kilpailu

Competition is made with ListItExtended and FormBuilder.

I print bikes with Module Interface field:

Code: Select all

{ListIt2Products summarytemplate='fb_competition_template'}
Then my 'fb_competition_template' looks some what this:

Code: Select all

<ul class="competition-menu">
{foreach from=$items item=onec}
    <li>
        {* Grap data from models *}    
        {assign var=allmodels value=$onec->fielddefs.models->GetValue("array")}
        <label for="{$onec->alias}">{ListIt2Models|strip action='detail' item=$allmodels.0}</label>
        
        <input type="radio" value="{$onec->title}" name="{$FBid}" id="{$onec->alias}" />
        
        <span class="nopsa-green">{$onec->title}</span>
    </li>
{/foreach}
</ul>
So important part for you is that you have to create input element into cart2 template that ACTUALLY sends data into FB.

If this didn't give you enough info, we may continue discussion via skype or email as paid support.

Best regards

Stikki
User avatar
thomahawk
Power Poster
Power Poster
Posts: 312
Joined: Fri Jul 25, 2008 10:13 am

Re: Data from Cart2 into FormBuilder and into Email

Post by thomahawk »

Well, the thing is, I dont need input fields. I only have a list of chosen products. And it already works, the data shows up inside the Interface Module field. It seems there must be a bug that prevents the data from being sent with the email.
uniqu3

Re: Data from Cart2 into FormBuilder and into Email

Post by uniqu3 »

You DO need input fields, just because you see data in Form doesn't mean it can be sent.
Thats how ANY form on whole world wide web works, you can't send just some plain rendered HTML without using actual form Fields with name attributes.

http://www.w3schools.com/html/html_forms.asp
Stikki

Re: Data from Cart2 into FormBuilder and into Email

Post by Stikki »

<input type="hidden" value="{$my_cart2_data_i_wanna_pass_to_form}" name="{$FBid}" />

Maybe like this?
Post Reply

Return to “Modules/Add-Ons”