Jump to content

Different shopping cart template


zomex

Recommended Posts

Hello everyone,

 

The problem

 

As it stands the shopping cart templates (cart.php not Ajax) use the header.tpl and footer.tpl files of the main WHMCS template selected. This means that the shopping cart uses the same header and footer files as the rest of WHMCS.

 

My Suggestion

 

- Add the header.tpl and footer.tpl includes to the shopping cart files instead of the encoded files. This will give us the ability to style the shopping cart differently that the other (less important) client side areas of WHMCS (tickets, knowledgebase, contact form etc)

 

The reason why this should be implemented

 

My main reason for this request is that it would allow us to remove the clutter that's a distraction to the visitor on the order pages (menu. sidebar, links in general) which in-turn will drastically increase your conversion rates.

 

Worth noting

 

This is already the case for the Ajax order form:

 

orderr.png

 

Thanks,

Jack

Edited by zomex
Link to comment
Share on other sites

you can change what shows up in the order area using if statements.

 

example:

 

http://forum.whmcs.com/showthread.php?t=21209

 

I'm experimenting with this and so far I'm able to get areas to work as I like but in some cases it simply isn't working as it should when looking at the code (it's probably my lack of PHP knowledge :D ).

 

For example:

 


{if $pagetitle != 'Shopping Cart'}

<div id="copyright">
<p><a href="/legal/terms-of-service.php" title="Terms Of Service" class="tooltip">Terms Of Service</a> | <a href="/legal/acceptable-usage-policy.php" title="Acceptable Usage Policy" class="tooltip">Acceptable Usage Policy</a> | <a href="/legal/privacy-policy.php" title="Privacy Policy" class="tooltip">Privacy Policy</a> | <a href="/legal/disclaimer.php" title="Disclaimer" class="tooltip">Disclaimer</a> | <a href="/sitemap.php" title="Website Sitemap" class="tooltip">Sitemap</a><br />This website and its content are copyright of Zomex - © Zomex 2011. All rights reserved.</p>
</div>

{else}

{php} include("../files/includes/footer.php"); {/php}

{/if}

 

The above code will show the footer include contents on the cart but the slimmed down version on the other WHMCS pages. Looking at the code it should show the copyright div content on the shopping cart pages and the footer include content on all other pages.

 

Is it not possible to use this if statement with the else tag?

 

Thanks!

Link to comment
Share on other sites

{if $pagetitle != 'Shopping Cart'}

 

Content Here will show on every page but the cart

 

{else}

 

Content here will show on cart

 

{/if}

 

Thanks mate!

 

I've got the header and footer HTML content working perfectly. The only issue that I'm having now is with applying 2 styles to the shopping cart pages. The varible itself is showing the code of the correct page but for some reason when I view source the CSS has been removed.

 

Here's my code:

 

{if $pagetitle != 'Shopping Cart'}
<link type="text/css" rel="stylesheet" href="/files/css/style.css" />
{else}
<style type="text/css">

body { background: #000; }
.logo { margin: 0 0 0 20px; }

</style>
<link type="text/css" rel="stylesheet" href="/files/css/style.css" />
{/if}

 

The correct code is showing up on the right pages but when I view source on the cart pages it displays this instead (As you can imagine this is in the <head> section):

 

<style type="text/css">

body .logo 
</style>

 

I could create a different stylesheet for the cart page but that would mean updating 2 stylesheets all of the time so if I can resolve this it will be perfect.

 

Cheers.

Link to comment
Share on other sites

try

 

{literal}
<style type="text/css">
body { background: #000; }
.logo { margin: 0 0 0 20px; }
</style>
{/literal}

 

I always assumed that {literal} was for inline javascript but I assumed wrongly :)

 

Everything is working perfectly, thanks for your help!

Link to comment
Share on other sites

  • WHMCS CEO

Here's a slightly better solution than what you've already got there for the header.tpl and footer.tpl files:

 

{if $pagetitle eq $LANG.carttitle}
Display Shopping Cart Header/Footer
{else}
Display Normal Header/Footer
{/if}

 

The benefit of this is that it works the same for all languages. Your current method only works for English.

 

And the literal tags need to be used to enclose any code that contains { or } characters to stop smarty trying to interpret them as template tags.

 

Hope this helps.

 

Matt

Link to comment
Share on other sites

Here's a slightly better solution than what you've already got there:

 

{if $pagetitle eq $LANG.carttitle}
Display Shopping Cart Header/Footer
{else}
Display Normal Header/Footer
{/if}

 

The benefit of this is that it works the same for all languages. Your current method only works for English.

 

And the literal tags need to be used to enclose any code that contains { or } characters to stop smarty trying to interpret them as template tags.

 

Hope this helps.

 

Matt

 

Cheers Matt I'll get that changed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated