View Single Post
  #40  
Old 08-18-2014, 05:50 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

Sorry for too technical explanation.

Let me try to explain it in simpler way.
1) In your module you need to create Model/Repo/Product.php with the content as provided here:
http://kb.x-cart.com/display/XDD/Searching+entities+in+repositories#Searchingentiti esinrepositories-Pull...mplexcondition

Make sure that you specify right namespace though!

2) In the View/Custom/ProductsOnHomePage.php file you should replace the following line:

PHP Code:
$this->allProducts = \XLite\Core\Database::getRepo('XLite\Model\Product')->findAll(); 

with the next one:

PHP Code:
$this->allProducts = \XLite\Core\Database::getRepo('XLite\Model\Product')->findAllActive(); 

3) Rebuild the cache.

It should do the trick.

Tony.

Quote:
Originally Posted by minfinger
Tony,

I'm sorry I don't get this. What you wrote on that page, to me, doesn't even vaguely come close to what I've already gotten. I don't understand what needs to go where.

I'm at the end of my rope because none of the old developers I worked with don't even want to to touch XC5 because of well, many reasons.
__________________
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