| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
X-Cart 5 Remove Categories from Homepage body | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
X-Cart 5 Remove Categories from Homepage body
I was trying to remove the icons for the categories on the body of the homepage. Any assistance would be greatly appreciated.
__________________
5.0.11 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: X-Cart 5 Remove Categories from Homepae body
Hi!
Thanks for asking! First thing to try is to apply the following CSS code via the System Settings > Look & feel > Custom CSS section in your admin area: Code:
Please, let me know if it works for you. Note: this approach will hide the subcategories from all the pages, not from home page only. |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: X-Cart 5 Remove Categories from Homepae body
I also want to know how to remove the categories from the bottom of the front page. Tony, your fix works but it also removed the sub-categories from the categories page. So when you click on a category you are taken to the page but it then does not show the sub-categories list. Any idea how to just remove them from the bottom of the main page? I have lots so it look bad on the main page.
Thank you.
__________________
Luis Villamonte Computer Systems Engineer Microsoft and CompTIA Certified www.MagicKits.com X-cart 5.0.12 |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: X-Cart 5 Remove Categories from Homepae body
Hi Luis!
In this case, you need to create a simple mod. Create the module according to the article here: http://kb.x-cart.com/display/XDD/How+to+create+a+module and then add an additional class to your module: <Module-root>/View/Subcategories.php This class will decorate the \XLite\View\Subcategories class and it will re-define the getAllowedTargets() {} method. It should return array('category'), not array('category', 'main'). Please, let me know if it makes sense to you. If it is over-complicated, I will try to explain it in more details. |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: X-Cart 5 Remove Categories from Homepae body
Thank you for reply. I am confused. Should I create a file called main.php and add all the text from the "sample" except use the correct names for XLite\Module\Tony\Example; (XLite\Module\myMode\myname)? Then add "<Module-root>/View/Subcategories.php" to the bottom of the Mod?
Sorry, I guess I'll need a more detailed explanation.
__________________
Luis Villamonte Computer Systems Engineer Microsoft and CompTIA Certified www.MagicKits.com X-cart 5.0.12 |
|||||||||
#6
|
|||||||||
|
|||||||||
Re: X-Cart 5 Remove Categories from Homepae body
OK, let's start with one simple thing. Create the module according to the article above, but with your own Developer and Module IDs.
Once you are done, please let me know your Developer and Module IDs and I will suggest you about next step. |
|||||||||
#7
|
|||||||||
|
|||||||||
Re: X-Cart 5 Remove Categories from Homepae body
Ok, I've created a Mod and enable it on my site (to test) and it works (no errors anyway). I'm not sure that it does anything. The identifiers are "Lou" and "Catsub"
This is the code I used and named "Main.php". Thanks you. <?php // vim: set ts=4 sw=4 sts=4 et: namespace XLite\Module\Lou\Catsub; /** * Module description * * @package XLite */ abstract class Main extends \XLite\Module\AModule { /** * Author name * * @return string */ public static function getAuthorName() { return 'Lou'; } /** * Module name * * @return string */ public static function getModuleName() { return 'Catsub'; } /** * Get module major version * * @return string */ public static function getMajorVersion() { return '5.0'; } /** * Module version * * @return string */ public static function getMinorVersion() { return 0; } /** * Module description * * @return string */ public static function getDescription() { return 'This Mod will show Categories on pages but not front'; } }
__________________
Luis Villamonte Computer Systems Engineer Microsoft and CompTIA Certified www.MagicKits.com X-cart 5.0.12 |
|||||||||
#8
|
|||||||||
|
|||||||||
Re: X-Cart 5 Remove Categories from Homepae body
That is good that you created the module. Indeed, it does not do anything at this point.
Next thing to do is to create the XLite/Module/Lou/Catsub/View/Subcategories.php file with the following content: PHP Code:
and it should do the trick. I will explain what this code does: you are taking default viewer XLite\View\Subcategories and decorate (change) it that it should be displayed only upon calling cart.php?target=category , so it would not work upon calling cart.php?target=main as it works by default. Please, try this code and let me know whether it works for you. Tony. |
|||||||||
#9
|
|||||||||
|
|||||||||
Re: X-Cart 5 Remove Categories from Homepae body
Works perfectly! Thanks for your help.
__________________
Luis Villamonte Computer Systems Engineer Microsoft and CompTIA Certified www.MagicKits.com X-cart 5.0.12 |
|||||||||
|
#10
|
|||||||||
|
|||||||||
Re: X-Cart 5 Remove Categories from Homepae body
Happy to hear that!
|
|||||||||
|
|||
X-Cart forums © 2001-2020
|