Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Yes!
but I can not find how to fill the field in javascript as for the contact module for the Cart module
Offline
Offline
With your last code for contact module, In mail we receive:
https://i.ibb.co/f9CwS49/Capture-d-cran-2019-05-16-01-17-25.png
Nice
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Seems to work with contact module.
But cart module has no field as:
<p class="contact-field_12">
This code inserts the radio button before the field named 'paiement'. I have added a line to hide that at the same time.
function ttg_scripts($style, $path) {
echo'
<script>
$("input[name=paiement]").before(\'<br><input type="radio" name="gender" value="red" onclick="moveNumbers(this.value)"> Red<br> <input type="radio" name="gender" value="green" onclick="moveNumbers(this.value)"> Green<br> <input type="radio" name="gender" value="blue" onclick="moveNumbers(this.value)">Blue\');
$("input[name=paiement]").hide();
</script>
';
}
But I think that this code should only be used when one is on the cart page. So I'm adding my page_match function:
function page_match($gallery) {
if (substr($_SERVER["REQUEST_URI"], 0, strlen($gallery)) == $gallery) {
return 1;
} else {
return 0;
}
}
function ttg_scripts( $style, $path ){
if ( page_match('/backlight/cart') ) {
echo '
<script>
$("input[name=paiement]").before(\'<br><input type="radio" name="gender" value="red" onclick="moveNumbers(this.value)"> Red<br> <input type="radio" name="gender" value="green" onclick="moveNumbers(this.value)"> Green<br> <input type="radio" name="gender" value="blue" onclick="moveNumbers(this.value)">Blue\');
$("input[name=paiement]").hide();
</script>
';
}
}
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Thanks very much the first is Ok Great !
For the second there an error:
Something went wrong
Unexpected error: syntax error, unexpected '<' in perso-checkout.php on line 11
Offline
Thanks very much the first is Ok Great !
For the second there an error:
Something went wrong
Unexpected error: syntax error, unexpected '<' in perso-checkout.php on line 11
Oh, I forgot the echo '...'; Fixed above.
And you still need you moveNumbers function....
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
Congratulation !
A GREAT THANKS Daniel for all !!!
So now, all works like a charm
Thanks to you, we now have the possibility to use radio and drop-down fields in the contact form and in Cart Checkout
You are amazing, how do you do to know all that!
Thank you again for all
Nico
Offline
Hey Nico, great that this works for you I'll put this all into a blog post so others can use this as well. Great idea, Nico!
Daniel Leu | Photography
DanielLeu.com
My digital playground (eg, Backlight tips&tricks): lab.DanielLeu.com
Offline
That's my Cart Checkout page:
And the mail the client or me received:
Yoooohoo!
Thanks Daniel, you're a BOSS!
Offline