Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

conditional left column

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-16-2010, 09:10 PM
 
ynotcreative ynotcreative is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 65
 

Default conditional left column

I am in very quick need to make the product details page left column conditional. To be more specific, I want the left column to disappear on the details page. What I have done so far was to try to create a conditional based upon the url. When it did not work, I moved the if around to try to simplify the task for testing. I am still not able t achieve what I am after. Here is my code. Does anyone see anything obvious?

I have tried the following using both smarty and php, to no avail.
Seriously big kudos and karma points to anyone that can help!

{*
show the url for a baseline
*}
{$canonical_url}
{*
Test conditional remove on product details page
*}
{php}
if (substr ($canonical_url, "product.php?productid=") !== false ) {
"show sidebar"
}
{/php}
<div class="menu-dialog{if $additional_class} {$additional_class}{/if}">
<div class="title-bar valign-middle{if $link_href} link-title{/if}">
{strip}
{if $link_href}
<span class="title-link">
<a href="{$link_href}" class="title-link"><img src="{$ImagesDir}/spacer.gif" alt="" /></a>
</span>
{/if}
<img class="icon ajax-minicart-icon" src="{$ImagesDir}/spacer.gif" alt="" />
<h2>{$title}</h2>
{/strip}
</div>
<div class="content">
{$content}
</div>
</div>
__________________
X-Cart Pro 4.1.10, 4.3.1, 4.2.x, 4.3, 4.4.3, 4.5.5, Platinum 4.6
Add-on: X-Affiliate
Fashion Mosaic
Add-on: X-SpecialOffers
Add-on: X-GiftRegistry
Add-on: X-AOM (Advanced Order Management)
Add-on: X-FancyCategories
Add-on: Custom Multi-currency
Reply With Quote
  #2  
Old 05-16-2010, 09:56 PM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: conditional left column

First: Don't use PHP in smarty templates. It's a template engine so any actual 'work' should be done outside.

Second: Your signature shows 4.1 so it should be in that category and not 4.2/4.3

Third: Try something like this:
Code:
{* show the url for a baseline *} {$canonical_url} {if $main neq 'product'} <div class="menu-dialog{if $additional_class} {$additional_class}{/if}"> <div class="title-bar valign-middle{if $link_href} link-title{/if}"> {strip} {if $link_href} <span class="title-link"> <a href="{$link_href}" class="title-link"><img src="{$ImagesDir}/spacer.gif" alt="" /></a> </span> {/if} <img class="icon ajax-minicart-icon" src="{$ImagesDir}/spacer.gif" alt="" /> <h2>{$title}</h2> {/strip} </div> <div class="content"> {$content} </div> </div> {/if}
__________________
- Shane Munroe
Reply With Quote

The following user thanks Shamun for this useful post:
ynotcreative (05-16-2010)
  #3  
Old 05-16-2010, 10:02 PM
 
ynotcreative ynotcreative is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 65
 

Default Re: conditional left column

Sorry, my signature is way out of date. This is a 4.3.1 installation.
__________________
X-Cart Pro 4.1.10, 4.3.1, 4.2.x, 4.3, 4.4.3, 4.5.5, Platinum 4.6
Add-on: X-Affiliate
Fashion Mosaic
Add-on: X-SpecialOffers
Add-on: X-GiftRegistry
Add-on: X-AOM (Advanced Order Management)
Add-on: X-FancyCategories
Add-on: Custom Multi-currency
Reply With Quote
  #4  
Old 05-16-2010, 10:07 PM
 
ynotcreative ynotcreative is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 65
 

Default Re: conditional left column

Awesome solution, thank you so much!
__________________
X-Cart Pro 4.1.10, 4.3.1, 4.2.x, 4.3, 4.4.3, 4.5.5, Platinum 4.6
Add-on: X-Affiliate
Fashion Mosaic
Add-on: X-SpecialOffers
Add-on: X-GiftRegistry
Add-on: X-AOM (Advanced Order Management)
Add-on: X-FancyCategories
Add-on: Custom Multi-currency
Reply With Quote
  #5  
Old 05-23-2010, 02:32 PM
  FTI's Avatar 
FTI FTI is offline
 

Senior Member
  
Join Date: Oct 2009
Location: Plovdiv, Bulgaria
Posts: 153
 

Default Re: conditional left column

Thats exactly what I needed, thank you very much. Where to put this code in product.tpl? And also is there a way to push the product details all the way to the left, so I can use the free space for larger product image?
__________________
Version 4.2.3
X-Cart Gold

Version 4.3.1
X-Cart Gold
Reply With Quote
  #6  
Old 05-23-2010, 03:19 PM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: conditional left column

Quote:
Originally Posted by FTI
Thats exactly what I needed, thank you very much. Where to put this code in product.tpl? And also is there a way to push the product details all the way to the left, so I can use the free space for larger product image?


To control the left/right nav bar, you need to change the code in the .tpl file its located in... This would/should be skin1/customer/home.tpl


As for pushing product details to the left, you could try changing the details div/span css to:
Code:
float: left;
__________________
- Shane Munroe
Reply With Quote

The following user thanks Shamun for this useful post:
FTI (05-23-2010)
  #7  
Old 05-23-2010, 03:39 PM
  FTI's Avatar 
FTI FTI is offline
 

Senior Member
  
Join Date: Oct 2009
Location: Plovdiv, Bulgaria
Posts: 153
 

Default Re: conditional left column

Thank you very much, Sir!
__________________
Version 4.2.3
X-Cart Gold

Version 4.3.1
X-Cart Gold
Reply With Quote
  #8  
Old 05-23-2010, 03:52 PM
  FTI's Avatar 
FTI FTI is offline
 

Senior Member
  
Join Date: Oct 2009
Location: Plovdiv, Bulgaria
Posts: 153
 

Default Re: conditional left column

Unfortunatelly moving just the product details box to the left seems to be a problem, cause its included in home_main.tpl, which is included in <div id="center-main">, which is in the center of the website... Do you think there is any way to do this?
__________________
Version 4.2.3
X-Cart Gold

Version 4.3.1
X-Cart Gold
Reply With Quote
  #9  
Old 05-23-2010, 04:10 PM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: conditional left column

By product details, I assume you mean weight, price, SKU and extra fields right?
Those are stored in product.tpl and not home_main.tpl
__________________
- Shane Munroe
Reply With Quote
  #10  
Old 05-23-2010, 04:16 PM
  FTI's Avatar 
FTI FTI is offline
 

Senior Member
  
Join Date: Oct 2009
Location: Plovdiv, Bulgaria
Posts: 153
 

Default Re: conditional left column

No, sir. I mean to move the whole products detail container to the left. Please see attached image.
Attached Thumbnails
Click image for larger version

Name:	left_bar.jpg
Views:	89
Size:	316.4 KB
ID:	1945  
__________________
Version 4.2.3
X-Cart Gold

Version 4.3.1
X-Cart Gold
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:06 PM.

   

 
X-Cart forums © 2001-2020