From 4f7aff16a3c520d407686cc424c082cb3b890629 Mon Sep 17 00:00:00 2001 From: xxl4 Date: Fri, 17 Jan 2025 07:42:38 +0000 Subject: [PATCH] fix add cache rm --- .../V1/Admin/Marketing/Promotions/CartRuleController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Http/Controllers/Api/V1/Admin/Marketing/Promotions/CartRuleController.php b/src/Http/Controllers/Api/V1/Admin/Marketing/Promotions/CartRuleController.php index 21e1309..4c99013 100644 --- a/src/Http/Controllers/Api/V1/Admin/Marketing/Promotions/CartRuleController.php +++ b/src/Http/Controllers/Api/V1/Admin/Marketing/Promotions/CartRuleController.php @@ -325,6 +325,7 @@ public function createProductQuantityRule($product_id, Request $request){ 'action_type' => $rule['action_type'], 'discount_amount' => $rule['price'], 'end_other_rules' => 1, + 'status' => 1, 'coupon_type' => 0, 'use_auto_generation' => 0, 'discount_step' => 0, @@ -374,7 +375,12 @@ public function createProductQuantityRule($product_id, Request $request){ // clear the cache in redis // product slug $slug = $product->url_key; + $currency = core()->getCurrentCurrency()->code; Cache::forget($this->checkout_v2_cache_key.$slug); + Cache::forget("product_ext_".$product->id."_1_".$currency); + Cache::forget("product_ext_".$product->id."_2_".$currency); + Cache::forget("product_ext_".$product->id."_3_".$currency); + Cache::forget("product_ext_".$product->id."_4_".$currency); return response([ 'message' => trans('Apis::app.admin.marketing.promotions.cart-rules.create-success'),