Created
December 5, 2023 13:11
-
-
Save AnanthFlycart/a2ad675b82b3f7bcb8445c9cf971ecb9 to your computer and use it in GitHub Desktop.
CUW: Compatibility for Dynamic Pricing & Discounts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('rightpress_product_price_changes_price_to_set', function($price, $cart_item_key, $price_changes, $cart_items) { | |
| if (isset($cart_items[$cart_item_key]['cuw_offer']['price'])) { | |
| return (float)$cart_items[$cart_item_key]['cuw_offer']['price']; | |
| } elseif(isset($cart_items[$cart_item_key]['cuw_product']['price'])) { | |
| return (float)$cart_items[$cart_item_key]['cuw_product']['price']; | |
| } | |
| return $price; | |
| }, 100, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment