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

common if/then modifications I make to x-cart...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #161  
Old 09-11-2013, 09:57 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: common if/then modifications I make to x-cart...

{$lng.your_variable_name}

It will appear blank if empty.
Reply With Quote

The following user thanks Jon for this useful post:
tartaglia (09-12-2013)
  #162  
Old 12-15-2013, 04:45 PM
 
JacksmithxD JacksmithxD is offline
 

X-Adept
  
Join Date: Oct 2010
Posts: 400
 

Default Re: common if/then modifications I make to x-cart...

Anyway to have an if statement to work just on a category page that displays the products? So far I can only see it working if it's 'xxx' but I need it to work on just the categorys with products listed on it.

__________________
Xcart 4.5.2
Reply With Quote
  #163  
Old 12-15-2013, 05:15 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: common if/then modifications I make to x-cart...

Quote:
Originally Posted by JacksmithxD
Anyway to have an if statement to work just on a category page that displays the products? So far I can only see it working if it's 'xxx' but I need it to work on just the categorys with products listed on it.


How about:

{if $main eq "catalog" and $current_category.category ne ""}

This makes certain that there is a category that is not empty. This is the inverse of the homepage (where category will be empty).
Yes?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #164  
Old 12-16-2013, 02:21 AM
 
revolate revolate is offline
 

Newbie
  
Join Date: Dec 2013
Posts: 4
 

Default Re: common if/then modifications I make to x-cart...

Quote:
Originally Posted by carpeperdiem
How about:

{if $main eq "catalog" and $current_category.category ne ""}

This makes certain that there is a category that is not empty. This is the inverse of the homepage (where category will be empty).
Yes?

Didn't appear to work for my site, driving me insane lol.
__________________
4.5.2
Reply With Quote
  #165  
Old 12-16-2013, 02:23 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: common if/then modifications I make to x-cart...

That if/else statement should work for all categories on all x-cart versions without fail. Usually I'll do the ID though just to be extra safe:

Code:
{if $main eq "catalog" AND $current_category.categoryid ne ""}Show Text{/if}
Reply With Quote
  #166  
Old 12-16-2013, 02:26 AM
 
revolate revolate is offline
 

Newbie
  
Join Date: Dec 2013
Posts: 4
 

Default Re: common if/then modifications I make to x-cart...

Quote:
Originally Posted by Jon
That if/else statement should work for all categories on all x-cart versions without fail. Usually I'll do the ID though just to be extra safe:

Code:
{if $main eq "catalog" AND $current_category.categoryid ne ""}Show Text{/if}

I have this below:

{if $main eq "catalog" AND $current_category.categoryid ne ""}
{include file="modules/Refine_Filters/customer_filter.tpl"}
{/if}

Trying to make the filter only work on the last categories the page with products showing in a list.

Having it on every category isn't what I need. (Hope I'm explaining my self right)

Cheers guys
__________________
4.5.2
Reply With Quote
  #167  
Old 12-16-2013, 02:32 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: common if/then modifications I make to x-cart...

On the last categories the page?
Reply With Quote
  #168  
Old 12-16-2013, 02:43 AM
 
revolate revolate is offline
 

Newbie
  
Join Date: Dec 2013
Posts: 4
 

Default Re: common if/then modifications I make to x-cart...

Basically pages showing products, the filter appears on every category which looks poor, if it just appears on categories with products showing it would make my life easier lol
__________________
4.5.2
Reply With Quote
  #169  
Old 12-16-2013, 07:05 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: common if/then modifications I make to x-cart...

Revolate, maybe try...
Quote:
{if $cat_products} ... {/if}
__________________
xcartmods.co.uk
Reply With Quote
  #170  
Old 12-16-2013, 07:19 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: common if/then modifications I make to x-cart...

Quote:
Originally Posted by revolate
Basically pages showing products, the filter appears on every category which looks poor, if it just appears on categories with products showing it would make my life easier lol
I would setup a new checkbox on the category page in admin checked by default, then just uncheck it if I didn't want this element to show.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:35 AM.

   

 
X-Cart forums © 2001-2020