Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

SS-Shop: how display products with zero price - solved


Go to End


2 Posts   2382 Views

Avatar
suoko

Community Member, 4 Posts

11 May 2014 at 9:10am

Edited: 11/05/2014 9:55am

In shop/code/product/ProductCategory.php

if (self::config()->must_have_price){
			$products =  $products->filter("BasePrice:GreaterThan", 0);
		}

changed to

if (self::config()->must_have_price){
			$products =  $products->filter("BasePrice:GreaterThan", -1);
		}

Avatar
Jedateach

Forum Moderator, 238 Posts

7 October 2014 at 9:03am

Edited: 07/10/2014 9:03am

Hey Suko,
just wondering why you didn't instead set your yaml configuration as such?:

ProductCategory:
         must_have_price: false