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)
-   -   common if/then modifications I make to x-cart... (https://forum.x-cart.com/showthread.php?t=8881)

Jon 09-11-2013 09:57 PM

Re: common if/then modifications I make to x-cart...
 
{$lng.your_variable_name}

It will appear blank if empty.

JacksmithxD 12-15-2013 04:45 PM

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.

:D

carpeperdiem 12-15-2013 05:15 PM

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?

revolate 12-16-2013 02:21 AM

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.

Jon 12-16-2013 02:23 AM

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}

revolate 12-16-2013 02:26 AM

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

Jon 12-16-2013 02:32 AM

Re: common if/then modifications I make to x-cart...
 
On the last categories the page?

revolate 12-16-2013 02:43 AM

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

PhilJ 12-16-2013 07:05 AM

Re: common if/then modifications I make to x-cart...
 
Revolate, maybe try...
Quote:

{if $cat_products} ... {/if}

totaltec 12-16-2013 07:19 AM

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.


All times are GMT -8. The time now is 05:16 AM.

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