X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   4 product column on main page. how? (https://forum.x-cart.com/showthread.php?t=70156)

dagdag 10-04-2014 11:46 PM

4 product column on main page. how?
 
I disable TopCategories (in CustomSkin\View, function isVisible() return false) and get a blank column on the left.

Рlease tell me, how do I remove from anywhere conclusion of this empty space, and the products on the main page to display in four columns, the entire width of the template?

Thank you very much in advance.

dagdag 10-05-2014 05:43 AM

Re: 4 product column on main page. how?
 
PhilJ, if the answer to my question is in the FAQ - please give a link to it.

JannieB 10-05-2014 08:06 AM

Re: 4 product column on main page. how?
 
The only way I got this to work was by setting the max number of columns from 3 to 4.

I did this by adding a class in my custom module like this:

Code:

abstract class GridColumns extends \XLite\View\ItemsList\Product\Customer\Category\ACustomer implements \XLite\Base\IDecorator
{
    const GRID_COLUMNS_MAX = 4;

 protected function defineWidgetParams()
    {
        parent::defineWidgetParams();

                $this->widgetParams[static::PARAM_GRID_COLUMNS] = new \XLite\Model\WidgetParam\Set('Number of columns (for Grid mode only)', 4, true, $this->getGridColumnsRange());
                               
 
    }
 
}


However this will affect all pages (which is what I wanted), not just the home page.

Jan

totaltec 10-05-2014 05:49 PM

Re: 4 product column on main page. how?
 
The best way to ditch the side column in X-cart 5 is to create a controller class that decorates XLite\View\Controller and redefines the getSidebarFirstHiddenTargets() method.

Here is an example from my new Magnifico theme:
Code:

namespace XLite\Module\Guru\Magnifico\View;

/**
 * Controller main widget
 *
 */
class Controller extends \XLite\View\Controller implements \XLite\Base\IDecorator
{
    /**
    * Define the pages where first sidebar will be hidden.
    *
    * @return array
    */
    protected static function getSidebarFirstHiddenTargets()
    { 
        $hiddenTargets = [];

        $hiddenTargets[] = 'main';
       
        return array_merge(
            parent::getSidebarFirstHiddenTargets(),
            $hiddenTargets
        );
    }
}


This will remove the sidebar from the target "main" (home page) only.

dagdag 10-09-2014 10:01 PM

Re: 4 product column on main page. how?
 
Thanks (((

I removed X-Cart. It's too complicated for me. What other products made ​​by simply changing the settings, in the X-Cart programming required on a whim, since there is no documentation.

To be honest, it's easier to write from scratch online store, than to understand the X-Cart.

cflsystems 10-09-2014 10:24 PM

Re: 4 product column on main page. how?
 
You should take a look at XC4 - a lot more easier to work with and tons of modules and help on the forums - https://www.x-cart.com/pricing.html

cherie 10-18-2014 04:52 PM

Re: 4 product column on main page. how?
 
Quote:

Originally Posted by cflsystems
XC4 ... a lot more easier to work with

Ouch! So much for the new version.

minfinger 10-19-2014 07:42 AM

Re: 4 product column on main page. how?
 
I'd like it to just affect the Category List, any suggestions?

totaltec 10-19-2014 06:57 PM

Re: 4 product column on main page. how?
 
Quote:

Originally Posted by minfinger
I'd like it to just affect the Category List, any suggestions?

Try using my example above, I believe the target you want is simply "category".


All times are GMT -8. The time now is 12:37 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.