Skip to content

Instantly share code, notes, and snippets.

@rajeshsingh520
Created January 23, 2025 01:21
Show Gist options
  • Save rajeshsingh520/e2586ced17ac64f60a0cb50ed2eff5a8 to your computer and use it in GitHub Desktop.
Save rajeshsingh520/e2586ced17ac64f60a0cb50ed2eff5a8 to your computer and use it in GitHub Desktop.
bogo change product variation option below price column in cart
add_filter( 'woocommerce_cart_item_price', function($price, $cart_item, $cart_item_key){
if(class_exists('pisol_bogo_change_option')){
if(pisol_bogo_change_option::showChangeOptionButton($cart_item)){
$price .= '<br>'.pisol_bogo_change_option::addChangeOptionButton($cart_item, false, 'cart');
}
if(pisol_bogo_change_option::showChangeFreeProductButton($cart_item)){
$price .= '<br>'.pisol_bogo_change_option::addChangeFreeProductButton($cart_item, false, 'cart');
}
}
return $price;
}, 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment