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/
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/
My courses: https://codewithdre.com
Sign up for my newsletter: http://andremadarang.com/newsletter
My website: http://andremadarang.com