Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Confirmation popup on 'Remove' button

EpotratzEpotratz Member
in Help edited February 2017
Guys guys,

We have some customers removing the child-item, which removes the subscription from the order, even though they actually want the subscription.

We'd like to apply a browser pop-up message to the child-item 'Remove' button, like this:


As an example, we have a little browser message that shows on our blog when users click the "Store" link. Could something like this be applied to that child "Remove" button?

var menuID = jQuery('#menu-item-218');

findA = menuID.find('a');{
if(confirm("You are about to leave this informational blog to enter the Botanical Craft webstore."))
{'','_blank'); //This will open the website in a new tab

  • fc_adamfc_adam FoxyCart Team

    You can certainly add in some custom javascript there to show an alert. Perhaps an easier solution could be to simply remove the remove link for that product using CSS - so people can't remove it directly.

    For handling it with javascript, that would look like this:
    FC.client.on("cart-item-remove", function(params) {
    var is_sub = false;
    for (var i = FC.json.items.length - 1; i >= 0; i--) {
    if (FC.json.items[i].id == && FC.json.items[i].sub_frequency != "") {
    is_sub = true;

    if (is_sub) {
    return confirm("You are about to remove the recurring autoship from this order. Are you sure?");
    } else {
    return true;
  • @fc_adam

    Thanks for that.

    I'm guessing this would only target the "Remove" button for items with a sub_frequency or 2:sub_frequency?

  • fc_adamfc_adam FoxyCart Team

    That's correct - it is only applying to a product with a sub_frequency set, but you can certainly customise the logic to apply to other products too if needed.
Sign In or Register to comment.