| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Overriding a skin module with my DropDown Module | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Overriding a skin module with my DropDown Module
Hi all posting this here so I can understand and others can learn.
Here is a video explaining the problem, and it is outlined again below. http://youtu.be/ThJlxRRxQac The module needs to unset the default Category List, and replace it with the DropDown Menu. I have correctly assigned my template to the appropriate list using: Code:
I now need to unset the template default/en/categories/list/body.tpl called by class XLite\View\TopCategories I have tried using both: Code:
This is due to the class being reassigned to the list by the QSL/WatchWorld module/skin. In XLite\Module\QSL\WatchWorld\Main.php there is this code: Code:
I believe this code is overriding the removeClassFromLists function call in my class. It takes precedence I believe because QSL comes alphabetically after Baby. To overcome this, I tried decorating \XLite\View\TopCategories and adding this code: Code:
Are not relative to the TopCategories Class. So I overcame it by setting the getDir() function of my decorated TopCategories class to Code:
This feels wrong. I need to go about this in a better way. Perhaps I can use my decorated TopCategories class and just import the module functions from the DropDown class? Or should I redefine the functions in the TopCategories class? Or is there something else, that would override the QSL module and allow me to remove that class or template? How would I do this properly, can you provide a code example please?
__________________
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. |
|||||||||
#2
|
|||||||||
|
|||||||||
Re: Overriding a skin module with my DropDown Module
I would decorate the TopCategories class and make it display the drop-down list instead of the regular one.
Actually, it can render the drop-down menu already, but is missing necessary CSS files. So, what you need to make it drop down: 1. Decorate the TopCategories class in your module. 2. In the defineWindgetParams() methods, after executing the parent one, change the value of the static::PARAM_DISPLAY_MODE widget parameter to static:: DISPLAY_MODE_TREE. 3. Add necessary styles through the getCSSFiles() method.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions Last edited by qualiteam : 08-20-2014 at 09:08 PM. |
|||||||||
|
#3
|
|||||||
|
|||||||
Re: Overriding a skin module with my DropDown Module
Hi can you explain this a bit more fully ... I need to do a similar thing...
That is, I want to have a horizontal category menu in the header area, with the ability to show the subcategories in a drop-down type panel. I have tried using addClassToList in my custom skin main.php to add the topcategories class to the layout.header.bar list and have set up a category menu template there which was getting displayed OK ... but when I try and add code to display the categories I get an error. I am assuming I need to assign the data to the template in some way? I am also not sure how to get the subcategories available .... Have only been working on XC5 for a few days, so forgive my ignorance of the new architecture... but any help would be greatly appreciated! Jan Jan
__________________
Jan Beesley (Currently Xcart 5 Previously XCart Gold from 3.5....) |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Overriding a skin module with my DropDown Module
Hi Jan!
Thank you for the question. I will come to it next week, when I will be preparing an answer for Mike. Stay tuned! Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
#5
|
|||||||||
|
|||||||||
Re: Overriding a skin module with my DropDown Module
Hi Mike!
I am not sure whether qualiteam's solution works for you, although it is quite good, but if you want to get rid of TopCategories viewer at all, you can decorate it and redefine its isVisible() method, so it would return false. Once you do this, the categories block will go away. Method isVisible() exists in every single viewer, so it is pretty easy to get rid of any of them. If you need to decorate the class after certain module, you can use the approach described here: http://kb.x-cart.com/pages/viewpage.action?pageId=7504837#Webinar2-10Apr2014-DesignchangesinX-Cart5(Custom...thmyownme nu? Look at point 7 there. @Jan Again, please have a look at the real working example here: http://kb.x-cart.com/pages/viewpage.action?pageId=7504837#Webinar2-10Apr2014-DesignchangesinX-Cart5(Custom...thmyownme nu? If you still get an error after applying this solution, please send me what error you are getting. Again, guys, if there is any other question, just let me know. Tony.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
|||
X-Cart forums © 2001-2020
|