Hey guys!!! I have one more dumb question here :D Bad thing is - I havent found pretty much anything on internet about this so I think it would be great for other users to have some final answer here. :) So I am trying to add google opt-in code for reviews to order-done.php.
Here is my code:
<!-- BEGIN GCR Opt-in Module Code -->
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn"
async defer>
</script>
<script>
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
window.gapi.surveyoptin.render(
{
"merchant_id": 55555555,
"order_id": "Webits Order",
"email": "<?php echo $_POST["email"]; ?>",
"delivery_country": "CZ",
"estimated_delivery_date": "<?php echo date("Y-m-d", strtotime(date() . " + 1 day")); ?>",
"opt_in_style": "OPT_IN_STYLE"
});
});
}
</script>
<!-- END GCR Opt-in Module Code -->
<!-- BEGIN GCR Language Code -->
<script>
window.___gcfg = {
lang: 'cs_CZ'
};
</script>
<!-- END GCR Language Code -->
Used the one from this thread:
https://forum.virtuemart.net/index.php?topic=138050.msg483961#msg483961
And when I try to order my console says: Error: email cannot be empty!
Do we have a solution here? I don't know the proper way to echo an email of completed order :(
Please help with it guys I think it would be usefull for a whole lot of other guys here.
Have a great day!
Ehhh...not sure if I am in the right thread though :-(
I give up.... :-( Just tried pretty much everything and I simply cant get it to call shopper email on order-done page.. :-( Help please if you guys know...
you have to see what is returned by either the $this->html object - echo it out
or if your shop only allows registered users and you assume they are still logged in when u get back to orderdone then just use the standard
$cuser = JFactory::getUser();
$useremail = $cuser->get('email');
Uff OK will try that :-) What I did so far was I looked at the devtools -> network and I discovered that on the page it is loading "bypv_billing_address_email" and there was my test email adress next to it. I realized then that I am using One Page Checkout extension from bypv.org... So it looks like the order-done page remembers the data passed by from the One Page Checkout... So I will try to call it and let you know how it went ;-)
GJC - you rock btw! Wondering if there is a way I could repay you somehow :)