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

Move caterogy description under products

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #11  
Old 11-23-2015, 03:14 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Move caterogy description under products

Actually, the changes should not be implemented to the core X-Cart files like the Main.php file. The code should be implemented within a custom module's Main.php file.
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #12  
Old 11-23-2015, 03:57 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: Move caterogy description under products

For example, you can use "Custom Skin" module to implement the necessary code changes related to widgets. For example, in our case, the PHP code suggested by Ant, should be implemented in classes/XLite/Module/XC/CustomSkin/Main.php file.
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #13  
Old 11-23-2015, 08:28 AM
 
ant99 ant99 is offline
 

Advanced Member
  
Join Date: Mar 2015
Posts: 39
 

Default Re: Move caterogy description under products

That's correct. I stated "the Main.php file of your module". Sorry I was not specific enough, but thanks for clarifying seyfin.
__________________
Ant

XC v5.3.1.8
Horizontal Flyout Categories Menu Module
CloudSearch / CloudFilters

XC v4.7.6
CloudSearch
Reply With Quote
  #14  
Old 11-23-2015, 01:44 PM
 
ant99 ant99 is offline
 

Advanced Member
  
Join Date: Mar 2015
Posts: 39
 

Default Re: Move caterogy description under products

It turns out there was a bug that I didn't catch in that first implementation. It will break static pages that do not have a category description, because it tries to call "getDescription()" from the list "center.bottom".

Here is the correct implementation.

First you need to create "Category.php" in your custom module directory (i.e. - XLite/Module/XC/CustomSkin/View/Category.php) and define the ListChild to insert the widget in center.bottom. Notice the weight of 800. This is so that the description appears at the very bottom of the category pages (beneath featured products if there are any).
PHP Code:
<?php
namespace XLite\Module\XC\CustomSkin\View

/**
 * Category widget
 *
 * @ListChild (list="center.bottom", zone="customer", weight="800")
 */
abstract class Category extends \XLite\View\Category implements \XLite\Base\IDecorator
{

}

Then we have a problem that the category description is still appearing at the top in addition to appearing at the bottom. We need to remove the class from the "center" list. In your custom module's Main.php file (i.e. - XLite/Module/XC/CustomSkin/Main.php) add the following code.
PHP Code:
public static function runBuildCacheHandler(){

        
parent::runBuildCacheHandler();

    
// remove category description from the top of each category
    
\XLite\Core\Layout::getInstance()->removeClassFromList(
        
'XLite\View\Category''center', \XLite\Model\ViewList::INTERFACE_CUSTOMER
    
);

    } 
__________________
Ant

XC v5.3.1.8
Horizontal Flyout Categories Menu Module
CloudSearch / CloudFilters

XC v4.7.6
CloudSearch
Reply With Quote

The following 2 users thank ant99 for this useful post:
dagdag (07-28-2016), qualiteam (11-24-2015)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



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 03:44 AM.

   

 
X-Cart forums © 2001-2020