X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Help with Errors when Moving Login and Shopping Cart (https://forum.x-cart.com/showthread.php?t=43905)

Vivarant 11-26-2008 05:00 PM

Help with Errors when Moving Login and Shopping Cart
 
I modified my store to move the login and cart to the top by editing skin1/customer/home.tpl as shown below. This worked great to move the Login and Shopping cart to the top but when i logged in i could not see Categories, Manufactures or the Cart. Is there another file i'm supposed to edit so that logged in customers can view the changes or is the code messed up somehow?

Code:

<td class="VertMenuLeftColumn">
{ include file="customer/search.tpl" }
<br />
{if $login eq "" }
{ include file="auth.tpl" }
<br />
{ include file="customer/menu_cart.tpl" }
<br />
{if $active_modules.SnS_connector && $config.SnS_connector.sns_display_button eq 'Y'}
{include file="modules/SnS_connector/button.tpl"}<br />
<br />
{/if}
{*{ include file="customer/categories.tpl" }*}
{include file="treemenu/treemenu.tpl"}
<br />
{if $active_modules.Manufacturers ne "" and $config.Manufacturers.manufacturers_menu eq "Y"}
{ include file="modules/Manufacturers/menu_manufacturers.tpl" }
{/if}
{ include file="customer/special.tpl" }
{if $active_modules.Survey && $menu_surveys}
{foreach from=$menu_surveys item=menu_survey}
{include file="modules/Survey/menu_survey.tpl"}
<br />
{/foreach}
{/if}
<br />
{/if}
{if $login eq "" }
{ include file="news.tpl" }
{else}
{ include file="authbox.tpl" }
{/if}
<br />
{include file="customer/main/recently_viewed.tpl"}
<br />
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu eq "Y"}
{ include file="modules/Bestsellers/menu_bestsellers.tpl" }
{/if}
<br />
{if $active_modules.Interneka ne ""}
{ include file="modules/Interneka/menu_interneka.tpl" }
<br />
{/if}
{ include file="help.tpl" }
<br />
{ include file="livehelp.tpl" }
<br />
{ include file="poweredby.tpl" }
<br />


JWait 11-26-2008 06:14 PM

Re: Help with Errors when Moving Login and Shopping Cart
 
Is your version 4.0.19 or 4.1.9? Please update your signature.

You have your...
{if $login eq "" }
{include file="auth.tpl" }
{else}
{include file="authbox.tpl" }
{/if}
split by a bunch of other includes.

From the thread at http://forum.x-cart.com/showthread.php?t=21529

auth.tpl - this is the side menu login box. Shared between admin and customer side.
(this includes the "username" and "password" boxes, the login (secure or not) and register buttons, as well as the "If JavaScript is.." links)

authbox.tpl - this is the side menu login box for logged in customers. Shared between admin and customer side.
(this includes the "logout" button/link)

What you have done is make the following dependent on if the customer is not logged in ( {if $login eq "" } )...
{ include file="customer/menu_cart.tpl" }
{include file="modules/SnS_connector/button.tpl"}
{include file="treemenu/treemenu.tpl"}
{ include file="modules/Manufacturers/menu_manufacturers.tpl" }
{ include file="customer/special.tpl" }
{include file="modules/Survey/menu_survey.tpl"}

So none of these will be displayed if you are logged in.

For every "if" there needs to be a closing "/if". The one for {if $login eq "" } doesn't occur until...
{/foreach}
{/if}
<br />
{/if} <<<<<<<<<<<<< HERE
{if $login eq "" } <<< and then you use it again (so news will only display if you are not logged in)
{ include file="news.tpl" }
{else}
{ include file="authbox.tpl" }
{/if}

Vivarant 11-26-2008 07:12 PM

Re: Help with Errors when Moving Login and Shopping Cart
 
can i just get rid of {if $login eq "" }? I'm really lost at this point of what to do

JWait 11-27-2008 03:49 AM

Re: Help with Errors when Moving Login and Shopping Cart
 
Get rid of the {/if}{if $login eq "" } just before { include file="news.tpl" }.
Then move the {else} { include file="authbox.tpl" } {/if} to the top, just under { include file="auth.tpl" }


All times are GMT -8. The time now is 01:57 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.