Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AnanthFlycart/701eff25cb16bd7aaebab2e014dc70fc to your computer and use it in GitHub Desktop.

Select an option

Save AnanthFlycart/701eff25cb16bd7aaebab2e014dc70fc to your computer and use it in GitHub Desktop.
CUW: Offer text prefix
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