I'd like to modify/eliminate the "you saved" text/info on the Cart page when a certain attribute (or attributes) has been chosen for the product in the cart.
This is the code from uc_cart.module that appears to handle the "you saved" info:
$totalfield = '<div class="cart-normalprice">'.uc_price($display_item['#total'], $context).'</div>';
if ($item->list_price > $item->price) {
$savings = $item->list_price - $item->price;
$savings = $savings * $item->qty;
$totalsavings += $savings;
$totalfield .= '<div class="cart-savings">You saved '.uc_price($savings, $context).'!</div>';
}
And I'd like to add something like "Do not display the 'You Saved' div if Option X, Option Y, or Option Z have been chosen".
Can anyone here direct me on how to accomplish that? Or could a jquery snippet such as this provide the same "hide" functionality?
(function($) {
$(document).ready(function(){
if ($('.item-list > li:contains("sometexthere")').length > 0) {
$(".cart-savings").addClass("newclass");
}
});
})(jQuery);
The "newclass" would have a CSS display:none property that would hide the cart-savings div if the item-list (attribute options listing) div contained one of the words that is only used in these options. Or, it could be flip-flopped, where the div is already hidden via CSS, and the jquery adds a new css class that unhides it via "display:block".
Thanks!