Page 1 of 1

[SOLVED] Adding the Registration/Login Form in Orders Module

Posted: Wed May 25, 2011 3:14 am
by pixelita
Hi, all. I am sorry to be pestering you all yet again, but this is my first CMSMS-based shopping cart. It's using the following ecommerce and related modules:

CMS Version
1.9.4.1

CGExtensions
1.25.3

Promotions
1.0.14

FrontEndUsers
1.12.16

CGEcommerceBase
1.3.1

CGSimpleSmarty
1.4.8

CGPaymentGatewayBase
1.0.10

AuthNetSim
1.0

Products
2.11

Cart
1.8.1

PaypalGateway
2.3.3

Orders
1.12.6

FRShipping
1.2.1

DestinationBasedShipping
1.1

PriceBasedShipping
1.1.1

FRTaxes
1.1.1

FEU_Auth_Basic
1.0

CGMyOrders
1.0

Here is the issue (well the current one; there are more, but one at a time!).

I have created the Checkout page and basically done everything else according to this tutorial:
http://www.packtpub.com/article/cms-mad ... ce-website

I have created the Cart page and the Checkout page according to those instructions, bearing in mind that CalGuy has updated the Orders and Cart modules very recently so the tutorial may be outdated.

My problem is when Sophia talks about integrating the FEU registration/login into the Checkout page here:
The login form for registered customers can be displayed with the module FrontEndUsers.

In the admin area of the Orders module, click on the Templates link and create a new template with the name My Shop on the tab. Scroll down to the very bottom of the suggested template text and the last ELSE condition:

Code: Select all

...{else}{* user is not logged in, gotta make him *}<h3 style="color: red;">{$Orders>Lang('error_notloggedin')}</h3><br/>{/if}
This is the place where the message that the user is not logged in is shown. Replace this section with the login screen of the module FrontEndUsers, as shown in the following code snippet:

Code: Select all

...{else} <h1>Already registered?</h1>{FrontEndUsers}{/if}
The problem is the default and only billing template found doesn't have that code snippet anywhere to be found. My default billing template looks like this:

Code: Select all

{* billing form template *}
{* this is a frontend template *}
<h3>{$Orders->Lang('order_processing')}:</h3>
{if isset($status)}
  {* there is an error of some type.... you can check the $status variable for the type of error *}
  <div class="error">
  <ul>
  {foreach from=$errors item='error'}
    <li>{$error}</li>
  {/foreach}
  </ul>
  </div>
{/if}

{$formstart}

<div class="billing_info">
<fieldset>
<legend>&nbsp;{$Orders->Lang('billing_info')}:&nbsp;</legend>
<span class="required">{$Orders->Lang('company')}: {$input_billing_company}</span><br />
<span class="required">{$Orders->Lang('first_name')}:* {$input_billing_first_name}</span><br />
<span class="required">{$Orders->Lang('last_name')}:* {$input_billing_last_name}</span><br />
<span class="required">{$Orders->Lang('address1')}:* {$input_billing_address1}</span><br />
{$Orders->Lang('address2')}: {$input_billing_address2}<br />
<span class="required">{$Orders->Lang('city')}:* {$input_billing_city}</span><br />
<span class="required">{$Orders->Lang('state/province')}:* {$input_billing_state}</span><br />
<span class="required">{$Orders->Lang('postal')}:* {$input_billing_postal}</span><br />
<span class="required">{$Orders->Lang('country')}:* {$input_billing_country}</span><br />
{$Orders->Lang('phone')}: {$input_billing_phone}<br />
{$Orders->Lang('fax')}: {$input_billing_fax}<br />
{$Orders->Lang('email')}:* {$input_billing_email}<br />
</fieldset>
</div>
<br/>

{* if you do not need shipping information, just hide these fields using css *}
{foreach from=$shipping_inputs item='one' name='shipments'}
<div class="shipping_info">
{assign var='addr' value=$one.data->get_shipping_address()}
<fieldset>
{* this next part is a bit hackish *}
{capture assign='name'}{$one.data->get_name()}{/capture}
<legend> {if $smarty.foreach.shipments.total == 1}{$Orders->Lang('shipping_info_if_different')}:{else}{$Orders->Lang('shipping_info_for')}: {$name}:{/if}</legend>
<span class="required">{$Orders->Lang('company')}: {$one.input_company}</span><br />
<span class="required">{$Orders->Lang('first_name')}:* {$one.input_first_name}</span><br />
<span class="required">{$Orders->Lang('last_name')}:* {$one.input_last_name}</span><br />
<span class="required">{$Orders->Lang('address1')}:* {$one.input_address1}</span><br />
{$Orders->Lang('address2')}: {$one.input_address2}<br />
<span class="required">{$Orders->Lang('city')}:* {$one.input_city}</span><br />
<span class="required">{$Orders->Lang('state/province')}:* {$one.input_state}</span><br />
<span class="required">{$Orders->Lang('postal')}:* {$one.input_postal}</span><br />
<span class="required">{$Orders->Lang('country')}:* {$one.input_country}</span><br />
{$Orders->Lang('phone')}: {$one.input_phone}<br />
{$Orders->Lang('fax')}: {$one.input_fax}<br />
{$Orders->Lang('email')}:* {$one.input_email}<br />
</fieldset>
<br/>
</div>
{/foreach}

<fieldset>
<legend>&nbsp;{$Orders->Lang('order_notes')}:&nbsp;</legend>
<p>{$Orders->Lang('info_order_notes')}</p>
{$order_notes}
</fieldset>
<br/>

<input type="submit" name="{$actionid}submit" value="{$Orders->Lang('next')}"/>

{$formend}
Any ideas what I'm doing wrong or where to place the code Sophia suggested? And I'm not averse to paying someone for some help with this, but I'd really like to do as much as possible on my own (it's the only way to learn!). Thanks!

Joni

Re: Adding the Registration/Login Form in Orders Module

Posted: Sat May 28, 2011 11:21 am
by Utter
I was also wrestling with this problem and after a bit of forum-prodding I found this alternative method.

It seems likely that the Orders template no longer processes the {if logged_in} but by using Custom Content you can effect the same result by wrapping the {Orders} tag on the Checkout page with

Code: Select all

{if $ccuser->loggedin()}{Orders}
{else}
{FrontEndUsers}
{/if}
For the whole, sometimes painful discussion see the topic at

http://forum.cmsmadesimple.org/viewtopi ... s+template

Hope this helps.

[SOLVED] Re: Adding the Registration/Login Form in Orders Mo

Posted: Sun May 29, 2011 5:22 pm
by pixelita
Yes, it does, thanks. I just need to figure out where the template is that drives this bad boy. I am guessing FEU. Thanks for the tip!

Re: [SOLVED] Adding the Registration/Login Form in Orders Mo

Posted: Fri Nov 11, 2011 1:24 am
by inyerface
Does anybody know how to change which fields are required on the billing form? Man I've toyed around everywhere I can think of.