Hi guys,
I have recently found a problem in Rapido code.
The helper that adds the google impression code in the checkout, forces a redirect to an URL that does not exist: checkout.html.
See below.
@helper RenderScript() {
<script>
/**
* A function to handle a click on a checkout button. This function uses the eventCallback
* data layer variable to handle navigation after the ecommerce data has been sent to Google Analytics.
*/
dataLayer.push({
'event': 'checkout',
'ecommerce': {
'checkout': {
'actionField': {'step': 1},
'products': [
@foreach (LoopItem orderline in GetLoop("OrderLines"))
{
var groupObject = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(orderline.GetString("Ecom:Product.PrimaryOrFirstGroupID"));
<text>
{
'name': "@orderline.GetString("Ecom:Order:OrderLine.ProductName")",
'id': "@orderline.GetString("Ecom:Product.ID")",
'price': "@orderline.GetDouble("Ecom:Order:OrderLine.UnitPrice.Price")",
'brand': "@orderline.GetString("Ecom:Product:Field.brand.Value")",
'category': "@(groupObject != null ? groupObject.Name : "")",
'variant': "@orderline.GetString("Ecom:Order:OrderLine.ProductVariantID")",
'quantity': @orderline.GetInteger("Ecom:Order:OrderLine.Quantity")
},
</text>
}
]
}
},
'eventCallback': function() {
document.location = 'checkout.html';
}
});
</script>
}