Post by lii240 » Thu Feb 20, 2014 11:47 pm

How can I remove the top right section which has "Currency, Shopping Cart, the Login" and so on from the Contact Us page?

I've looked into the contact.tpl file under Catalog/View/Theme/Default/Template/Information but was unable to find the solution in there.

Newbie

Posts

Joined
Mon Nov 11, 2013 12:58 pm

Post by stokeyblokey » Fri Feb 21, 2014 12:08 am

Hmmm, that information is loaded site-wide from the header.tpl file in catalog/view/theme/default/template/common so you would have to modify it to include an if/else statement to stop it loading on the Contact page only, unless there is a better way anyone?

Stokey

Stokey


User avatar
Active Member

Posts

Joined
Sat Aug 31, 2013 10:19 pm

Post by lii240 » Tue Feb 25, 2014 6:28 am

Sorry for the late reply.
Any tips on achieving that? I'm terrible at PHP and all I could think of is

if(page=="index.php?route=information/contact")

And even that looks wrong ;D

Newbie

Posts

Joined
Mon Nov 11, 2013 12:58 pm

Post by ocaddons » Tue Feb 25, 2014 10:03 am

Hi lii240,

Did you install the vqmod which let you change the core system without modify any core file? You just need to add a xml file into your the vqmod to change the core feature. In this way, it will not impact your store's upgrade in the future.

If you install the vqmod, i could give you a xml file to modify the contact us page without change any core code of opencart.

Please contact me via ocaddons@gmail.com.

Image
Image

EMail: support@ocaddons.com


User avatar
New member

Posts

Joined
Fri Dec 27, 2013 10:21 am


Post by billynoah » Tue Feb 25, 2014 3:37 pm

lii240 wrote:Sorry for the late reply.
Any tips on achieving that? I'm terrible at PHP and all I could think of is

if(page=="index.php?route=information/contact")

And even that looks wrong ;D
Is this what you're after?
http://oc-demo-155.zuma-design.com/inde ... on/contact

Surround the code you want to omit in the header.tpl with a conditional block like this.

BEFORE:

Code: Select all

<?php if (empty($this->request->get['route']) || $this->request->get['route'] != 'information/contact') { ?>
IN BETWEEN: (the html you'd like to omit from the contact page)

AFTER:

Code: Select all

<?php } ?>
The if statement asks two questions. First, is "route" absent from the query string? Second (if "route" is in the query), is the route NOT equal to "information/contact" ? If either condition is true then it's safe to assume the we are not on the "contact us" page and the html code which follows will execute. If not, it will be omitted. The latter should only happen when you visit a page which has the route to the contact page.

In the demo link I posted above the "header" div section ends up looking something like this:

Code: Select all

<div id="header">
  <?php if ($logo) { ?>
  <div id="logo"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
  <?php } ?>
  <?php if (empty($this->request->get['route']) || strpos($this->request->get['route'],"contact") === false) { ?>
  <?php echo $language; ?>
  <?php echo $currency; ?>
  <?php echo $cart; ?>
 
  <div id="search">
    <div class="button-search"></div>
    <input type="text" name="search" placeholder="<?php echo $text_search; ?>" value="<?php echo $search; ?>" />
  </div>
  <div id="welcome">
    <?php if (!$logged) { ?>
    <?php echo $text_welcome; ?>
    <?php } else { ?>
    <?php echo $text_logged; ?>
    <?php } ?>
  </div>
  <div class="links"><a href="<?php echo $home; ?>"><?php echo $text_home; ?></a><a href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a><a href="<?php echo $account; ?>"><?php echo $text_account; ?></a><a href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a><a href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></div>
   <?php } ?>
</div>

Image


User avatar
Active Member

Posts

Joined
Tue Jan 15, 2013 12:46 pm

Post by stokeyblokey » Tue Feb 25, 2014 6:29 pm

Thanks for the great example billynoah :)

Stokey


User avatar
Active Member

Posts

Joined
Sat Aug 31, 2013 10:19 pm

Post by lii240 » Wed Feb 26, 2014 5:59 am

Thanks for the help guys.
billynoah's code worked perfectly ;D

Newbie

Posts

Joined
Mon Nov 11, 2013 12:58 pm

Post by ocaddons » Thu Feb 27, 2014 1:03 pm

Hi lil240,

I recommend not to modify the code directly. It will impact your future upgrade.

Image
Image

EMail: support@ocaddons.com


User avatar
New member

Posts

Joined
Fri Dec 27, 2013 10:21 am

Who is online

Users browsing this forum: No registered users and 23 guests