Laravel E-Commerce – Coupons & Discounts – Part 6

In this video, we add the ability to use coupons and coupon codes for discounts. We implement fixed value coupons and percent off coupons in our database. We then make sure that the appropriate discounts are being passed through correctly to Stripe.

5:13 – Note: I re-seeded the database so the price of the item in the cart changed, which may cause confusion in the rest of the video.

10:58 – You can see the item price and the Subtotal are not the same (they should be). This continues throughout the entire video. Sorry! I caught it after I finished recording. I should have cleared the cart contents after I re-seeded the database.

Pushing Polymorphism to the Database: https://adamwathan.me/2015/09/03/pushing-polymorphism-to-the-database/

GitHub repo: https://github.com/drehimself/laravel-ecommerce-example

Polymorphic Relations: https://laravel.com/docs/eloquent-relationships#polymorphic-relations

Coupon Code in cart or checkout: https://ux.stackexchange.com/questions/96867/coupon-code-on-checkout-process

How to handle money in web apps: http://culttt.com/2014/05/28/handle-money-currency-web-applications/

# LINKS
My courses: https://codewithdre.com
Sign up for my newsletter: http://andremadarang.com/newsletter
My website: http://andremadarang.com
Twitter: http://twitter.com/drehimself
GitHub: http://github.com/drehimself
CodePen: http://codepen.io/drehimself

source