Skip to content

Commit 91a8fd8

Browse files
committed
Add method for getting order using customer_id with tests
1 parent b640f78 commit 91a8fd8

File tree

3 files changed

+951
-0
lines changed

3 files changed

+951
-0
lines changed

shopify/resources/order.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55

66
class Order(ShopifyResource, mixins.Metafields, mixins.Events):
7+
_prefix_source = "/customers/$customer_id/"
8+
9+
@classmethod
10+
def _prefix(cls, options={}):
11+
customer_id = options.get("customer_id")
12+
if customer_id:
13+
return "%s/customers/%s" % (cls.site, customer_id)
14+
else:
15+
return cls.site
716

817
def close(self):
918
self._load_attributes_from_response(self.post("close"))

0 commit comments

Comments
 (0)