Skip to content

Commit a8a3c9d

Browse files
Added price without symbol
1 parent 55631ef commit a8a3c9d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

nxtbn/order/admin_types.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ class Meta:
2727

2828
class OrderLineItemsType(DjangoObjectType):
2929
db_id = graphene.Int(source='id')
30+
humanize_total_price = graphene.String()
31+
humanize_price_per_unit = graphene.String()
32+
33+
def resolve_humanize_total_price(self, info):
34+
return self.humanize_total_price()
35+
36+
def resolve_humanize_price_per_unit(self, info):
37+
return self.humanize_price_per_unit()
3038
class Meta:
3139
model = OrderLineItem
3240
fields = (
@@ -50,7 +58,10 @@ class OrderType(DjangoObjectType):
5058
humanize_total_tax = graphene.String()
5159
humanize_total_paid_amount = graphene.String()
5260
due = graphene.String()
61+
total_price_without_symbol = graphene.String()
5362

63+
def resolve_total_price_without_symbol(self, info):
64+
return self.humanize_total_price(locale='')
5465

5566
def resolve_humanize_total_price(self, info):
5667
return self.humanize_total_price()

nxtbn/product/admin_types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ class Meta:
108108
class ProductVariantAdminType(DjangoObjectType):
109109
db_id = graphene.Int(source="id")
110110
display_name = graphene.String()
111+
humanize_price = graphene.String()
112+
113+
def resolve_humanize_price(self, info):
114+
return self.humanize_total_price()
111115
class Meta:
112116
model = ProductVariant
113117
fields = (

0 commit comments

Comments
 (0)