1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Featured products on home page (0.82)
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 532 Views |
-
Featured products on home page (0.82)

7 September 2011 at 3:12pm
ecommerce module 0.82 has featured products as a feature (no pun intended).
I can get the FeaturedProducts to work (<% If FeaturedProducts %>) but how do I get these products to appear when the parent page doesn’t have the products as children, e.g., the Home page would be a great place to display the featured products but I don’t want the Products as children of the Home page.
I think it is just a simple logic problem but I can’t get my head around it.
Graeme McKinstry
-
Re: Featured products on home page (0.82)

23 September 2011 at 7:41pm
Hi
The best way to do this is:
1. Create a new page type for your home page e.g. HomePage
2. In the controller of the HomePage page type add a new function to get the featured products. This function won't rely on a relationship with itself to query the for the featured products rather it will just select the products that have been flagged as featured.e.g.
function getFeaturedProducts(){
return DataObject::get("Product","FeaturedProduct = 1", "", "");
}
| 532 Views | ||
|
Page:
1
|
Go to Top |


