Modifying behavior of "You Saved..." info in cart when attributes are chosen 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 = '&lt;div class="cart-normalprice"&gt;'.uc_price($display_item['#total'], $context).'&lt;/div&gt;';
  if ($item-&gt;list_price &gt; $item-&gt;price) {
    $savings = $item-&gt;list_price - $item-&gt;price;
    $savings = $savings * $item-&gt;qty;
    $totalsavings += $savings;
    $totalfield .= '&lt;div class="cart-savings"&gt;You saved '.uc_price($savings, $context).'!&lt;/div&gt;';
  }


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 &gt; li:contains("sometexthere")').length &gt; 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!
Doing this in jquery is probably going to be the quickest way to achieve this, especially since you're dealing with custom code. The jquery code you posted is close, but you need a different approach to test if the list-item contains text:

$(document).ready(function(){
    if ($('.item-list' + ':contains("someothertext")').length != 0 ) {
        $(".cart-savings").toggle();
    }
});


Also, note I used the toggle() function here which is a quicker way to determine visibility than adding / unadding a visibility class. 

You can verify the above code here: http://jsfiddle.net/JZnPq/