From 2e5ab35b1cf30c11a1cf16b5f6bc82d4e1c4e1ce Mon Sep 17 00:00:00 2001 From: merdan Date: Thu, 17 Nov 2022 15:03:57 +0500 Subject: [PATCH] invoice fx --- packages/Sarga/API/Http/Resources/Checkout/CartResource.php | 2 +- .../Sarga/API/Http/Resources/Checkout/CartRuleResource.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/Sarga/API/Http/Resources/Checkout/CartResource.php b/packages/Sarga/API/Http/Resources/Checkout/CartResource.php index ac50c24f1..ff2b2a326 100644 --- a/packages/Sarga/API/Http/Resources/Checkout/CartResource.php +++ b/packages/Sarga/API/Http/Resources/Checkout/CartResource.php @@ -79,7 +79,7 @@ class CartResource extends JsonResource $ruleResources = array(); if($this->applied_cart_rule_ids){ - $rule_ids =implode(',',$this->applied_cart_rule_ids); + $rule_ids =explode(',',$this->applied_cart_rule_ids); $cols = ['id','name','description','action_type','amount']; $cartRules = $this->cartRuleRepository->findWhereIn('applied_cart_rule_ids',$rule_ids,$cols); diff --git a/packages/Sarga/API/Http/Resources/Checkout/CartRuleResource.php b/packages/Sarga/API/Http/Resources/Checkout/CartRuleResource.php index 2636604f4..b7626d858 100644 --- a/packages/Sarga/API/Http/Resources/Checkout/CartRuleResource.php +++ b/packages/Sarga/API/Http/Resources/Checkout/CartRuleResource.php @@ -18,7 +18,9 @@ class CartRuleResource extends JsonResource 'name' => $this->name, 'description' => $this->description, 'action_type' => $this->action_type, - 'amount' => str_contains($this->action_type,'fixed')? core()->formatPrice($this->discount_amount, $this->currency):$this->discount_amount.'%' + 'amount' => str_contains($this->action_type,'fixed')? + core()->formatPrice($this->discount_amount, $this->currency): + $this->discount_amount.'%' ]; }