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

Show menu based on category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-24-2009, 01:30 AM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Show menu based on category

How can I check if someone has selected a certain category or subcategory in a category? What I'm trying to do is basically make two different main category homepages. One for 'Product 1' and another for 'Product 2'.

If user clicks on the main category menu on the actual store welcome page for 'Product 1' then I dont want to show the main menu anymore I just want to show some menus that are relavant to this category instead. Same for 'Product 2'.

Is this possible? Anyone have a module?
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #2  
Old 06-24-2009, 06:34 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Show menu based on category

copy customer/home.tpl to customer/home2.tpl

change your customer/home.tpl:
Code:
{if $main eq "catalog" && $current_category.categoryid eq "Custom_category_id"} {include file="customer/home2.tpl"} {else} ....Your current home.tpl content {/if}
and edit home2.tpl
It will be displayed only for one custom category.
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #3  
Old 06-24-2009, 11:06 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Show menu based on category

Victor thanks - how can I limit a number of subcategories to be displayed under the main category for a menu? Say for instance I'm using what you provided me above for category_id = 1. How can I limit number of subcategories to '5' and if possible make them random? I know php, but smarty is kickin my a$$. Thanks
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #4  
Old 06-24-2009, 11:23 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Show menu based on category

Also how can I make sure that this new homepage appears for all subcategories under this main category?
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #5  
Old 06-25-2009, 12:26 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Show menu based on category

Can you describe the result you want to achieve as I don't catch it
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #6  
Old 06-25-2009, 12:41 AM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Show menu based on category

What I'm trying to do is have a totally seperate area for a category and this area will be shown for all subcategories under this. Basically like another homepage for a cetain product with different menus and search options that relate to this category. Is this possible? THX Victor for your assistance.
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #7  
Old 07-01-2009, 07:10 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Show menu based on category

add in your include/categories.php

right before the lines
Code:
# # Gather the array of categories and extract into separated arrays: # $all_categories, $categories and $subcategories #

this code:
Code:
/*custom home.tpl mod*/ $_r_cat = 103; //this category and its offsprings will have custom home.tpl $_path = explode('/', $current_category['categoryid_path']); if (in_array($_r_cat, $_path)){ $smarty->assign("area2", "true"); } /*custom home.tpl mod ends*/


your customer/home.tpl should be like this:
Code:
{if $area2 ne ''} {include file="customer/home2.tpl"} {else} ....Your current home.tpl content {/if}
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #8  
Old 07-02-2009, 07:23 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Show menu based on category

Victor thank you. When your using clean urls the (cat) number doesnt get passed at least that you can see. How can I pickup the category number when using clean urls for the categories to know which category id im in?

Thanks
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #9  
Old 07-13-2009, 01:11 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Show menu based on category

Do you need to know current category id in templates or in php script?
For templates it is
Code:
{$current_category.categoryid}
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #10  
Old 09-06-2009, 02:58 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Show menu based on category

Ok issue im having. Is I added everything you said Victor. But what I want is right now Im showing a new menu that lists all subcategories for main category "DVDs" but once you click on one of those subcategories in the new menu all the subcategories disappear in this menu. How can I make these subcategories remain throughout this specific main category "DVDs" and subcategories? I just want a static menu for this section that shows all the subcategories all the time if they are in the main category "DVDs" section. I hopt his makes sense.
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
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:38 AM.

   

 
X-Cart forums © 2001-2020