Home › Forums › Quform WordPress › custom redirect not working.
- This topic has 2 replies, 2 voices, and was last updated 3 years, 11 months ago by Ally.
- AuthorPosts
- May 3, 2020 at 11:00 pm #31076patdundeeParticipant
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 redirectIt 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 cartI have tried
url=html_entity_decode
url=urlencode
and just
url=
It just does not carry through and even leaves the = outHere 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.
May 4, 2020 at 11:21 am #31094patdundeeParticipantHi Ally
I got it figured I need to change$form->getValue
to$form->getValueText
Regards
PatrickMay 5, 2020 at 10:10 am #31105AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.