# 139 - Shopping carts are hard

> Episode of [How To Code Well](https://podistic.com/podcast/how-to-code-well.md) · Published December 13, 2021 · Duration 28:00 · Episode 139, season 4

- **Listen on Podistic:** https://podistic.com/episode/139-shopping-carts-are-hard
- **Audio:** https://anchor.fm/s/2d0cded8/podcast/play/44797676/https%3A%2F%2Fd3ctxlq1ktw2nl.cloudfront.net%2Fstaging%2F2021-11-13%2Faa3f77f6-fa4c-35f9-30c7-29e270d62954.mp3 (audio/mpeg)

## About this episode

**Changelog**

*   No live stream tonight, My internet has been super patchy today so I’m not even going to try.
*   Unfortunately no PHP 8 short this week. It has been recorded, I just haven’t had the chance to upload and do the thumbnail yet.
*   We documented the 7th lesson of the new PHP course. This included some TDD, some array nesting and some PHP 8 array shapes

**Shopping carts are hard**

A shopping cart needs to be frictional-less to the end user (Customer). The quicker a customer can purchase a product the better.

There are many questions that need to be answered when designing the user flow of a shopping cart

These are just some things to think about:

Shipping

*   Will you be shipping a physical good and if so will the shipping cost be dependent on user location?
*   Will shipping be based on the item(s) weight?
*   Will shipping be discounted in certain regions?
*   Will you require shipping information to make a payment (Security checks)?
*   Will there be discounted shipping based on quantity?
*   Will there be a quantity limit based on different regions?

Currency

*   What currency will you be offering?
*   What is the conversion rate?
*   How will you track that?
*   What are the tax implications for you versus the customer?
*   How are you going to calculate tax?

Users

*   Will you require an actual user to login before and order is created?
*   Can someone make a guest account?
*   Will there be teams or individual accounts?
*   Will you require the customer to be verified before making a purchase. Some places like Stripe require a user email address?

Product

*   Is it a digital good?
*   Will there be stock?
*   How will the stock be recorded/monitored?
*   How will an out of stock product be displayed?
*   Can products be bundled?
*   Do bundled products get a discount?
*   How are products removed from the cart?
*   How are products updated on the cart?
*   How are quantities updated on the cart?

Checkout

*   What happens when a logged out user access the checkout page?
*   What happens to abandoned carts?
*   What defines an abandoned cart?
*   At what point does the cart get created in the database?
*   At what point does the cart get associated with the user?

Other items to consider

*   Refunds
*   Subscriptions
*   Cancelations
