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)
-   -   which file to edit ? (https://forum.x-cart.com/showthread.php?t=56534)

nivag 11-12-2010 01:14 AM

which file to edit ?
 
Hi wonder if anyone can help.....
Im trying to add extra code in specific category pages - (im using BCSE's Featured Products Manager) so im trying to add a line of smarty code.

How do I see which php file I need to add the code to for specific subcategories ?

I know which file to edit if I want to add to the main welcome page etc.... but not so sure about specific category/subcategory pages.

Hope that made sense ;-)

Using 4.4

balinor 11-12-2010 04:15 AM

Re: which file to edit ?
 
You don't edit php files in X-Cart, you edit templates. Your best bet is to use Webmaster Mode - it will tell you exactly which template is which. In general, subcategories are controlled by customer/main/subcategories.tpl, but there are now a few templates associated with that area.

nivag 11-12-2010 05:27 AM

Re: which file to edit ?
 
Thnx Balinor, using the webmaster mode I have found that it is either of the 2 files:
customer/main/subcategories.tpl
customer/main/subcategories_t.tpl

But if I added the code to either of these then it would show up on every subcategory page. So I assume I need to use if and else etc but im ok at click and paste and editing files but not at coding :-) so if anyone could advise it would be great..... this is an example of the code for the featured product manager that I want to add to specific subcategory pages:

{include file="customer/fts_featured_products.tpl" group="group_name"}

balinor 11-12-2010 05:29 AM

Re: which file to edit ?
 
Try:

{if $cat eq "x"}code to show{/if}

Replace x with the category id number. Haven't tested this with 4.4, but if that doesn't work we can try another smarty variable.

nivag 11-12-2010 05:54 AM

Re: which file to edit ?
 
yay that works perfectly... thanks so much Balinor :-)

sabinudash 01-04-2013 06:08 AM

Re: which file to edit ?
 
Quote:

Originally Posted by balinor
Try:

{if $cat eq "x"}code to show{/if}

Replace x with the category id number. Haven't tested this with 4.4, but if that doesn't work we can try another smarty variable.


This works on 4.4.2. Thanks balinor.

How can I have this work for both a category and its subcategories? Now, this code shows featured products for a "x" category, but not the subcategories of "x".

I appreciate any help.

cherie 01-04-2013 01:40 PM

Re: which file to edit ?
 
You can try something like:

Code:

{if $cat eq X or $current_category.parent eq X}

sabinudash 01-05-2013 12:08 AM

Re: which file to edit ?
 
Quote:

Originally Posted by cherie
You can try something like:

Code:

{if $cat eq X or $current_category.parent eq X}


Thanks cherie. I tried as following. But it did not work.

{if $cat eq "x" or $current_category.parent eq "x"}
{include file='customer/fts_featured_products.tpl' group='groupname'}
{/if}

This shows featured products for x category but not for the subcategories of x. I appreciate any other suggestions.

Thank you.

sabinudash 01-05-2013 12:37 AM

Re: which file to edit ?
 
Quote:

Originally Posted by cherie
You can try something like:

Code:

{if $cat eq X or $current_category.parent eq X}


I used:
Quote:

{if $cat eq X or $current_category.parentid eq X}

and it worked fine. Thanks for the right direction.

Now, is there a way to call the same featured products if current product is from category "x"?

Many thanks.


All times are GMT -8. The time now is 12:02 PM.

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