logout page has stopped redirecting.

  • Since updating php to 7.1 when a member/customer logs out the redirect has stopped working. Any thoughts would be much appreciated.

    PHP
    1. <?php
    2. if (perch_member_logged_in()) {
    3. perch_member_log_out();
    4. perch_shop_set_discount_code(' ');
    5. perch_member_remove_tag();
    6. perch_shop_empty_cart();
    7. PerchSystem::redirect('/account/login');
    8. }
    9. ?>

  • There's no other code in the page than what's listed above. I can't see the debug because it just returns a blank page.
    I've run through it commenting out each line until failiure occurs - appears to be the perch_member_remove_tag(); that is causing the issue.
    I use member tags to set level of trade discount by applying promo codes to aalow discounts of 25%, 30% or 40%.

    There is a "base" tag of trade which evokes the 'Perch' trade price. (this is because sampling is free for trade customers). So a customer can have two members tags set. That said, it also fails when a member doesn't have a tag set.

    Do I have explicitly stat the tag i.e. perch_member_remove_tag('trade'); ?

  • This appears to work, but is there a more efficient way of doing it so that "any" or "all" tags a removed in one hit. So that if any new tags created by the client would be removed without me having to update the logout code.