Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carrying over the quantity of existing line items to new line items #13

Open
thenbrent opened this issue Feb 25, 2019 · 8 comments
Open

Comments

@thenbrent
Copy link
Contributor

thenbrent commented Feb 25, 2019

From a customer:

My sequential workflow works well, but only if I've only got a single item in the order. Any suggestions for how to handle things if someone wants to order two of the 1-month subscription boxes?

Rephrasing: the customer purchases product A, then when product B gets added to the subscription, we want to use the same line item quantity for Product B as the quantity paid for with product A.

There is currently no way to change a subscription product, and use the quantity of a product previously on the subscription.

A fairly common request from customers is to create sequential subscriptions, where a customer receives a series of items based on their sign-up date, or seasonal subscriptions, where a customer receives a different item each week or month, again, based on

There are two broad approaches to achieve this:

  1. New Replace/Change Product action: this can be used to replace one product with another, and carry over some of the aspects of it, like quantity, price, and potentially meta data.
  2. Line Item data variable/s: this can be used to derive the quantity (and possibly other data) from a different line item (likely filtered by product ID) on the subscription.

The former is the simplest approach, and likely easiest to understand. But the later is needed in the case where the subscription product is kept on the subscription over its whole lifecycle, and additional products are added/removed on top of that. Keeping the original product on the subscription is a good approach, because it ensures reports are accurate (e.g. if you want to see total revenue for that subscription product). To do that, you'd need to get the quantity from one line item and apply it to the other.

@thenbrent thenbrent changed the title Handling quantities Carrying over the quantity of existing line items to new line items Feb 25, 2019
@danielbitzer
Copy link
Contributor

Another approach would be to setup Each Line Item subscription triggers like we have on most Order triggers. That would allow access to specific line item variables.

@thenbrent
Copy link
Contributor Author

Another idea is to have a way to inherit or copy data from one line item to another via a new fields on the _Add Product action. For example, add a new Inherit Quantity checkbox and when that's chosen, display a select field for the store manager to choose the product to inherit from.

@thenbrent
Copy link
Contributor Author

thenbrent commented Feb 25, 2019

New Each Line Item triggers, like a Subscription Renewal Payment Complete - Each Line Item trigger will likely be the best solution to this.

We'd need to add a new Subscription Line Item - Product ID rule to filter the workflow to only the specific product/s to support that too.

Update: the Product is rule can be used to filter the line item. \AutomateWoo\Rules\Product

@danielbitzer
Copy link
Contributor

We can probably apply reuse the order_item data type for subscriptions. Existing rules and variables should be compatible but we'll need to confirm that.

@danielbitzer
Copy link
Contributor

I think these new triggers can go in AW core. What do think?

@thenbrent
Copy link
Contributor Author

I think in general it makes sense to add most new subscriptions functionality to this add-on. But if you think these triggers are warranted in core, I'm totally fine with adding them there.

@danielbitzer
Copy link
Contributor

My thinking is that the add-on should contain advanced or edge case functionality. I think for these triggers it makes sense to have them in core since we already have the order each line item triggers there.

@thenbrent
Copy link
Contributor Author

OK let's do them in core. I'll open an issue there and close this one. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants