Jump to content

Showing certain products on homepage


Recommended Posts

you can duplicate homefeatured module and change  one line:

$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);

instead of Context::getContext()->shop->getCategory() use category id you want to display

for example, you can create hidden category, attach your product there then

 

voila ;)

  • Like 1
Link to comment
Share on other sites

no no, instead of whole code: Context::getContext()->shop->getCategory() use just category ID number

something like:

$category = new Category(125, (int)Context::getContext()->language->id);

where 125 is a category ID number

 

 

Ace worked a charm, since installing the second module though, now all the items on the homepage are aligned to the left?

Link to comment
Share on other sites

I was going to suggest

 

you can duplicate homefeatured module and change  one line:

$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);

instead of Context::getContext()->shop->getCategory() use category id you want to display

for example, you can create hidden category, attach your product there then

 

voila ;)

 

I was going to suggest that but I was worried it might confuse. There are few things to note though and if you are a programmer you can look into that :

 

* The class names, try to keep them separate.

*  Line 65 and Line 82 has this configuration value : HOME_FEATURED_NBR. This stores the no of products to be displayed. You might want to use some other name so that it doesn't conflict with the home featured module. Like HOME_CATEGORIES_NBR.


Ace worked a charm, since installing the second module though, now all the items on the homepage are aligned to the left?

 

Do you have a URL so that I can take a look and suggest you what it is ?

Link to comment
Share on other sites

I changed the CSS to have a 2 on the end of each #featured-products_block_center so that it is #featured-products_block_center2

 

This has partly fixed the issue, just now only the new module has everything off to the left and oddly shows 'view' in blue text, which was not there previously.  I am guessing its getting confused with CSS being repeated?  Which is odd, but easily fixable.. just trying to figure out which bit needs to change..

 

Oh also for some reason the first line of products now have no price, while the second line do but its lower down and in red?

Edited by omgzhobbs (see edit history)
Link to comment
Share on other sites

Removing View has brought back the first line of prices, however the prices are still red and the spacing of each product is all out.. cant figure out what could be doing this, just im guessing both modules being there are confusing the css/html in loading..

Link to comment
Share on other sites

×
×
  • Create New...