Codificação
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>
<script>
ko.postbox.subscribe('checkout/payment/submit', function (response) {
Date.prototype.addDays = function (days) {
var dat = new Date(this.valueOf());
dat.setDate(dat.getDate() + days);
return dat;
};
var dat = new Date();
var newdate = dat.addDays(EasyCheckout.ModelData.Basket.SelectedDeliveryOption.EstimatedTime);
var day = ("0" + newdate.getDate()).slice(-2);
var month = ("0" + (newdate.getMonth() + 1)).slice(-2);
var year = newdate.getFullYear();
var estimatedDeliveryDate = year + '-' + month + '-' + day;
window.renderOptIn = function () {
window.gapi.load('surveyoptin', function () {
window.gapi.surveyoptin.render({
"merchant_id": 99999, --> CÓDIGO DA LOJA AQUI
"order_id": EasyCheckout.ModelData.Basket.BasketID,
"email": EasyCheckout.ModelData.Customer.Email,
"delivery_country": "BR",
"estimated_delivery_date": estimatedDeliveryDate
});
});
};
window.renderOptIn();
});
</script>
Inserir no template
- No painel administrativo Aparência > Gereciandor de arquivos > [TEMA_DA_LOJA].
- Dentro do Tema da Loja vá até Templates > masters > EasyCheckoutStep > includes > PageFooter.template
- Agora é só inserir a codificação
Testar
Agora após uma compra o seguinte popup deve aparecer.
Google Avaliações do Consumidor no Mobile:
Não há diferenciações nos métodos de instalação entre mobile e desktop.