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)
-   -   Hide Left & Right Columns On Specific Page Product.php (https://forum.x-cart.com/showthread.php?t=47138)

jer 04-23-2009 11:46 PM

Hide Left & Right Columns On Specific Page Product.php
 
My Version: X-Cart version 4.1.10

1. I want to remove or hide the left and right vert menus on pages that display the specific product.

Example url:
http://www.mysite.com/product.php?productid=32&cat=195&page=1

2. I would also liketo remove them on static & help pages like:

http://www.mysite.com/help.php
http://www.mysite.com/help.php?section=about


I am fine with it everywhere else, so how do you remove them?
Where do I edit?
What code do I insert or comment out?

I am not an expert coder so if possible please be specific like "edit file XXXX and add / or remove this code XXXXX.

Thanks

Thanks

ElegantXMods.com 04-24-2009 01:43 AM

Re: Hide Left & Right Columns On Specific Page Product.php
 
Hi there,

The files you'll need to edit are skin1/customer/home.tpl and skin/customer/home_main.tpl (this is for X-Cart 4, which I'm presuming you're using, you'll need to update your signature so that forum members can help you better).

home.tpl is like a 'master' template for laying out each page, with HTML interspersed with Smarty logic, while home_main.tpl basically sets out what should be displayed on home.tpl depending on which section the customer has gone to.

To remove the left and right columns for specific pages, the exact code changes are different for X-Cart 4.1 and X-Cart 4.2. Would it be possible to tell me which version you're using?

jer 04-24-2009 02:31 PM

Re: Hide Left & Right Columns On Specific Page Product.php
 
Ok I added my version it was also at the top of the post.

Now I do not want to remove it from all pages just the page that displays the specific product as in the example on my first post and also remove it from the help pages.

Any ideas anyone?

ElegantXMods.com 04-27-2009 01:27 AM

Re: Hide Left & Right Columns On Specific Page Product.php
 
Open skin1/customer/home.tpl and find the line

Code:

<div id="center-main">

ABOVE this line, insert this code

Code:

{if $main eq "pages" or ($main eq "product" and $product["productid"] eq 111)}
    {include file="customer/home_main.tpl"}
{else}


and replace 111 with your chosen product ID (or you could use the SKU / product code instead: use $product["productcode"] ).

now scroll down and find

Code:

{include file="poweredby.tpl" }

and ABOVE this insert this line:

Code:

{/if}

jer 04-28-2009 10:46 PM

Re: Hide Left & Right Columns On Specific Page Product.php
 
Thank you very much for your reply, now I think you understand what i want to do except i may have miss typed what i meant.

1. I basically do not want the left or right columns shows on any pages that display products, not just one specific product.


2. Also I do not want it to show on help pages or custom pages i create.

Thanks

ElegantXMods.com 04-29-2009 01:56 AM

Re: Hide Left & Right Columns On Specific Page Product.php
 
Hi there,

In that case, just change the code from my previous post:

Code:

{if $main eq "pages" or ($main eq "product" and $product["productid"] eq 111)}
    {include file="customer/home_main.tpl"}
{else}


to:

Code:

{if $main eq = "pages" or $main eq "product"}
    {include file="customer/home_main.tpl"}
{else}


jer 04-30-2009 09:57 PM

Re: Hide Left & Right Columns On Specific Page Product.php
 
That code setup did not workI get errors.

If this helps I have a 7dana template, and an image mod and below I have posted my home.tpl code:

Code:

