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.

Feature request: Prevent removing products from cart


We use FoxyCart purely for the payment functionality for a single product, and we don't need the Cart itself really (although the cart page is nice way to display the product details and price breakdown). We merely have one "Buy now" hyperlink which goes to FoxyCart with the product details in the query string. As such, we don't provide our website visitors with any way of adding extra products to the cart, and indeed they don't even know that they have a cart, really! So, we use the empty=true parameter in the hyperlink, since otherwise the visitor would be able to add extra units of the product to the cart if they jumped between the cart and the shop repeatedly. (Actually, I'm not sure if that's true any more, given that we now use the quantity_max=1 parameter [which we introduced to prevent the visitor from manually increasing the quantity once in the Cart page]; but it certainly used to be true before we started using that parameter.)

Anyway, we'd also like to stop the visitor from being able to remove the product from the Cart, since that functionality adds no value in our situation because it results in a useless empty cart and in any case the visitor can already easily return to our shop without going further with the purchase simply by clicking the "Continue shopping" button in the Cart (which we've renamed to something like "Cancel / Back"). I tried using the quantity_min=1 parameter hoping that it would prevent the visitor from being able to manually reduce the quantity to 0 in the Cart (which unfortunately failed - which seems like a bug to me, though admittedly the documentation for it does seem to imply that it only has an effect with the product is a "child product" [which ours isn't, of course] - although it did have an influence on the tooltip which is displayed when hovering over the quantity box), and hoping that it would prevent the "Remove item" link from being displayed under the product in the Cart (which unfortunately it didn't).

So my feature request is: please provide an easy way to prevent the "Remove item" link from being displayed under the product in the Cart (perhaps limiting it to working only when empty=true is used, since I can't see any use case for it when empty=false). This could perhaps be achieved via a new query string parameter (which should have the side-effect of overriding a zero or missing value of quantity_min with the value '1'); or perhaps it could happen automatically whenever empty=true,quantity_min=1,quantity_max=1 are used in combination and only one product is specified.

I guess the workaround will be to edit the Cart template and remove the HTML corresponding to the "Remove item" link... but that's a bit of a hassle!
  • fc_adamfc_adam FoxyCart Team

    Thanks for posting - good question. While we don't currently support an option for not allowing removing products - there are approaches you could take to achieve that.

    To start off - if you've just got the one product, the cart page probably doesn't really serve much of a purpose for you, but adds an extra step for the customer when purchasing. What you could do is add the cart=checkout parameter to your link or form, and that would push the customer straight over to the checkout. This way they wouldn't ever see the cart, and can move on to purchasing all the quicker.

    To prevent editing products on the checkout, for both removing and editing quantities, you can enable the "Customize which checkout fields are shown and required" option at the bottom of the "configuration" section of your store's Foxy administration. Within that you'll see an option for "editable cart" which if you set to disabled and save will prevent the cart from being altered on the checkout.

    Could that solution work for your needs?

    If you did specifically want to keep the cart step of the process, you could also hide the remove product link from view using CSS, like this:
    <style type="text/css">
    .fc-cart__item__remove {
    display: none !important;
    You could add that to the "header" textarea within the "Add custom header and footer code to your templates", also found on the "configuration" section of the Foxy admin.
  • AntonSyAntonSy Member
    Hi Adam,

    Thanks for these three suggestions (the first two of which are completely new to me!). I'm sure that one of them will be ideal for us.

    And thanks, as always, for your quick and detailed answer!
Sign In or Register to comment.