WooCommerce URL Coupons not redirecting properly on https

WooCommerce URL coupons v2.4.1 has a bug where it does not redirect from a coupon page properly if the site is using https. We have submitted a ticket to support and hopefully this will be fixed asap.

The problem is in /includes/frontend/class-wc-url-coupons-frontend.php L106:

$url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

A quick hacky fix for sites running exclusively on SSL would be simple:

$url = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

 

Indrek Kõnnussaar

I'm a veteran Wordpress developer, context-driven tester, security enthusiast and the mastermind behind Codelight. I love building stuff that works and fixing stuff that doesn't.

Write me directly indrek@codelight.eu

2 Responses to “WooCommerce URL Coupons not redirecting properly on https”

  1. Red

    Did they ever fix this issue? We are currently running into this problem and would rather not have to hard-code the fix…but certainly will if they haven’t fixed it. Thanks!

    Reply
    • Red

      It also seems that if you take out ‘http://’ . entirely from that line it will work for both http & https variations. At least in the few tests I did.

      Reply

Leave a Reply

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×