Adds Discount and Coupon support for SilverShop
PHP JavaScript Scheme
Latest commit ad662f3 Mar 14, 2017 @wilr wilr committed on GitHub Merge pull request #50 from pmhou/bugfix
Display correct discounts when viewing completed orders
Permalink
Failed to load latest commit information.
_config
code
docs/en
images
javascript
templates/email
tests
.editorconfig
.gitattributes
.scrutinizer.yml
.travis.yml
LICENSE
README.md
_config.php
composer.json
phpunit.xml.dist

README.md

SilverShop - Discounts

Latest Stable Version Latest Unstable Version Build Status Code Coverage Scrutinizer Quality Score Total Downloads

Allows creating discounts for products / orders.

  • Discount by various criteria, including:
  • Time
  • User group
  • Product/Category
  • Number of uses
  • Order value
  • Shipping zone
  • Coupon codes
  • Gift voucher products
  • Shipping discount

Discounts can be applied to individual products, cart subtotal, or shipping. Discounts can be globally enabled/disabled.

Requirements

  • Shop Module + its requirements

Installation Instructions

  • Install code to your SilverStripe root directory.

via composer:

	composer require burnbright/silverstripe-shop-discount dev-master

If you are using the stepped checkout, add the CheckoutStep_Discount checkout step:

CheckoutPage:
	steps:
		'contactdetails' : 'CheckoutStep_ContactDetails'
		'shippingaddress' : 'CheckoutStep_Address'
		'billingaddress' : 'CheckoutStep_Address'
		'shippingmethod' : 'CheckoutStep_ShippingMethod'
		'discount' : 'CheckoutStep_Discount' #here!
		'paymentmethod' : 'CheckoutStep_PaymentMethod'
		'summary' : 'CheckoutStep_Summary'

If you would like to display the coupon form seperately to the checkout form, apply the following extension. This will make CouponForm available in the checkout template:

CheckoutPage_Controller:
  extensions:
    - CouponFormCheckoutDecorator

Add the OrderDiscountModifier modifier to your order modifiers yaml config:

Order:
	modifiers:
		- Blah
		- OrderDiscountModifier #here!
		- Blah

Specific Pricing

Extend Product and/or ProductVariation with the SpecificPricingExtension to introduce a pricing table for each product. This allows admins to set prices according to things like, date, and membership group.

Configure as follows:

Product:
  extensions:
    - SpecificPricingExtension
ProductVariation:
  extensions:
    - SpecificPricingExtension

Upgrading

OrderCoupon has become a subclass of Discount, so if your existing database contains OrderCoupon, it might be best to rename it to Discount before running dev/build?flush=1.