Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Add sidebar to product pages

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 10-15-2014, 12:11 PM
 
Phil Richman Phil Richman is offline
 

Advanced Member
  
Join Date: May 2012
Posts: 94
 

Default 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.
__________________
Ver 5.2.6
Reply With Quote
  #2  
Old 10-15-2014, 12:32 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Add sidebar to product pages

Phil,

Look in:
XLite/View/Controller.php

Code:
protected static function getSidebarFirstHiddenTargets() { return array( 'cart', 'product', 'checkout', 'checkoutPayment', 'checkoutSuccess', ); }

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.
__________________
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.
Reply With Quote

The following 2 users thank totaltec for this useful post:
Phil Richman (10-15-2014), qualiteam (10-15-2014)
  #3  
Old 10-15-2014, 12:40 PM
 
Phil Richman Phil Richman is offline
 

Advanced Member
  
Join Date: May 2012
Posts: 94
 

Default Re: Add sidebar to product pages

Thanks again Mike you're the man. That worked.
__________________
Ver 5.2.6
Reply With Quote

The following user thanks Phil Richman for this useful post:
totaltec (10-15-2014)
  #4  
Old 03-05-2015, 08:15 AM
  DesignByKiltz's Avatar 
DesignByKiltz DesignByKiltz is offline
 

Newbie
  
Join Date: Feb 2015
Posts: 8
 

Default 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?
__________________
~ Christy and/or Amy
Design by Kiltz Internet Solutions
x-cart 5.1.11
Reply With Quote
  #5  
Old 03-08-2015, 05:33 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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 namespace XLite\DevID\ModuleName\View; /** * Controller main widget */ class Controller extends \XLite\View\Controller implements \XLite\Base\IDecorator { /** * Define the pages where first sidebar will be hidden. * By default we hide it on: * product page, * cart page, * checkout page * checkout success (invoice) page * payment page * * @return array */ protected static function getSidebarFirstHiddenTargets() { return array( 'cart', /*'product', Commented out to allow sidebar on product page */ 'checkout', 'checkoutPayment', 'checkoutSuccess', ); } }
__________________
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.
Reply With Quote

The following user thanks totaltec for this useful post:
DesignByKiltz (03-09-2015)
  #6  
Old 03-09-2015, 10:46 AM
 
xgarb xgarb is offline
 

eXpert
  
Join Date: Jul 2004
Location: UK
Posts: 263
 

Default Re: Add sidebar to product pages

in v5.2 the method getSidebarFirstHiddenTargets() is in classes/XLite/Core
__________________
Core version: 5.5.xx
Reply With Quote

The following user thanks xgarb for this useful post:
tony_sologubov (03-10-2015)
  #7  
Old 03-14-2015, 02:27 PM
 
alarmsellout alarmsellout is offline
 

Member
  
Join Date: May 2009
Posts: 21
 

Default 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
Reply With Quote
  #8  
Old 03-15-2015, 05:22 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Add sidebar to product pages

Quote:
Originally Posted by alarmsellout
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
Hopefully you are working in your own custom module and not changing core files. Don't change core files!

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.
__________________
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.
Reply With Quote
  #9  
Old 03-15-2015, 09:35 AM
 
alarmsellout alarmsellout is offline
 

Member
  
Join Date: May 2009
Posts: 21
 

Default 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.
Reply With Quote

The following user thanks alarmsellout for this useful post:
totaltec (03-15-2015)
  #10  
Old 03-15-2015, 09:40 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:18 AM.

   

 
X-Cart forums © 2001-2020