Feature #1189

Add Additional Options to Checkout

Added by Pavan Rikhi about 3 years ago. Updated over 1 year ago.

Status:ClosedStart date:11/25/2017
Priority:NormalDue date:07/21/2019
Assignee:Pavan Rikhi% Done:

100%

Category:CheckoutSpent time:7.71 hours
Target version:v0.6.0 - Checkout
Easy Pickings:

Description

  • Coupon codes
  • store credit
  • priority S&H
  • member number

member number

Discount order by 5% if anything is entered into the field.

coupon codes

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.

priority s&h

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.

Associated revisions

Revision 82eb118e
Added by Pavan Rikhi about 3 years ago

[#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
script.

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
    used.
  • 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.

Refs #1189

Revision 07552cf7
Added by Pavan Rikhi about 3 years ago

[#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.

Refs #1189

Revision 7b7066f5
Added by Pavan Rikhi over 2 years ago

[#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
    routes.
  • Add the Member Discount to the OrderPlaced email.
  • Modify the Place Order routes so they update/initialize the Customer's
    member number.
  • Modify the `Checkout.createLineItems` function to create a
    `MemberDiscountLine` if applicable.
  • Modify the `CommonData.getCharges` function to account for the
    membership discount if applicable.

Refs #1189

Revision 42894e28
Added by Pavan Rikhi over 2 years ago

[#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
    removed.
  • Refactor the logic for limiting the maximum store credit during
    checkout into a separate `limitStoreCredit` function.

Refs #1189

Revision 0645fa75
Added by Pavan Rikhi over 1 year ago

[#1189] Add Coupon DB Model & Associated Types

Add a Coupon model to the database schema, a field for optional Coupon
IDs to the Order model, a CouponType field categorizing the types of
coupons(flat rate, percentage rate, & free shipping), and a line item
for coupons.

Refs #1189

Revision fc1dd7e8
Added by Pavan Rikhi over 1 year ago

[#1189] Add Coupons to Data Migration Script

This migrates the coupons & coupons_description table from ZenCart.
Coupon line items are currently ignored since Orders are not yet
imported.

Refs #1189

Revision fc96778f
Added by Pavan Rikhi over 1 year ago

[#1189] Add Coupon Line Row to OrderPlaced Email

Refs #1189

Revision 37b8877b
Added by Pavan Rikhi over 1 year ago

[#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
getCharges function.

Refs #1189

Revision afe2bab5
Added by Pavan Rikhi over 1 year ago

[#1189] Fix Charge Calculation for Cart Routes

Fix calls to getCharges in the customer & anonymous Cart routes, simply
passing Nothing for the coupon since we won't support adding coupons
from the Cart page until after v1.0.

Refs #1189

Revision 6e5a1083
Added by Pavan Rikhi over 1 year ago

[#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
returned data.

Refs #1189

Revision faafb3f1
Added by Pavan Rikhi over 1 year ago

[#1189] Handle Coupons During Order Processing

Handle the submission of coupon codes when the server is handling an
checkout submission request. This includes calculating the discount,
validating the coupon code, adding a line item for the coupon, and
adding the coupon to the Order model.

Refs #1189

Revision 594a3406
Added by Pavan Rikhi over 1 year ago

[#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
priority shipping.

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
priority S&H.

Refs #1189

Revision 07ccf983
Added by Pavan Rikhi over 1 year ago

[#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.

Refs #1189

Revision 8f934e36
Added by Pavan Rikhi over 1 year ago

[#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.

Refs #1189

Revision 581690b6
Added by Pavan Rikhi over 1 year ago

[#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
routes.

Refs #1189

Revision d43b52d6
Added by Pavan Rikhi over 1 year ago

[#1189] Show Priority S&H Line Items on Order Details Page

Submit the state of the Priority S&H checkbox when submitting the
Checkout form.

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.

Closes #1189

History

#1 Updated by Pavan Rikhi about 3 years ago

  • Start date set to 11/25/2017

Starting work on this issue.

#2 Updated by Pavan Rikhi almost 3 years ago

  • Description updated (diff)
  • Status changed from New to In Progress
  • % Done changed from 0 to 20

Store Credit is finished, working on member numbers now

#3 Updated by Pavan Rikhi almost 3 years ago

  • Description updated (diff)

#4 Updated by Pavan Rikhi over 2 years ago

  • Description updated (diff)
  • % Done changed from 20 to 50

Pretty sure the current site doesn't store member numbers, so need to grab from stoneedge or leave them all blank.

#5 Updated by Pavan Rikhi over 2 years ago

are coupon minimum purchases based on order total or product subtotal?

#6 Updated by Pavan Rikhi over 2 years ago

Hide member number input if customer has number already?

#7 Updated by Pavan Rikhi almost 2 years ago

  • Description updated (diff)

#8 Updated by Pavan Rikhi over 1 year ago

  • Description updated (diff)
  • % Done changed from 50 to 70

Coupon code is now available.

#9 Updated by Pavan Rikhi over 1 year ago

  • % Done changed from 70 to 100
  • Status changed from In Progress to Closed

#10 Updated by Pavan Rikhi over 1 year ago

  • Description updated (diff)
  • Due date set to 07/21/2019

Priority S&H done!

Also available in: Atom PDF