Jump to content
  • 0

Displaying color options under product listing on home/category page


cvanavi

Question

Hi, 

I have products that have various colors.  I've set up the colors values under product attributes.  

How do I get these color options to display on the product list on the home/category pages and in quick view? Is this an add on module feature or is it included in the current system?  

Currently these color options only come up when you click to go into the product page itself.  

Thanks,

Christie

post-1279124-0-90808400-1467704966_thumb.jpg

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hi, 

 

I have products that have various colors.  I've set up the colors values under product attributes.  

 

How do I get these color options to display on the product list on the home/category pages and in quick view? Is this an add on module feature or is it included in the current system?  

 

Currently these color options only come up when you click to go into the product page itself.  

 

Thanks,

Christie

HI,

 

I have the same question as Christie - how can color button/color options (visual) can show up in the filters as well?

Thanks.

Link to comment
Share on other sites

  • 0

Ah, got it.

Do you mean to display to display colors under blocks such as New arrivals, Popular, Best sellers... on Homepage?

Just add 1 line of code into these modules and it works.

The modules are: blocknewproducts, homefeatured, blockbestsellers.

 

Here an example for blocknewproducts: (/modules/blocknewproducts/blocknewproducts.php):

	protected function getNewProducts()
	{
		if (!Configuration::get('NEW_PRODUCTS_NBR'))
			return;
		$newProducts = false;
		if (Configuration::get('PS_NB_DAYS_NEW_PRODUCT'))
			$newProducts = Product::getNewProducts((int) $this->context->language->id, 0, (int)Configuration::get('NEW_PRODUCTS_NBR'));

		if (!$newProducts && Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
			return;

                $this->context->controller->addColorsToProductList($newProducts);// ADD THIS
		return $newProducts;
	}

ef8d3378-5fb2-11e6-8c47-d94e2dade89f.png

Repeat the similar step for 2 other modules.

 

NOTICE: You can override rather than editing those files directly. 

Duno how to override a module?

Read more at:

http://build.prestashop.com/howtos/module/how-to-override-modules/

 

Hope that helps!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...