is there any way to remove password filed when filling cc information in foxycart?

sivasiva Member
i need to remove password filed for credit card...when filling credit card information for billing...is there any way to do that...and i want to disable quantity filed in the cart...presently i am using "quantity_max" in the link...but i need to disable it...
Tagged:
Comments
  • brettbrett FoxyCart Team
    Hi @siva.
    Passwords can be configured in the "template -> configuration" page in your admin, if you're on v2.0. (It's the "Customize the checkout user type (account vs. guest)" section.) You can set a few options for guest checkouts. Note that if you're selling a subscription, the password is required.

    To disable the quantity field, you'd need to modify the cart include template (or do something with javascript, also a possibility). If you modify the cart include, it'd be a Twig conditional like this:
    {% if item.quantity_min == item.quantity_max %}readonly{% endif %}
    Or whatever you'd like. Put that on the .fc-cart__item__quantity__input section. That's one option, at least. You could modify things however you'd like.
  • sivasiva Member
    thank you brett for your reply...

    i will try the above solution and will get back if i face any problems.
  • sivasiva Member
    where should i place the {% if item.quantity_min == item.quantity_max %}readonly{% endif %} in cart include template. i have placed it in template...but i am able modify the quantity field which i don't want.

    Thanks.
  • fc_adamfc_adam FoxyCart Team
    @siva,

    So you'll need to place it within the quantity input fields that are in the cart include template. You'll look for text that looks like this:
    <input class="fc_cart_item_quantity fc_text fc_text_short" type="text" id="quantity{{ item.item_number }}" name="quantity{{ item.item_number }}" value="{{ item.quantity }}" />
    and insert the code that Brett provided within there like this:
    <input class="fc_cart_item_quantity fc_text fc_text_short" type="text" id="quantity{{ item.item_number }}" name="quantity{{ item.item_number }}" value="{{ item.quantity }}" {% if item.quantity_min == item.quantity_max %}readonly{% endif %} />
    If you then add a product that has a quantity_min and quantity_max that matches each other (so if you just wanted to have the one product present you would set both to 1), that should then make the input readonly.
  • sivasiva Member
    Thank you @fc_adam....it worked like a charm.
Sign In or Register to comment.