daffodil icon indicating copy to clipboard operation
daffodil copied to clipboard

[FEAT] Add support for Shopify Storefront API Cart Driver

Open damienwebdev opened this issue 5 years ago • 6 comments

:bulb: Feature request

Feature Name

Shopify Cart Driver

The Desired Behavior

We'd implement the @daffodi/cart driver interface via the storefront API;.

We already have a Shopify product driver, so hopefully this could be fairly easily implemented in Demo.

Your Use Case

As a developer using Shopify, I'd like to be able to manage a customer's cart.

damienwebdev avatar Jan 05 '20 21:01 damienwebdev

@griest024

damienwebdev avatar Jan 05 '20 21:01 damienwebdev

The Shopify Storefront API does not have an explicit cart object. Instead, most of the cart fields are contained somewhere within the checkout object so its necessary to obtain the checkout ID. I recommend providing a method to that effect on the checkout service to prevent duplication of logic.

In my implementation I will assume that the checkout ID can be fetched through the checkout service.

griest024 avatar Jan 21 '20 21:01 griest024

@griest024

@lderrickable and I spent some time reviewing this last week. A checkout object in shopify is fundamentally equivalent to a DaffCart. They support very similar functionalities. (Updating billing, updating payment, etc.)

damienwebdev avatar Jan 21 '20 23:01 damienwebdev

@damienwebdev Do you want me to implement getting the checkout ID (via lastIncompleteCheckout) in the cart driver?

griest024 avatar Jan 21 '20 23:01 griest024

@griest024 I'd imagine that "getCheckoutId" is essentially the same as createCart in cart.

damienwebdev avatar Jan 21 '20 23:01 damienwebdev

@damienwebdev I think I was misinterpreting the responsibility of the checkout module. In the cart driver I will implement all necessary functionality to ensure that the the shopify checkout object is good to go.

griest024 avatar Jan 22 '20 00:01 griest024