maxalerator Posted July 28, 2017 Share Posted July 28, 2017 Dear Forum Members, As stated here Within Merchant Center it now is possible to integrate Google Customer Reviews to your website with the folowing 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( { // REQUIRED "merchant_id":"MERCHANT_ID", "order_id": "ORDER_ID", "email": "CUSTOMER_EMAIL", "delivery_country": "COUNTRY_CODE", "estimated_delivery_date": "YYYY-MM-DD", // OPTIONAL "opt_in_style": "OPT_IN_STYLE" }); }); } </script> <!-- END GCR Opt-in Module Code --> For integrating this code in WHMCS I think in need to create a custom hook and replace the variables in the script with the corresponding smarty variables. I consulted the hook reference here and I think this is the hook we need to use: <?php add_hook('AfterShoppingCartCheckout', 1, function($vars) { // Perform hook code here... }); Because the smarty variables need to be put in the javascript part of Google but i think it will only work on tpl files and not in PHP. I'm not really a codehead myself, so is there someone who can help me put this 3 different languages together to make this script to work on WHMCS in the correct way. I think a lot of people will be happy to use this piece of code. Thanks a lot! Link to comment Share on other sites More sharing options...
Giovanni1 Posted February 5, 2018 Share Posted February 5, 2018 hi, I wanted to ask you if you had managed to solve the problem in this way;Could you tell me the condice to add this feature ^? Link to comment Share on other sites More sharing options...
Recommended Posts