Created
October 20, 2023 13:04
-
-
Save AnanthFlycart/701eff25cb16bd7aaebab2e014dc70fc to your computer and use it in GitHub Desktop.
CUW: Offer text prefix
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('cuw_cart_item_offer_text', function ($text, $cart_item) { | |
| if (method_exists('\CUW\App\Helpers\Offer', 'getText')) { | |
| $text = \CUW\App\Helpers\Offer::getText($cart_item['data'], $cart_item['cuw_offer']['discount'], 'cart'); | |
| $text = '<span class="cuw-offer-text">' . __("Save", 'checkout-upsell-woocommerce') . ' ' . $text . '</span>'; | |
| } | |
| return $text; | |
| }, 100, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment