I'm using hook_uc_cart_alter() to remove an attribute that just contains some serialized data & the customer should not see it.
<?php
function mymodule_uc_cart_alter(&$items) {
// Hides attribute that contains serialized node references
foreach($items as &$item) {
unset($item->data['attributes'][5]); // 5 is the aid of my "hidden" attribute
}
}
?>It works just perfectly, hiding the ugly mess of serialized data. However, ticking the "Remove" box & hitting "Update Cart" does not remove the item from the cart -- there's no PHP error, nothing in watchdog, just the item is not removed from the cart.
I do feel like I might be approaching this at the wrong level -- if I get this working, I'm pretty sure the attribute I want to hide will still show up on the invoice or probably in random other places I can't think of now. (I've tried similar to above in hook_cart_display, hook_cart_item unsuccessfully)
-OR-
Is there a better way to achieve a "hidden attribute"? Man, I sure wouldn't mind if "hidden" was a choice along with Select box, Text field, Radio, etc. when adding an attribute. Or maybe some per-attribute permissions or something off the wall like that.
Ideas? Thanks!

