commonknowledge / leftbookclub

Website for the Left Book Club
https://leftbookclub.com
GNU General Public License v3.0
5 stars 0 forks source link

ONLY members (with active subscriptions) can purchase books #4

Closed janbaykara closed 2 years ago

janbaykara commented 2 years ago

Implementation notes

janbaykara commented 2 years ago

We'll need to figure out how to link a user to their shopify customer ID, if we want to pull in their purchase history.

Another option is to use webhooks / events and programmatically add books to the user account, independent of Shopify's customer history.

janbaykara commented 2 years ago

Ah, I guess what we can do is get_or_create the Shopify customer via their email address, use that to get purchase history.

janbaykara commented 2 years ago

In #10, we're using dj-stripe and syncing Stripe products to Django for convenience. A limitation of stripe is that descriptions can only be 200~ characters long, but most LBC descriptions are longer than that.

As Anna and I discussed, it seems like it'd be nice for books to have some customisable content related to them. For example, we could relate resources directly to books, and in the future we might add other book-related features.

So proposing here to create a wagtail BookPage model that mirrors products that have some kind of metadata identifying them as a book, with a dj-stripe Product item related to it.

janbaykara commented 2 years ago

Seems that currently, book purchases on the website are sometimes actually failing to process, so it will be good to compare the metrics on this one via an analytics funnel.

Current flow: https://app.posthog.com/recordings?filters=%7B%22actions%22%3A%5B%5D%2C%22events%22%3A%5B%5D%2C%22properties%22%3A%5B%5D%2C%22date_from%22%3A%222022-04-04%22%2C%22date_to%22%3Anull%2C%22offset%22%3A0%2C%22session_recording_duration%22%3A%7B%22type%22%3A%22recording%22%2C%22key%22%3A%22duration%22%2C%22value%22%3A60%2C%22operator%22%3A%22gt%22%7D%7D&source=direct#sessionRecordingId=180160c052d10e2-099905fe55c242-49193201-13c680-180160c052e1079