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

which file to edit ?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-12-2010, 01:14 AM
 
nivag nivag is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 76
 

Default 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
Reply With Quote
  #2  
Old 11-12-2010, 04:15 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote

The following user thanks balinor for this useful post:
nivag (11-12-2010)
  #3  
Old 11-12-2010, 05:27 AM
 
nivag nivag is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 76
 

Default 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"}
Reply With Quote
  #4  
Old 11-12-2010, 05:29 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote

The following user thanks balinor for this useful post:
nivag (11-12-2010)
  #5  
Old 11-12-2010, 05:54 AM
 
nivag nivag is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 76
 

Default Re: which file to edit ?

yay that works perfectly... thanks so much Balinor
Reply With Quote
  #6  
Old 01-04-2013, 06:08 AM
 
sabinudash sabinudash is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 66
 

Default 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.
__________________
X-Cart 5.3.3.4 Multivendor
X-Cart 5.3.3.4 Business (Testing)
Reply With Quote
  #7  
Old 01-04-2013, 01:40 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: which file to edit ?

You can try something like:

Code:
{if $cat eq X or $current_category.parent eq X}
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #8  
Old 01-05-2013, 12:08 AM
 
sabinudash sabinudash is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 66
 

Default 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.
__________________
X-Cart 5.3.3.4 Multivendor
X-Cart 5.3.3.4 Business (Testing)
Reply With Quote
  #9  
Old 01-05-2013, 12:37 AM
 
sabinudash sabinudash is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 66
 

Default 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.
__________________
X-Cart 5.3.3.4 Multivendor
X-Cart 5.3.3.4 Business (Testing)
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 06:01 PM.

   

 
X-Cart forums © 2001-2020