Add Additional Options to Checkout
|Assignee:||Pavan Rikhi||% Done:|
|Category:||Checkout||Spent time:||7.71 hours|
|Target version:||v0.6.0 - Checkout|
Coupon codes store credit priority S&H member number
Discount order by 5% if anything is entered into the field.
Add input & "Apply" to left side of "total" row on checkout page(maybe cart page too?). Only 1 allowed per-order, hide input when coupon is successfully applied. Coupon errors should show up in the row.
After applying, get latest cart details & show coupon discount in totals lines. This should have a "Remove" link so users can apply a different coupon instead.
Should probably save the coupon to the cart so they can leave & still have it applied. That means we have to handle automatically removing in-active coupons, or showing an error & clearing it manually when the cart is rendered.
Make the fee $5 + 5% of the order total on top of normal shipping cost.
Add as extra field to shipping methods, w/ specific fields for excluding products/categories from priority shipping. Ideally customers would be able to place an order w/ priority shipping w/ those excluded products if they had other products, & would only be charged for priority shipping for eligible products. Not sure how stoneedge would handle it though - maybe make a new issue to support this after v1.0.0 by creating 2 orders.
Need to exclude seasonal items & mushrooms.
[#1189] Add Store Credit to Checkout API Route
Add a storeCredit field to the Customer DB model & import store credit
data from ZenCart's Gift Certificates module in the Data Migration
Return a Customer's available store credit in the My Account & Checkout
Details Routes. In the Place Order API Route, allow Customers to apply
their store credit towards an Order.
- Add a StoreCreditLine value to the LineItemType datatype.
- Modify the Order Placed email to include any store credit that was
- Modify the chargeCustomer function so that it is no longer responsible
for deleting a Customer's Cart.
- Modify the createOrder function to also return the amount of store
credit that was applied to the Order.
[#1189] Add Store Credit Form to Checkout Process
Add an input field for applying store credit to an order during the
checkout process if the Customer has store credit available.
Display a Customer's available store credit on their My Account page.
Add any applied store credit to order summaries & total calculations.
Add a Format.centsNumber function to format cents as dollars like the
Format.cents function, but without the leading dollar sign.
[#1189] Add Member Discounts to Checkout API Routes
Modify the authorized & anonymous Checkout routes so that customers can
include their member number and receive their 5% discount.
Valid member numbers are simply strings with at least 4 characters.
- Add a `MemberDiscountLine` value to the `LineItemType` datatype.
- Add a `memberNumber` field to the `Customer` DB model.
- Add a `memberNumber` parameter to the Checkout Details & Place Order
- Add the Member Discount to the OrderPlaced email.
- Modify the Place Order routes so they update/initialize the Customer's
- Modify the `Checkout.createLineItems` function to create a
`MemberDiscountLine` if applicable.
- Modify the `CommonData.getCharges` function to account for the
membership discount if applicable.
[#1189] Add Member Numbers to Checkout Process
Add an input field for Member Numbers, enabling Customers to receive
their 5% discount.
If a Customer has an existing member number, it is used to pre-fill the
input & the discount will also shown on the Cart page.
- Add a Member Discount line to the Order Details pages.
- Add a `memberDiscount` field to the `CartCharges` type.
- Modify the Checkout Details & Place Order API requests to include the
entered member number.
- Modify the `Checkout.refreshDetails` function so that the Checkout
details are also refreshed when a valid member number is entered or
- Refactor the logic for limiting the maximum store credit during
checkout into a separate `limitStoreCredit` function.
[#1189] Add Coupons To Charge Calculations
Handle application of coupon discounts to Carts & Orders via the
CartCharges type & getCharges function. This includes the percentage,
flat, & shipping discounts.
Add a ccGrandTotal field to the CartCharges type & calculate this in the
[#1189] Add Coupon Discounts to Checkout Calculation Routes
Handle submission of coupon codes by server during the checkout's charge
calculations. This includes validating the coupon code(does it exist, is
it active, applicable, etc.) & calculating/including the discount in the
[#1189] Add Priority Shipping Fee Type & DB Field
Add a PriorityShippingFee type to the Models.Fields module for storing
the flat & percentage fees for priority shipping & handling.
Add fields to the ShippingMethod database model for the priority fee and
a list of categories that exclude orders from the ability to have
Modify the DataMigration script to include a $5 + 5% priority fee,
excluding orders with Potatoes, Sweet Potatoes, Garlic, Perennial
Onions, Mushrooms, Ginseng, & Goldenseal from having the option to add
[#1189] Calculate Priority S&H in Checkout Details Route
Add priority shipping & handling calculations to the cusotemr &
anonymous checkout details server routes.
Add a Bool parameter to the routes for indicating whether or not
priority shipping is desired for the Order. If it is desired but not
available, a PriorityShippingNotAvailable error will be thrown.
Refactor the ccShippingMethods field of the CartCharges type to use a
new type, a ShippingCharge. This type stores both the CartCharge &
an optional PriorityShippingFee for a ShippingMethod. The fee is not
present if any of the items are in categories excluded by the
shippingMethodExcludedPriorityCategoryIds field of the ShippingMethod.
Add a ccPriorityShippingFee field to the CartCharges type, containing
the calculated fee for prirority S&H if it was requested.
Modify the getShippingMethods function to return a list of
ShippingCharge instead of a list of CartCharge.
Add HUnit for tests of the new calculatePriorityFee functon.
[#1189] Add Priority S&H Checkbox to Checkout Page
Add the Priority Shipping & Handling section to the Checkout Page's
form. This contains some basic text about Priority S&H as well as a
checkbox to enable customer's to add it to their order. When the input
is toggled, the details route will be hit to re-calculate the charges &
total and any Priority fee will be shown in the order summary.
Add a priorityShipping field to the CartCharges type to represent it's
line charge. Add PriorityFee & ShippingCharge types to represent the new
shipping method format & the cost of the priority shipping.
Submit the value of the priority checkbox state when requesting the
Checkout Details from the server.
[#1189] Handle Priority S&H When Placing an Order
Modify the server's Place Order routes so that priority shipping &
handling can be specified in the parameters.
Modify the createLineItems function so it creates a line item for the
PriorityShippingLine if applicable.
Add a Priority Shipping line item to the OrderPlaced email.
Refactor the PriorityShippingNotAvailable error value into a separate
type so it can be used for both the Checkout Details & Place Order
[#1189] Show Priority S&H Line Items on Order Details Page
Submit the state of the Priority S&H checkbox when submitting the
Add a PriorityShipping value to the LineItemType in the PageData along
with a decoder. This allows us to show the Priority Shipping & Handling
line item that is sent by the server for the Order Details page.