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

All Products on front page, similar to featured products

 
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (X-Cart 5)
 
Thread Tools Search this Thread
  #11  
Old 07-14-2014, 05:52 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: All Products on front page, similar to featured products

1) Shall we remove current Featured Products section from front-end or we should simply populate it with the products you need?
2) How these products should be sorted in new section?
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #12  
Old 07-14-2014, 06:35 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: All Products on front page, similar to featured products

1. Yes.
2. By product name, as its the name of the puppy.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #13  
Old 07-16-2014, 12:12 PM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: All Products on front page, similar to featured products

Sorry, I did not quite get the answer to the first question. Would you prefer option 1 (remove current featured products section) or option 2 (populate it with all products)?

Anyway, I will prepare code samples during next week and will post them here.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #14  
Old 07-19-2014, 10:10 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: All Products on front page, similar to featured products

Apologies,

I see what you're asking now. I do not need the Featured Products Section at all, I only want the front page to be populate with all products and sorted by product name.

I really appreciate your help.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #15  
Old 07-21-2014, 04:45 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: All Products on front page, similar to featured products

Ok, thank you. I will post code samples within couple of weeks.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #16  
Old 07-21-2014, 06:09 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: All Products on front page, similar to featured products

As I'm sure you're busy with other projects, I'm willing to pay for this to happen much sooner.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #17  
Old 07-23-2014, 06:22 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: All Products on front page, similar to featured products

Oh, that is a good option as well
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #18  
Old 07-30-2014, 06:21 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: All Products on front page, similar to featured products

Hi Michael!

So, here is the instruction how to do this mod:
1) Create an empty module according to http://kb.x-cart.com/display/XDD/How+to+create+a+module

Do not forget to adjust your namespace.

2) In your module add the View/Custom/ProductsOnHome.php file with the following content:

PHP Code:
<?php

namespace XLite\Module\XC\CustomSkin\View\Customer;

/**
 *
 * @ListChild (list="center.bottom", zone="customer", weight="300")
 */

class ProductsOnHome extends \XLite\View\ItemsList\Product\Customer\Category\ACategory
{
    protected 
$allProducts null;

    protected function 
getHead()
    {
        
'My products';
    }

// this method defines that you do not need pagination
    
protected function getPagerClass()
    {
        return 
'\XLite\View\Pager\Infinity';
    }

// this method defines that all products must be displayed in this section
    
protected function getData(\XLite\Core\CommonCell $cnd$countOnly false)
    {
        if (!isset(
$this->allProducts)) {
            
$this->allProducts = \XLite\Core\Database::getRepo('XLite\Model\Product')->findAll();
        }

        return 
true == $countOnly
            
count($this->allProducts)
            : 
$this->allProducts;
    }

// disabling ability to sort products and switch between display modes
    
protected function defineWidgetParams()
    {
        
parent::defineWidgetParams();

        
$this->widgetParams[self::PARAM_GRID_COLUMNS]->setValue(3);

        unset(
$this->widgetParams[self::PARAM_SHOW_DISPLAY_MODE_SELECTOR]);
        unset(
$this->widgetParams[self::PARAM_SHOW_SORT_BY_SELECTOR]);
    }
}

Again, do not forget to adjust your namespaces.

3) Rebuild the cache and you will see the needed results.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #19  
Old 07-30-2014, 10:23 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: All Products on front page, similar to featured products

This one won't enable either.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #20  
Old 08-01-2014, 01:59 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: All Products on front page, similar to featured products

Please make sure that you have Main.php file in your module, not main.php that starts with small letter.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (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 10:52 PM.

   

 
X-Cart forums © 2001-2020