ADAPT / CHANGE CHECKOUT PROCESS

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
David Haška
Posts: 10
Joined: 30 Aug 2018, 17:08

ADAPT / CHANGE CHECKOUT PROCESS

Post by David Haška » 30 Aug 2018, 17:22

Hi,

how can I change / adapt checkout process? And yeah, i have already read changes like change steps position etc.

My problem:
We want to have first choosing country and payment / delivery in first step and filling in address in second step but when i try to do it with onepage (address, payment, delivery), it does not change delivery / payment immediately because it requires confirm (we have some restrictions by countries).

So my question is, how can i make these changes asynchronous (for example with jquery ajax) or how can i adapt checkout process like this? And is it event possible to make it like this?

Thank you so much.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: ADAPT / CHANGE CHECKOUT PROCESS

Post by aimeos » 30 Aug 2018, 21:07

You could use the JSON API to add the country of the address first and fetch the delivery/payment options limited by the country decorator via the JSON API too. Then, you are not required to post any form data to the server.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

David Haška
Posts: 10
Joined: 30 Aug 2018, 17:08

Re: ADAPT / CHANGE CHECKOUT PROCESS

Post by David Haška » 31 Aug 2018, 07:35

Thank you so much for your answer.

OK. I have already find almost everything i need to do this.

Only one problem - i know how to fetch delivery/payment options (https://aimeos.org/docs/Developers/Clie ... t_services), but how to fetch them with country decorator / limitation. Simply which options with country limitation to use in JSOP API fetch call or how to tell JSON API that i have choosen some country during fetching these options?

I cant find it in documentation - https://aimeos.org/docs/Developers/Clie ... t_services

Thanks and have a good day :)

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: ADAPT / CHANGE CHECKOUT PROCESS

Post by aimeos » 01 Sep 2018, 14:03

If you use the JSON REST API to add an almost empty address to the basket with only the country set, the list of services will be filtered by the decorators you've assigned to them :-)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

David Haška
Posts: 10
Joined: 30 Aug 2018, 17:08

Re: ADAPT / CHANGE CHECKOUT PROCESS

Post by David Haška » 05 Sep 2018, 15:19

Everything is working like a charm now, but i have got one problem.

The problem is when i fetch list of delivery or payment providers with jsonapi, it does not care about Country decorator (if i disable some country i can still se delivery / payment options in fetch). But when i refresh page - delivery and payment options are filtered right.

Where is the problem?
Do i have to pass countryId when i am fetching delivery / payment options?

Thank you so much.

P.S.: I have succesfuly added countryId by JSONAPI -> https://aimeos.org/docs/Developers/Clie ... _addresses

P.S.2: I am using this for fetching delivery / payment address -> https://aimeos.org/docs/Developers/Clie ... t_services , but it does not use country decorator or does not use countryid set in address as i have already said before.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: ADAPT / CHANGE CHECKOUT PROCESS

Post by aimeos » 05 Sep 2018, 20:38

Are you sure you set the country ID first and then fetch the list of delivery/payment options? You have to wait for the first request to succeed until you can fire off the second to fetch the delivery/payment options
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

David Haška
Posts: 10
Joined: 30 Aug 2018, 17:08

Re: ADAPT / CHANGE CHECKOUT PROCESS

Post by David Haška » 06 Sep 2018, 09:47

Yes, i am 100% sure. Look at the code (fetching AJAX method is inside address AJAX DONE method):

Code: Select all

