1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Is it possible to have temporary per-product discounts?
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: | 358 Views |
-
Is it possible to have temporary per-product discounts?

10 September 2012 at 1:13pm
Does the e-commerce module (version 0.9, I haven't had time to upgrade to 1.0 yet) have the ability to set temporary discounts for a product? I'm thinking along the lines of the usual <<insert holiday>> specials in which the original price is quoted but crossed out, and the special price is shown. The product template does include this feature, but I haven't seen any method to set a discounted price on a per-product basis.
If this feature isn't available yet, what would be the best method of adding it? I'm not particularly familiar with the e-commerce module's APIs for adding custom behaviour.
Hans
-
Re: Is it possible to have temporary per-product discounts?

14 September 2012 at 11:38am
A simple way would be to decorate the Product class, and ProductVariation if using them. I added a SalePrice and OnSale Boolean then
function updateCalculatedPrice( $price ) {
return ($this->owner->OnSale ? $this->owner->SalePrice : null);
}
You could also add Start/End dates for the sale.
However, this requires setting each product's price manually.For a more advanced approach, you would likely have to create your own completely separate ProductDiscount class that allows you to employ more advanced rules and perhaps the ability to apply the same rule to multiple products. Then parse those rules in updateCalculatedPrice.
-
Re: Is it possible to have temporary per-product discounts?

14 September 2012 at 12:12pm
You might also check out https://github.com/sunnysideup/silverstripe-ecommerce_complex_pricing
-
Re: Is it possible to have temporary per-product discounts?

15 September 2012 at 9:04am
@AlphaCactus
Thanks. That's easier than I thought.
The complex pricing documentation is a bit vague, but it might do almost everything that I want. The one thing that's missing is being able to display a name for the special and the deadline on the product page (e.g., "<<event>> sale ends <<date>>").
Hans
| 358 Views | ||
|
Page:
1
|
Go to Top |