{* $Id: home.tpl,v 1.88.2.11 2007/08/08 13:51:54 max Exp $ *}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{if $printable ne ''}
{include file="customer/home_printable.tpl"}
{else}
{config_load file="$skin_config"}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{strip}
{capture name=title}
{if $config.SEO.page_title_format eq "A"}
{section name=position loop=$location}
{if not %position.first%}&nbsp;::&nbsp;{/if}
{$location[position].0|strip_tags|escape}
{/section}
{else}
{section name=position loop=$location step=-1}
{if not %position.first%}&nbsp;::&nbsp;{/if}
{$location[position].0|strip_tags|escape}
{/section}
{/if}
{/capture}
{if $config.SEO.page_title_limit <= 0}
{$smarty.capture.title}
{else}
{$smarty.capture.title|replace:"&nbsp;":" "|truncate:$config.SEO.page_title_limit|replace:" ":"&nbsp;"}
{/if}
{/strip}</title>
{include file="meta.tpl" }
<link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}" />
{* xCartMod.com - Dynamic Images 2 *}
{if $active_modules.Detailed_Product_Images ne "" and $config.Detailed_Product_Images.det_image_thumbnails eq "Y" and $main eq "product"}
<link rel="stylesheet" href="{$SkinDir}/modules/Detailed_Product_Images/dynamic_images.css" />
{if $config.Detailed_Product_Images.det_image_thumbs_shadowbox eq "Y"}
<script type="text/javascript" src="{$SkinDir}/shadowbox/src/adapter/shadowbox-base.js"></script>
<script type="text/javascript" src="{$SkinDir}/shadowbox/src/shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.loadSkin('classic', '{$SkinDir}/shadowbox/src/skin');
Shadowbox.loadLanguage('en', '{$SkinDir}/shadowbox/src/lang');
Shadowbox.loadPlayer(['img'], '{$SkinDir}/shadowbox/src/player');
window.onload = Shadowbox.init;
</script>
{/if}
{include file="main/include_js.tpl" src="modules/Detailed_Product_Images/product_images_thumbs.js"}
{/if}
{* xCartMod.com - Dynamic Images 2 *}
</head>
<body{$reading_direction_tag}{if $body_onload ne ''} onload="javascript: {$body_onload}"{/if}>
{include file="rectangle_top.tpl" }
{include file="head.tpl" }
{if $active_modules.SnS_connector}
{include file="modules/SnS_connector/header.tpl"}
{/if}
<!-- main area -->
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="VertMenuLeftColumn"><br><br>
{if $categories ne "" and ($active_modules.Fancy_Categories ne "" or $config.General.root_categories eq "Y" or $subcategories ne "")}
{include file="customer/categories.tpl" }
<br />
{/if}<!--
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu eq "Y"}
{include file="modules/Bestsellers/menu_bestsellers.tpl" }
{/if}
{if $active_modules.Manufacturers ne "" and $config.Manufacturers.manufacturers_menu eq "Y"}
{include file="modules/Manufacturers/menu_manufacturers.tpl" }
{/if} -->
<div class="VertMenuTitle">Package Deals</div>
<div class="VertMenuBox" style="padding:5px;"><a href="home.php?cat=180" class="VertMenuItems">High School Dances</a><br />
<a href="home.php?cat=181" class="VertMenuItems">Graduations</a><br />
<a href="home.php?cat=182" class="VertMenuItems">Weddings</a><br />
<a href="home.php?cat=183" class="VertMenuItems">Quincineta</a><br />
<a href="home.php?cat=184" class="VertMenuItems">Debutante Balls</a><br />
<a href="home.php?cat=185" class="VertMenuItems">Formal Events</a><br />
<a href="home.php?cat=186" class="VertMenuItems">Corporate Accounts</a><br />
<a href="home.php?cat=187" class="VertMenuItems">Fashion Shows</a><br />
<a href="home.php?cat=188" class="VertMenuItems">Special Events</a><br />
<a href="home.php?cat=189" class="VertMenuItems">College Events</a><br />
<a href="home.php?cat=190" class="VertMenuItems">Missionary Special</a><br />
</div><br />
{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}
{include file="help.tpl" }
<img src="{$ImagesDir}/spacer.gif" width="150" height="1" alt="" />
</td>
<td valign="top" width="100%">
<!-- central space -->
{if $gcheckout_enabled and $main ne "cart" and $main ne "checkout" and $main ne "anonymous_checkout" and $main ne "order_message"}
<div align="right">{include file="modules/Google_Checkout/gcheckout_button.tpl"}</div>
{/if}
{include file="dialog_message.tpl"}
{if $active_modules.Special_Offers ne ""}
{include file="modules/Special_Offers/customer/new_offers_message.tpl"}
{/if}
{include file="customer/home_main.tpl"}
<!-- /central space -->
&nbsp;
</td>
<td class="VertMenuRightColumn"><br /><div class="VertMenuBox" style="padding:3px;"><a href="home.php?cat=190"><img src="{$ImagesDir}/missionary.jpg" width="160" height="600" alt="" /></a></div>
<br />
{if $active_modules.SnS_connector && $config.SnS_connector.sns_display_button eq 'Y' && $sns_collector_path_url ne ''}
{include file="modules/SnS_connector/button.tpl"}
<br />
{/if}
{if $active_modules.Feature_Comparison ne "" && $comparison_products ne ''}
{include file="modules/Feature_Comparison/product_list.tpl" }
<br />
{/if}
{include file="customer/menu_cart.tpl" }
<br />
{if $login eq "" }
{include file="auth.tpl" }
{else}
{include file="authbox.tpl" }
{/if}
{include file="news.tpl" }
{if $active_modules.XAffiliate ne "" && $config.XAffiliate.partner_register eq 'Y'}
<br />
{include file="partner/menu_affiliate.tpl" }
{/if}
{if $active_modules.Interneka ne ""}
<br />
{include file="modules/Interneka/menu_interneka.tpl" }
{/if}
<br />
{include file="poweredby.tpl" }
<br />
<img src="{$ImagesDir}/spacer.gif" width="150" height="1" alt="" />
</td>
</tr>
</table>
{include file="rectangle_bottom.tpl" }
{if $active_modules.Google_Analytics ne "" && $config.Google_Analytics.ganalytics_code ne ""}
 {include file="modules/Google_Analytics/ga_code.tpl"}
{/if}
</body>
</html>
{/if}


ElegantXMods.com 05-01-2009 12:19 AM

Re: Hide Left & Right Columns On Specific Page Product.php
 
Where you have the line:

Code:

<!-- main area -->

replace it with

Code:

<!-- main area -->
{if $main eq "pages" or $main eq "product"}
    {include file="customer/home_main.tpl"}
{else}


then below that find the line

Code:

{include file="rectangle_bottom.tpl" }

and replace it with

Code:

{/if}
{include file="rectangle_bottom.tpl" }



All times are GMT -8. The time now is 05:26 PM.

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