Skip to content

Commit

Permalink
fix add cache rm
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Jan 17, 2025
1 parent bd33a56 commit 4f7aff1
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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'),
Expand Down

0 comments on commit 4f7aff1

Please sign in to comment.