$("body").on("change", ".basket-standard-country select", function(ev) {

    var loadingText = $(".basket-standard").data("trans-loading");

    var $select = $(this);
    var $action = $(".btn-action");
    var $deliveryContent = $(".basket-standard-delivery .content");
    var $paymentContent = $(".basket-standard-payment .content");

    if (this.value === undefined) {
        var countryId = "";
    } else {
        var countryId = this.value;
    }

    $select.prop('disabled', 'disabled');
    $action.addClass('disabled');
    $deliveryContent.html("<span class='loading' style='display:block;width:30px;height:30px;'></span>");
    $paymentContent.html("<span class='loading' style='display:block;width:30px;height:30px;'></span>");

    var url = $(".basket-standard").data("jsonurl");

    $.ajax( url, {
        method: "OPTIONS",
        dataType: "json"
    })
        .done( function( optionsResult ) {
           var basketParams = {};

           var basketUrl = optionsResult.meta.resources['basket'];

           $.ajax({
               method: "GET",
               dataType: "json",
               url: basketUrl,
               data: basketParams
           })
               .done( function( basketResult ) {

                   var customerParams = {};

                   var customerUrl = optionsResult.meta.resources['customer'];

                   $.ajax({
                       method: "GET",
                       dataType: "json",
                       url: customerUrl,
                       data: customerParams
                   })
                       .done( function( customerResult ) {
                           if (customerResult != undefined && customerResult.errors == undefined) {
                               var languageId = basketResult.data.attributes['order.base.languageid'];
                               var currencyId = basketResult.data.attributes['order.base.currencyid'];
                               var addressUrl = basketResult.links['basket/address'].href +
                                   "&currency=" + currencyId;

                               if(optionsResult.meta.csrf) {
                                   var csrf = {};
                                   csrf[optionsResult.meta.csrf.name] = optionsResult.meta.csrf.value;
                                   addressUrl += (addressUrl.indexOf('?') === -1 ? '?' : '&') + $.param(csrf);
                               }

                               if (countryId == "") {
                                   countryId == customerResult.data.attributes["customer.countryid"];
                               }

                               var addressParams = {data: [{
                                       id: "payment",
                                       attributes: {
                                           "order.base.address.countryid": countryId,
                                           "order.base.address.salutation": customerResult.data.attributes["customer.salutation"],
                                           "order.base.address.company": customerResult.data.attributes["customer.company"],
                                           "order.base.address.vatid": customerResult.data.attributes["customer.vatid"],
                                           "order.base.address.title": customerResult.data.attributes["customer.title"],
                                           "order.base.address.firstname": customerResult.data.attributes["customer.firstname"],
                                           "order.base.address.lastname": customerResult.data.attributes["customer.lastname"],
                                           "order.base.address.address1": customerResult.data.attributes["customer.address1"],
                                           "order.base.address.address2": customerResult.data.attributes["customer.address2"],
                                           "order.base.address.address3": customerResult.data.attributes["customer.address3"],
                                           "order.base.address.postal": customerResult.data.attributes["customer.postal"],
                                           "order.base.address.city": customerResult.data.attributes["customer.city"],
                                           "order.base.address.state": customerResult.data.attributes["customer.state"],
                                           "order.base.address.languageid": customerResult.data.attributes["customer.languageid"],
                                           "order.base.address.telephone": customerResult.data.attributes["customer.telephone"],
                                           "order.base.address.email": customerResult.data.attributes["customer.email"],
                                           "order.base.address.telefax": customerResult.data.attributes["customer.telefax"],
                                           "order.base.address.website": customerResult.data.attributes["customer.website"],
                                           "order.base.address.longitude": customerResult.data.attributes["customer.longitude"],
                                           "order.base.address.latitude": customerResult.data.attributes["customer.latitude"],
                                       }
                                   }]};

                               $.ajax({
                                   method: "POST",
                                   dataType: "json",
                                   url: addressUrl,
                                   data: JSON.stringify( addressParams )
                               })
                                   .done( function ( addressResult ) {
                                       $.each( addressResult.included, function( index, value ) {
                                           if (value.type == "basket/address" && value.attributes["order.base.address.countryid"] == countryId) {
                                               var serviceParams = {};

                                               var serviceUrl = optionsResult.meta.resources['service'];

                                               $.ajax({
                                                   method: "GET",
                                                   dataType: "json",
                                                   url: serviceUrl,
                                                   data: serviceParams
                                               })
                                                   .done(function (serviceResult) {
                                                       console.log(serviceResult);
                                                       var deliveryServices = "";
                                                       var paymentServices = "";
                                                       var firstDelivery = "checked='checked'";
                                                       var firstPayment = "checked='checked'";

                                                       $.each(serviceResult.data, function (index, value) {
                                                           var serviceId = value.id;
                                                           var serviceType = value.attributes["service.type"];
                                                           var serviceLabel = value.attributes["service.label"];
                                                           var servicePrice = value.attributes.price["price.value"];
                                                           var serviceCurrencyId = value.attributes.price["price.currencyid"];
                                                           var serviceAttributes = value.links["basket/service"]["meta"];
                                                           var image = value.relationships.media.data[0];
                                                           var imageElement = "";

                                                           if (image != undefined) {
                                                               $.each(serviceResult.included, function (index, value) {
                                                                   if (value.type == "media" &&
                                                                       value.id == image.id &&
                                                                       (value.attributes["media.languageid"] == languageId ||
                                                                           value.attributes["media.languageid"] == null)) {
                                                                       var imageUrl = value.attributes["media.url"];
                                                                       // URL fix
                                                                       if (imageUrl.includes("files/")) {
                                                                           imageUrl = "/" + imageUrl;
                                                                       }
                                                                       var imageLabel = value.attributes["media.label"];
                                                                       imageElement = "<div class='icon'><img src='" + imageUrl + "' title='" + imageLabel + "'></div>";
                                                                   }
                                                               });
                                                           }

                                                           if (serviceType == "delivery") {
                                                               var attributesHtml = "";

                                                               if (serviceAttributes != undefined) {
                                                                   attributesHtml += "<ul class='form-list form-horizontal'>";

                                                                   $.each(serviceAttributes, function (index, value) {
                                                                       var attributeCode = value.code;
                                                                       var attributeType = value.type;
                                                                       var attributeLabel = value.label;
                                                                       var attributeRequired = value.required;
                                                                       var required = "";

                                                                       if (attributeRequired) {
                                                                           required = "mandatory"
                                                                       } else {
                                                                           required = "";
                                                                       }

                                                                       attributesHtml += "<li class='form-item form-group " + attributeCode + " " + required + "'>" +
                                                                           "<label class='col-md-5' for='delivery-" + attributeCode + "' class='form-item-label'>" +
                                                                           attributeLabel +
                                                                           "</label>";
                                                                       if (attributeType == "boolean") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='checkbox' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value='1' checked='checked'/></div>";
                                                                       } else if (attributeType == "integer" || attributeType == "number") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='number' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       } else if (attributeType == "date" || attributeType == "datetime" || attributeType == "time") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='" + attributeType + "' id=' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       } else if (attributeType == "text" || attributeType == "string") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='text' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       }

                                                                       attributesHtml += "</li>";
                                                                   });

                                                                   attributesHtml += "</ul>";
                                                               }

                                                               deliveryServices += "<div id='c_delivery-" + serviceId + "' class='item item-service row'>" +
                                                                   "<div class='col-sm-4'>" +
                                                                   "<label class='description' for='c_deliveryoption-" + serviceId + "'>" +
                                                                   "<input class='option' type='radio' id='c_deliveryoption-" + serviceId + "' name='c_deliveryoption' value='" + serviceId + "' " + firstDelivery + ">" +
                                                                   "<span class='price-value'>" + servicePrice + " " + serviceCurrencyId + "</span>" +
                                                                   "<div class='icons'>" +
                                                                   imageElement +
                                                                   "</div>" +
                                                                   "<h2>" + serviceLabel + "</h2>" +
                                                                   "</label>" +
                                                                   "</div>" +
                                                                   "<div class='col-sm-4'>" + attributesHtml + "</div>" +
                                                                   "<div class='col-sm-4'></div>" +
                                                                   "</div>";

                                                               firstDelivery = "";
                                                           }

                                                           if (serviceType == "payment") {
                                                               var attributesHtml = "";

                                                               if (serviceAttributes != undefined) {
                                                                   attributesHtml += "<ul class='form-list form-horizontal'>";

                                                                   $.each(serviceAttributes, function (index, value) {
                                                                       var attributeCode = value.code;
                                                                       var attributeType = value.type;
                                                                       var attributeLabel = value.label;
                                                                       var attributeRequired = value.required;
                                                                       var required = "";

                                                                       if (attributeRequired) {
                                                                           required = "mandatory"
                                                                       } else {
                                                                           required = "";
                                                                       }

                                                                       attributesHtml += "<li class='form-item form-group " + attributeCode + " " + required + "'>" +
                                                                           "<label class='col-md-5' for='delivery-" + attributeCode + "' class='form-item-label'>" +
                                                                           attributeLabel +
                                                                           "</label>";
                                                                       if (attributeType == "boolean") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='checkbox' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value='1' checked='checked'/></div>";
                                                                       } else if (attributeType == "integer" || attributeType == "number") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='number' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       } else if (attributeType == "date" || attributeType == "datetime" || attributeType == "time") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='" + attributeType + "' id=' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       } else if (attributeType == "text" || attributeType == "string") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='text' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       }

                                                                       attributesHtml += "</li>";
                                                                   });

                                                                   attributesHtml += "</ul>";
                                                               }

                                                               paymentServices += "<div id='c_delivery-" + serviceId + "' class='item item-service row'>" +
                                                                   "<div class='col-sm-4'>" +
                                                                   "<label class='description' for='c_deliveryoption-" + serviceId + "'>" +
                                                                   "<input class='option' type='radio' id='c_deliveryoption-" + serviceId + "' name='c_deliveryoption' value='" + serviceId + "' " + firstPayment + ">" +
                                                                   "<span class='price-value'></span>" +
                                                                   "<div class='icons'>" +
                                                                   imageElement +
                                                                   "</div>" +
                                                                   "<h2>" + serviceLabel + "</h2>" +
                                                                   "</label>" +
                                                                   "</div>" +
                                                                   "<div class='col-sm-4'>" + attributesHtml + "</div>" +
                                                                   "<div class='col-sm-4'></div>" +
                                                                   "</div>";

                                                               firstPayment = "";
                                                           }

                                                       })

                                                       $action.removeClass('disabled');
                                                       $select.prop('disabled', false);
                                                       $deliveryContent.html(deliveryServices);
                                                       $paymentContent.html(paymentServices);
                                                       AimeosCheckoutConfirm.init();
                                                   })
                                                   .fail(function (reason) {
                                                       console.log(reason);
                                                   });
                                           }
                                       });
                                   })
                                   .fail(function (reason) {
                                       console.log(reason);
                                   });
                           } else {
                               var languageId = basketResult.data.attributes['order.base.languageid'];
                               var currencyId = basketResult.data.attributes['order.base.currencyid'];
                               var addressUrl = basketResult.links['basket/address'].href +
                                   "&currency=" + currencyId;

                               if(optionsResult.meta.csrf) {
                                   var csrf = {};
                                   csrf[optionsResult.meta.csrf.name] = optionsResult.meta.csrf.value;
                                   addressUrl += (addressUrl.indexOf('?') === -1 ? '?' : '&') + $.param(csrf);
                               }

                               var addressParams = {data: [{
                                       id: "payment",
                                       attributes: {
                                           "order.base.address.countryid": countryId,
                                       }
                                   }]};

                               $.ajax({
                                   method: "POST",
                                   dataType: "json",
                                   url: addressUrl,
                                   data: JSON.stringify( addressParams )
                               })
                                   .done( function ( addressResult ) {

                                       $.each( addressResult.included, function( index, value ) {
                                           if (value.type == "basket/address" && value.attributes["order.base.address.countryid"] == countryId) {
                                               var serviceParams = {};

                                               var serviceUrl = optionsResult.meta.resources['service'];

                                               $.ajax({
                                                   method: "GET",
                                                   dataType: "json",
                                                   url: serviceUrl,
                                                   data: serviceParams
                                               })
                                                   .done(function (serviceResult) {
                                                       console.log(serviceResult);
                                                       var deliveryServices = "";
                                                       var paymentServices = "";
                                                       var firstDelivery = "checked='checked'";
                                                       var firstPayment = "checked='checked'";

                                                       $.each(serviceResult.data, function (index, value) {
                                                           var serviceId = value.id;
                                                           var serviceType = value.attributes["service.type"];
                                                           var serviceLabel = value.attributes["service.label"];
                                                           var servicePrice = value.attributes.price["price.value"];
                                                           var serviceCurrencyId = value.attributes.price["price.currencyid"];
                                                           var serviceAttributes = value.links["basket/service"]["meta"];
                                                           var image = value.relationships.media.data[0];
                                                           var imageElement = "";

                                                           if (image != undefined) {
                                                               $.each(serviceResult.included, function (index, value) {
                                                                   if (value.type == "media" &&
                                                                       value.id == image.id &&
                                                                       (value.attributes["media.languageid"] == languageId ||
                                                                           value.attributes["media.languageid"] == null)) {
                                                                       var imageUrl = value.attributes["media.url"];
                                                                       // URL fix
                                                                       if (imageUrl.includes("files/")) {
                                                                           imageUrl = "/" + imageUrl;
                                                                       }
                                                                       var imageLabel = value.attributes["media.label"];
                                                                       imageElement = "<div class='icon'><img src='" + imageUrl + "' title='" + imageLabel + "'></div>";
                                                                   }
                                                               });
                                                           }

                                                           if (serviceType == "delivery") {
                                                               var attributesHtml = "";

                                                               if (serviceAttributes != undefined) {
                                                                   attributesHtml += "<ul class='form-list form-horizontal'>";

                                                                   $.each(serviceAttributes, function (index, value) {
                                                                       var attributeCode = value.code;
                                                                       var attributeType = value.type;
                                                                       var attributeLabel = value.label;
                                                                       var attributeRequired = value.required;
                                                                       var required = "";

                                                                       if (attributeRequired) {
                                                                           required = "mandatory"
                                                                       } else {
                                                                           required = "";
                                                                       }

                                                                       attributesHtml += "<li class='form-item form-group " + attributeCode + " " + required + "'>" +
                                                                           "<label class='col-md-5' for='delivery-" + attributeCode + "' class='form-item-label'>" +
                                                                           attributeLabel +
                                                                           "</label>";
                                                                       if (attributeType == "boolean") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='checkbox' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value='1' checked='checked'/></div>";
                                                                       } else if (attributeType == "integer" || attributeType == "number") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='number' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       } else if (attributeType == "date" || attributeType == "datetime" || attributeType == "time") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='" + attributeType + "' id=' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       } else if (attributeType == "text" || attributeType == "string") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='text' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       }

                                                                       attributesHtml += "</li>";
                                                                   });

                                                                   attributesHtml += "</ul>";
                                                               }

                                                               deliveryServices += "<div id='c_delivery-" + serviceId + "' class='item item-service row'>" +
                                                                   "<div class='col-sm-4'>" +
                                                                   "<label class='description' for='c_deliveryoption-" + serviceId + "'>" +
                                                                   "<input class='option' type='radio' id='c_deliveryoption-" + serviceId + "' name='c_deliveryoption' value='" + serviceId + "' " + firstDelivery + ">" +
                                                                   "<span class='price-value'>" + servicePrice + " " + serviceCurrencyId + "</span>" +
                                                                   "<div class='icons'>" +
                                                                   imageElement +
                                                                   "</div>" +
                                                                   "<h2>" + serviceLabel + "</h2>" +
                                                                   "</label>" +
                                                                   "</div>" +
                                                                   "<div class='col-sm-4'>" + attributesHtml + "</div>" +
                                                                   "<div class='col-sm-4'></div>" +
                                                                   "</div>";

                                                               firstDelivery = "";
                                                           }

                                                           if (serviceType == "payment") {
                                                               var attributesHtml = "";

                                                               if (serviceAttributes != undefined) {
                                                                   attributesHtml += "<ul class='form-list form-horizontal'>";

                                                                   $.each(serviceAttributes, function (index, value) {
                                                                       var attributeCode = value.code;
                                                                       var attributeType = value.type;
                                                                       var attributeLabel = value.label;
                                                                       var attributeRequired = value.required;
                                                                       var required = "";

                                                                       if (attributeRequired) {
                                                                           required = "mandatory"
                                                                       } else {
                                                                           required = "";
                                                                       }

                                                                       attributesHtml += "<li class='form-item form-group " + attributeCode + " " + required + "'>" +
                                                                           "<label class='col-md-5' for='delivery-" + attributeCode + "' class='form-item-label'>" +
                                                                           attributeLabel +
                                                                           "</label>";
                                                                       if (attributeType == "boolean") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='checkbox' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value='1' checked='checked'/></div>";
                                                                       } else if (attributeType == "integer" || attributeType == "number") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='number' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       } else if (attributeType == "date" || attributeType == "datetime" || attributeType == "time") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='" + attributeType + "' id=' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       } else if (attributeType == "text" || attributeType == "string") {
                                                                           attributesHtml += "<div class='col-md-7'><input class='form-control col-md-7' type='text' id='delivery-" + attributeCode + "' name='c_delivery[" + serviceId + "][" + attributeCode + "]' value=''/></div>";
                                                                       }

                                                                       attributesHtml += "</li>";
                                                                   });

                                                                   attributesHtml += "</ul>";
                                                               }

                                                               paymentServices += "<div id='c_delivery-" + serviceId + "' class='item item-service row'>" +
                                                                   "<div class='col-sm-4'>" +
                                                                   "<label class='description' for='c_deliveryoption-" + serviceId + "'>" +
                                                                   "<input class='option' type='radio' id='c_deliveryoption-" + serviceId + "' name='c_deliveryoption' value='" + serviceId + "' " + firstPayment + ">" +
                                                                   "<span class='price-value'></span>" +
                                                                   "<div class='icons'>" +
                                                                   imageElement +
                                                                   "</div>" +
                                                                   "<h2>" + serviceLabel + "</h2>" +
                                                                   "</label>" +
                                                                   "</div>" +
                                                                   "<div class='col-sm-4'>" + attributesHtml + "</div>" +
                                                                   "<div class='col-sm-4'></div>" +
                                                                   "</div>";

                                                               firstPayment = "";
                                                           }

                                                       })

                                                       $action.removeClass('disabled');
                                                       $select.prop('disabled', false);
                                                       $deliveryContent.html(deliveryServices);
                                                       $paymentContent.html(paymentServices);
                                                       AimeosCheckoutConfirm.init();
                                                   })
                                                   .fail(function (reason) {
                                                       console.log(reason);
                                                   });
                                           }
                                       });

                                   })
                                   .fail(function (reason) {
                                       console.log(reason);
                                   });
                           }
                       })
                       .fail(function (reason) {
                           console.log(reason);
                       });;
               })
               .fail(function (reason) {
                   console.log(reason);
               });
        })
        .fail(function (reason) {
            console.log(reason);
        });
});

David Haška
Posts: 10
Joined: 30 Aug 2018, 17:08

Re: ADAPT / CHANGE CHECKOUT PROCESS

Post by David Haška » 06 Sep 2018, 12:02

I have already find out what is the problem. The problem was with PHP server which cache this (fetching) request, respectively the response for this response. I turn it off and it is working now.

Thank you so much for your patience.

Post Reply