custom redirect not working.

Home Forums Quform WordPress custom redirect not working.

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31076
    patdundee
    Participant

    Hi Ally
    Long time since we spoke. I have an issue with redirecting using functions.php.
    PHP 7.3
    Quform 2.10
    I have selected redirect to url as usual. I am sending through details on the following field types
    text box, email, select, radio and checkbox
    I am having issues adding the collected value from a radio element at adding it onto a cutom URL redirect

    It should be sending through a cart id as $cID and go straight to the cart but when it arrives at the redirect it just stays atops and displays
    http://www.mydomain.co.uk/?add-to-cart which is exactly what the redirect url is in the form
    it is missing the = and the value of the end so it does not continue to the cart
    it should take the details through and go direct to the cart

    I have tried
    url=html_entity_decode
    url=urlencode
    and just
    url=
    It just does not carry through and even leaves the = out

    Here is the code from functions.php

    function my_success_redirect_url3($url, Quform_Confirmation $confirmation, Quform_Form $form)
    {
    $cartID=$form->getValue('quform_3_16');
    if ($cartID == 1) {$cID=6405;}
    elseif ($cartID == 2) {$cID=6406;}
    $url=html_entity_decode('http://www.mydomain.co.uk/?add-to-cart='.$cID);
     return $url;
     }
     add_action('quform_confirmation_redirect_url_3', 'my_success_redirect_url3', 10, 3);

    in a normal php page this works fine

    $cID='6407';
    $url=html_entity_decode('http://www.mydomain.co.uk/?add-to-cart='.$cID);
    header("location:".$url);

    Could you please advise ASAP
    Many thanks
    Patrick

    • This topic was modified 3 years, 11 months ago by patdundee.
    • This topic was modified 3 years, 11 months ago by patdundee.
    • This topic was modified 3 years, 11 months ago by patdundee.
    • This topic was modified 3 years, 11 months ago by patdundee.
    • This topic was modified 3 years, 11 months ago by patdundee.
    • This topic was modified 3 years, 11 months ago by patdundee.
    • This topic was modified 3 years, 11 months ago by patdundee.
    #31094
    patdundee
    Participant

    Hi Ally
    I got it figured I need to change $form->getValue to $form->getValueText

    Regards
    Patrick

    #31105
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy