| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Subcategory Mods on 4.2.0 | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Subcategory Mods on 4.2.0
I've been struggling to find much info on here for modifying the categories menu to display subcategories on xcart 4.2.0.
I had 3 different requests. The first was probably the most common, which was that the client wanted the subcategories to appear as you clicked each category and to remain whilst they looked at products. The Second was to display the categories and subcategories all the time The Thirs was to display the categories and subcategories all the time but not be able to click on the categories (in effect they are just headings) To do this I used some code from on here for older versions and made some code up. For any of these you first need to let the pages have access to the subcategories. This is done by editing the file "include/categories.php" look for the following line: Code:
and just before it add the following block of code: Code:
Once that has been added you just need to alter the customer/categories.tpl template file to tell it to use the new variable. For the first method I wrote the following code: Code:
For the second method I instead used the following code: Code:
And the third method was very similar to the second method and used the following code: Code:
Hopefully that will help someone else on version 4.2. I've not extensively tested it yet but it seemed to work fine. I only needed to use it with one level of subcategories so I've no idea if it will work with multiple levels. - I doubt it though! I made a style up which I put at the end of the main.css file - you can make your own up but here is mine: Code:
*update* I just tried adding a third level category ( a sub-subcategory ) and as I expected it won't show on the menu but will operate fine but the third level will show in the middle like the basic x-cart way does.
__________________
Xcart Pro Version 4.1.2 |
|||||||
|
#2
|
|||||||
|
|||||||
Re: Subcategory Mods on 4.2.0
thank you sir - excellent
__________________
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) |
|||||||
#3
|
|||||||||
|
|||||||||
Re: Subcategory Mods on 4.2.0
I decided try 4.2 for my newest store, drop ship only, with about 2600 products in many subcategories, but only 2 main categories.
The difference I see in the default menu system for 4.2 was not expected, as I've been using a modified menu and forgot what the original was like. The default menu 4.2 menu system will not work well with my new store. I'm not as talented as artmat in coding, so I was considering going back to 4.1.x for the new store. Now I'll experiment with his code and see what it does for 4.2. I might consider Fancy Categories, but my prior experience with that is that is it not suitable for large stores due to speed issues. I previously tried it with 4.0.x stores, and gave up. Can anyone verify if Fancy Cats still has speed issues when dealing with large stores, and with 4.2 in particular? Also, I see new FREE skins are now posted for 4.2. See them at http://xcart-demo.qualiteam.biz/demo/home.php I appreciate the work you've done. Thanks for sharing!
__________________
Bullfrog ~~~ X-Cart Gold v4.7.2 (2) v4.7.8. ⌠If the road is easy, you're likely going the wrong way.■ ― Terry Goodkind |
|||||||||
#4
|
|||||||
|
|||||||
Re: Subcategory Mods on 4.2.0
ok question:
1) Dont you still want to show the subcategories in <li> form? 2) How can I do this and be able to have the subcategories basically indented from the main categories in <li> form? I would appreciate any help on this.
__________________
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) |
|||||||
#5
|
|||||||||
|
|||||||||
Re: Subcategory Mods on 4.2.0
I suppose HTML produced by the this variant of subcategories.tpl wouldn't pass validation
Code:
It's better try like this Code:
Code:
__________________
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 |
|||||||||
|
#6
|
|||||||
|
|||||||
Re: Subcategory Mods on 4.2.0
VICTOR - You da man... Thanks a million.
__________________
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) |
|||||||
#7
|
|||||||
|
|||||||
Re: Subcategory Mods on 4.2.0
Victor - I'm sorry... Is there anyway of showing me what to use for his second model? Please.. I would really appreciate it.
__________________
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) |
|||||||
#8
|
|||||||||
|
|||||||||
Re: Subcategory Mods on 4.2.0
just the same (wrap links with li elements of the specific class and define this elements style in css):
Code:
__________________
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 |
|||||||||
#9
|
|||||||
|
|||||||
Re: Subcategory Mods on 4.2.0
Thanks for the great work.
I tried to implement the changes but it won't show the sub-categories. I am not a strong programmer so pls forgive my ignorance. Do I need to put both a.subMenuItem{ display:block; margin-left:23px; text-decoration:none; } a.subMenuItem:hover{ text-decoration:underline; } and .menu-categories-list ul li.subcat{ /*Your extra styles for nested categories here*/ } In main.css, and if I do, what should be in place of /*Your extra styles for nested categories here*/ Are there any other settings that might prevent the subs showing up? Thanks
__________________
Gold 4.2.0 CDSEOPRO v.1.3.1 Advanced MiniCart ezUpsell One Page Checkout Drug Test Kits |
|||||||
#10
|
|||||||||
|
|||||||||
Re: Subcategory Mods on 4.2.0
Did you modify include/categories.php according to the very first post in this thread?
I slightly improved the output of this mod, but the main work is described here http://forum.x-cart.com/showpost.php?p=244930&postcount=1 Please read it carefully If you choose my variant of template you can either use following lines or omit them if you don't want you subcats have a custom lookout. .menu-categories-list ul li.subcat{ /*Your extra styles for nested categories here*/ } F.e. if you want your subcat links to be red you should use .menu-categories-list ul li.subcat{ color:#ff0000; }
__________________
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 |
|||||||||
|
|||
X-Cart forums © 2001-2020
|