The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Hide an option from Cart?

fc_joshfc_josh FoxyCart Team
in Bugs & Feature Requests edited August 2010
I know how to hide an option that is included in the URL string, but how do you hide an option that is inputed in a form? Here is the code to hide an option:
<script type="text/javascript" charset="utf-8">
$(".fc_cart_item_option_name").each(function() {
  if ($(this).html() == "Color") {

Here is my custom option code:
<FORM NAME="product">
					<SELECT NAME="picture" size="1" onChange="showimage()">
					<OPTION SELECTED VALUE="styles/images/custom_products/baseball_tee.jpg">Color</OPTION>
					<OPTION VALUE="styles/images/custom_products/hoodie.jpg">Color 2</OPTION>

Thank you so much for your help!
  • brettbrett FoxyCart Team
    Can you clarify what you want it hidden from? Displaying in the cart or just hidden entirely? Also, what version you're using.

    If you just don't want the cart to get that value at all you prefix the name="picture" with a x:, so name="x:picture". The x: will exclude it entirely. The h: makes it a session variable, which doesn't look like what you want in this case.
  • fc_joshfc_josh FoxyCart Team
    I fixed the issue with another method. Thank you so much!
  • Any possibility of a follow up on this? I want to *make invisible* an option in the cart (Category, in my case) but still pass the value.

    I've tried adding a display:none to the CSS for li.fc_cart_category_code (as well as the class without the 'li,' even added the '!important') but it still displays.

    Any ideas?
  • brettbrett FoxyCart Team
    Give us a link to your add-to-cart link or form page with the CSS in question. Sounds like either your CSS was wrong or perhaps you put it in the wrong place. You'd have to put it in the cart and checkout itself, and not on your site (since the cart is in an iframe and gets its own CSS.)
  • Yes, it is in my own CSS. How would I go about inserting into the iframe CSS?

    For link testing, try: 1 Quart&price=19.00&weight=4&category=01-06
  • brettbrett FoxyCart Team
    In your cart template in your admin, put it there. It should hopefully be a little more clear if you view the cart _without_ the modal window and view source. See how there's no CSS there that'd hide the category? So you need the CSS there, and not in your site, since they're entirely separate pages.

    Make sense?
  • Or, to see the whole lightbox, try and add anything to the cart.
  • Got it. Done. Worked. Primo!
Sign In or Register to comment.