Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When pressing the remove button after having added a coupon
the page reloads to a page not found with following messsage
Coupon removed from order
Add URL redirect from this page to another location
The requested page "/en/en/checkout/92" could not be found.
this is the function that controls the removal
is drupal_goto with empty parameters enough ?
function commerce_coupon_remove_coupon_from_order_callback($coupon, $order) {
if (!isset($_GET['token']) || !drupal_valid_token($_GET['token'], 'commerce_coupon_remove_checkout:' . $coupon->coupon_id . ':' . $order->order_id) || !commerce_checkout_access($order)) {
return MENU_ACCESS_DENIED;
}
commerce_coupon_remove_coupon_from_order($order, $coupon);
drupal_set_message(t('Coupon removed from order'));
drupal_goto();
}
Comments
Comment #1
enricotersi CreditAttribution: enricotersi commented+1
Comment #2
torgosPizzaSounds like a duplicate of #2023671: Wrong redirection when click on remove link and Path prefix is set on multilanguage - give the patch there a try.