| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Find current subcategories siblings? | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Find current subcategories siblings?
Can someone point me in the right direction as to how to determine what the current subcategory's parent category is, so I can then get all the parent's subcategories?
Thanks!~
__________________
www.scraporchard.com X-Cart Pro Version 4.5.5 Altered Cart: One Page Checkout, OnSale, Buy Together, Download Expander, Smart Search, Shop by Filters Gahela: Gahela Support System The xCart Store: xBanners, xAccess, xMenus |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Find current subcategories siblings?
Look at the {$current_category} array. {$current_category.parentid} should contain the parent categoryid.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#3
|
|||||||
|
|||||||
Re: Find current subcategories siblings?
Thank you so much!
I was just coming back to post that I was able to locate the data I needed!
__________________
www.scraporchard.com X-Cart Pro Version 4.5.5 Altered Cart: One Page Checkout, OnSale, Buy Together, Download Expander, Smart Search, Shop by Filters Gahela: Gahela Support System The xCart Store: xBanners, xAccess, xMenus |
|||||||
#4
|
|||||||
|
|||||||
Re: Find current subcategories siblings?
Ummm.. ok. So I haven't been able to figure out how or if the subcategory siblings data exists already.. somewhere. I want to provide a select menu which contains all the sibling subcategories, but on the subcategory pages.. I am able to locate the data if I am on the parent category page.
Am I going to need to make my own function to get this data? If so, is there a tutorial or thread that explains the hierarchy (not sure this is the right word)? From looking through the php files, I see the functions are in the /include/func files (duh) and I understand the root level php files passes values into Smarty, which is then used in the .tpl files... is it alright to call a function from the root php files or do I need another level in there?
__________________
www.scraporchard.com X-Cart Pro Version 4.5.5 Altered Cart: One Page Checkout, OnSale, Buy Together, Download Expander, Smart Search, Shop by Filters Gahela: Gahela Support System The xCart Store: xBanners, xAccess, xMenus |
|||||||
#5
|
|||||||
|
|||||||
Re: Find current subcategories siblings?
I have made a little progress on this. But I am still not getting the data I need
I am not just familiar with how xCart works and how to store/access data. Any help would be greatly appreciated. And a very special thank you to cherie, for getting me this far. I did not want to keep bothering cherie, which is why I am posting in this thread. To recap, I need to build an array, something like this where parentid: PHP Code:
The I need to retrieve and loop the array data based on $current_category.parentid. What I current have, returns all the category names of all the subcategories but I can't figure out how to build the array correctly. include/common.php PHP Code:
skin/<theme>/customer/main/subcategories.tpl Code:
__________________
www.scraporchard.com X-Cart Pro Version 4.5.5 Altered Cart: One Page Checkout, OnSale, Buy Together, Download Expander, Smart Search, Shop by Filters Gahela: Gahela Support System The xCart Store: xBanners, xAccess, xMenus |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Find current subcategories siblings?
Why reinventing the wheel. If you are using the Flyout Menus module the categories array is already created. Just reuse it. I think it is called $categories_menu and subcategories for each category are under childs
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#7
|
|||||||
|
|||||||
Re: Find current subcategories siblings?
And if I am not, can I still tap into those functions?
__________________
www.scraporchard.com X-Cart Pro Version 4.5.5 Altered Cart: One Page Checkout, OnSale, Buy Together, Download Expander, Smart Search, Shop by Filters Gahela: Gahela Support System The xCart Store: xBanners, xAccess, xMenus |
|||||||
#8
|
|||||||||
|
|||||||||
Re: Find current subcategories siblings?
Quote:
Have you seen this webinar from Tony? http://kb.x-cart.com/pages/viewpage.action?pageId=7504837#Webinar2-10Apr2014-DesignchangesinX-Cart5(Custom...thmyownme nu? It should get you familiar with overriding things. Take a look at the attached file, it is my drop down menu module, rename the zip file to a tar, I just renamed it zip so I could upload.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
#9
|
|||||||||
|
|||||||||
Re: Find current subcategories siblings?
I believe this is for XC4 so the XC5 code won't work
If you are not using the Flyout Menus module you can still use its functions but you need to make your own calls to them to built the menu array
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
#10
|
|||||||
|
|||||||
Re: Find current subcategories siblings?
(1) Uncheck General Settings > Appearance > "Always show root categories in the category list"
(2) Use... Code:
--- (1) May affect your main category menu though... It looks like yours is a custom menu, so you might get away with it.
__________________
xcartmods.co.uk |
|||||||
|
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|