Add sidebar to product pages
I'm wanting to add the sidebar to the product pages like it is on the home page and category pages.
|
Re: Add sidebar to product pages
Phil,
Look in: XLite/View/Controller.php Code:
protected static function getSidebarFirstHiddenTargets() I would try extending/decorating this class, then redefining this method. Leave out the line for 'product'. If that works, you might still have some CSS playing to do. |
Re: Add sidebar to product pages
Thanks again Mike you're the man. That worked.
|
Re: Add sidebar to product pages
Can you change the controller.php file in a custom skin/module? If so, where do you put your version of the file?
|
Re: Add sidebar to product pages
Your version of the file should go in the same place that it did in the default structure.
So if the original file is XLite\View\Controller and you want to decorate this class, and your module is in classes\XLite\DevID\ModuleName Then your file would go in classes\XLite\DevID\ModuleName\View\Controller.php and it would contain the following: Code:
<?php |
Re: Add sidebar to product pages
in v5.2 the method getSidebarFirstHiddenTargets() is in classes/XLite/Core
|
Re: Add sidebar to product pages
I changed the controller.php file as this forum shows, but the sidebar isn't showing up on my product page. Do I have to reset the cache or something? How do I do that?
XCart 5.1.11 |
Re: Add sidebar to product pages
Quote:
To answer your question, yes you need to rebuild the cache/redeploy the store. You will see the option in the admin menu. If working on a live store, you first make a full backup. You need to backup the database and the files. |
Re: Add sidebar to product pages
Yes, I did change the core file... I just re-built the store and it took effect. However, it didn't do quite what I was hopping for so I changed it back. Why shouldn't the core file be changed? Upgrade problems later or...?
I've always changed the core files in xCart 4... but never upgraded it so maybe it didn't matter because of that.. not sure? The main problem I have found with X-Cart is upgrading after any custom work is completed. I was hoping that problem would be fixed in version 5... I may be going about this incorrectly. I'm not using a live store right now.. just a test store until I can get it setup correctly. Then I'll switch it to the live server. |
Re: Add sidebar to product pages
XC5 pushes upgrades live and overwrites files without even telling you. So if you modify core files directly next upgrade will overwrite them with newer files (if applicable) and your changes will be lost.
You have to write your own module(s) to make any changes to XC5. |
All times are GMT -8. The time now is 09:30 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.