Skip to content

Commit

Permalink
Tag subscriptions with primary product to make automations easier
Browse files Browse the repository at this point in the history
  • Loading branch information
janbaykara committed May 9, 2022
1 parent b0d5207 commit 21cf301
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/wagtail.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,14 @@ def to_checkout_line_items(self, zone=None, product=None):
{
"price_data": self.to_price_data(product),
"quantity": 1,
"metadata": {"primary": True},
},
# Keep the shipping fee in, even if it's 0
# so that we can upgrade/downgrade shipping prices in the future
{
"price_data": self.to_shipping_price_data(zone),
"quantity": 1,
"metadata": {"shipping": True},
},
]
return line_items
Expand Down
2 changes: 1 addition & 1 deletion app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def create_checkout_context(
"address": "auto",
"name": "auto",
},
metadata={},
metadata={"primary_product": product.id},
)

next = "/"
Expand Down

0 comments on commit 21cf301

Please sign in to comment.