Developer forum

Forum » Integration » Cart calculation failed

Cart calculation failed

Caro De Weze
Reply

Hi,

The cart calculation is not complete. There is an order line that is not taken into account on the frontend. 

If we follow the checkout flow, the sales tax is not shown or calculated anywhere in the cart summary from Swift. This is calculated correctly on the checkout success page and in the backend:

Does anyone know what's going wrong? I assume I'm not supposed to add this to the template myself and adjust the calculation?

Kind regards,
Caro De Weze


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Caro,
what is your setup? Do you use Live integration or is it just a standard setup? What Dynamicweb version do you use?
Can you try to set the option "Organize orderlines so discounts and taxes are grouped with their parent orderlines" to ON/OFF and check if it helps?
https://doc.dynamicweb.com/Default.aspx?ID=9113#6663
BR, Dmitrij

 
Caro De Weze
Reply

Hi Dmitrij,

I use live integration in DW10 ring 1. Switching on/off the option 'Organize orderlines so discounts and taxes are grouped with their parent orderlines' unfortunately doesn't do the trick.

Kind regards,
Caro De Weze

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Caro,
Is this tax order line some custom order line coming from ther ERP or is it configured using standard Dynamicweb functionality?
What is your ERP system?
BR, Dmitirj

 
Caro De Weze
Reply

Hi Dmitirj,

I use the basic NAV. Here's the response:
10/10/2024 01:23:29.728 p.m.: DebugInfo: Response CalculateOrder (ID: ORDER918, CreateOrder: True) received: '
<?xml version="1.0" encoding="utf-8"?>
<tables version="1.2.0.19_NAV1.0.25940">
    <table tableName="EcomOrderLines">
        <item table="EcomOrderLines">
            <column columnName="OrderLineProductNumber">
                <![CDATA[A000003]]>
            </column>
            <column columnName="OrderLineProductVariantId">
                <![CDATA[]]>
            </column>
            <column columnName="OrderLineUnitId">
                <![CDATA[Unit_ST]]>
            </column>
            <column columnName="OrderLineId">
                <![CDATA[10000]]>
            </column>
            <column columnName="OrderLineQuantity">
                <![CDATA[200]]>
            </column>
            <column columnName="OrderLineType">
                <![CDATA[0]]>
            </column>
            <column columnName="OrderLinePriceWithoutVat">
                <![CDATA[3,186.3]]>
            </column>
            <column columnName="OrderLineUnitPriceWithoutVat">
                <![CDATA[15.9315]]>
            </column>
            <column columnName="OrderLinePriceWithVat">
                <![CDATA[3,855.42]]>
            </column>
            <column columnName="OrderLineUnitPriceWithVat">
                <![CDATA[19.28]]>
            </column>
            <column columnName="OrderLinePriceVat">
                <![CDATA[669.12]]>
            </column>
            <column columnName="OrderLineUnitPriceVat">
                <![CDATA[3.35]]>
            </column>
            <column columnName="OrderLinePriceVatPercent">
                <![CDATA[21]]>
            </column>
            <column columnName="OrderLineUnitPriceVatPercent">
                <![CDATA[21]]>
            </column>
        </item>
        <item table="EcomOrderLines">
            <column columnName="OrderLineProductNumber">
                <![CDATA[A000003]]>
            </column>
            <column columnName="OrderLineProductVariantId">
                <![CDATA[]]>
            </column>
            <column columnName="OrderLineUnitId">
                <![CDATA[Unit_ST]]>
            </column>
            <column columnName="OrderLineParentLineId">
                <![CDATA[10000]]>
            </column>
            <column columnName="OrderLineType">
                <![CDATA[3]]>
            </column>
            <column columnName="OrderLineQuantity">
                <![CDATA[1]]>
            </column>
            <column columnName="OrderLinePriceWithoutVat">
                <![CDATA[1,672.81]]>
            </column>
            <column columnName="OrderLineUnitPriceWithoutVat">
                <![CDATA[1,672.81]]>
            </column>
            <column columnName="OrderLinePriceWithVat">
                <![CDATA[2,024.1]]>
            </column>
            <column columnName="OrderLineUnitPriceWithVat">
                <![CDATA[2,024.1]]>
            </column>
            <column columnName="OrderLineDiscountPercentage">
                <![CDATA[52.5]]>
            </column>
            <column columnName="OrderLinePriceVat">
                <![CDATA[351.29]]>
            </column>
            <column columnName="OrderLineUnitPriceVat">
                <![CDATA[351.29]]>
            </column>
            <column columnName="OrderLinePriceVatPercent">
                <![CDATA[21]]>
            </column>
            <column columnName="OrderLineUnitPriceVatPercent">
                <![CDATA[21]]>
            </column>
        </item>
        <item table="EcomOrderLines">
            <column columnName="OrderLineProductNumber">
                <![CDATA[4.51]]>
            </column>
            <column columnName="OrderLineProductVariantId">
                <![CDATA[]]>
            </column>
            <column columnName="OrderLineParentLineId">
                <![CDATA[20000]]>
            </column>
            <column columnName="OrderLineType">
                <![CDATA[4]]>
            </column>
            <column columnName="OrderLineQuantity">
                <![CDATA[200]]>
            </column>
            <column columnName="OrderLineProductName">
                <![CDATA[Recupel Battery chargers]]>
            </column>
            <column columnName="OrderLinePriceWithoutVat">
                <![CDATA[11.58]]>
            </column>
            <column columnName="OrderLineUnitPriceWithoutVat">
                <![CDATA[0.0579]]>
            </column>
            <column columnName="OrderLinePriceWithVat">
                <![CDATA[14.0118]]>
            </column>
            <column columnName="OrderLineUnitPriceWithVat">
                <![CDATA[0.07006]]>
            </column>
            <column columnName="OrderLinePriceVat">
                <![CDATA[2.4318]]>
            </column>
            <column columnName="OrderLineUnitPriceVat">
                <![CDATA[0.01216]]>
            </column>
            <column columnName="OrderLinePriceVatPercent">
                <![CDATA[21]]>
            </column>
            <column columnName="OrderLineUnitPriceVatPercent">
                <![CDATA[21]]>
            </column>
        </item>
    </table>
    <table tableName="EcomOrders">
        <item table="EcomOrders">
            <column columnName="OrderShippingMethodName">
                <![CDATA[Levering]]>
            </column>
            <column columnName="OrderShippingMethodId">
                <![CDATA[SHIP18]]>
            </column>
            <column columnName="OrderShippingFee">
                <![CDATA[0]]>
            </column>
            <column columnName="OrderCreated">
                <![CDATA[TRUE]]>
            </column>
            <column columnName="OrderId">
                <![CDATA[VOR24/022293]]>
            </column>
            <column columnName="OrderCurrencyCode">
                <![CDATA[]]>
            </column>
            <column columnName="OrderDate">
                <![CDATA[10/10/24]]>
            </column>
            <column columnName="OrderPaymentMethodName">
                <![CDATA[OVERSCHR]]>
            </column>
            <column columnName="OrderCustomerName">
                <![CDATA[S.T.I.B. - M.I.V.B.]]>
            </column>
            <column columnName="OrderCustomerAddress">
                <![CDATA[Rue Royale 76]]>
            </column>
            <column columnName="OrderCustomerAddress2">
                <![CDATA[]]>
            </column>
            <column columnName="OrderCustomerCity">
                <![CDATA[BRUXELLES 1]]>
            </column>
            <column columnName="OrderCustomerCountryCode">
                <![CDATA[BE]]>
            </column>
            <column columnName="OrderCustomerEmail">
                <![CDATA[]]>
            </column>
            <column columnName="OrderCustomerFax">
                <![CDATA[]]>
            </column>
            <column columnName="OrderCustomerPhone">
                <![CDATA[]]>
            </column>
            <column columnName="OrderCustomerZip">
                <![CDATA[1000]]>
            </column>
            <column columnName="OrderDeliveryName">
                <![CDATA[S.T.I.B. - M.I.V.B.]]>
            </column>
            <column columnName="OrderDeliveryAddress">
                <![CDATA[Rue Royale 76]]>
            </column>
            <column columnName="OrderDeliveryAddress2">
                <![CDATA[]]>
            </column>
            <column columnName="OrderDeliveryCity">
                <![CDATA[BRUXELLES 1]]>
            </column>
            <column columnName="OrderDeliveryCountryCode">
                <![CDATA[BE]]>
            </column>
            <column columnName="OrderDeliveryEmail">
                <![CDATA[]]>
            </column>
            <column columnName="OrderDeliveryFax">
                <![CDATA[]]>
            </column>
            <column columnName="OrderDeliveryPhone">
                <![CDATA[]]>
            </column>
            <column columnName="OrderDeliveryZip">
                <![CDATA[1000]]>
            </column>
            <column columnName="OrderPriceWithVat">
                <![CDATA[1,845.3318]]>
            </column>
            <column columnName="OrderPriceWithoutVat">
                <![CDATA[1,525.07]]>
            </column>
            <column columnName="OrderPriceVat">
                <![CDATA[320.2618]]>
            </column>
            <column columnName="OrderSalesDiscount">
                <![CDATA[1,672.81]]>
            </column>
            <column columnName="OrderExternalDocumentNo">
                <![CDATA[]]>
            </column>
            <column columnName="OrderYourReference">
                <![CDATA[bestelref]]>
            </column>
            <column columnName="OrderOrderCustomerComment">
                <![CDATA[opmerking]]>
            </column>
            <column columnName="OrderOrderReference">
                <![CDATA[bestelref]]>
            </column>
            <column columnName="OrderOrderShippingDate">
                <![CDATA[]]>
            </column>
            <column columnName="OrderOrderID">
                <![CDATA[]]>
            </column>
            <column columnName="CompletelyPaid">
                <![CDATA[]]>
            </column>
            <column columnName="RemainingAmount">
                <![CDATA[0]]>
            </column>
        </item>
    </table>
</tables>

Kind regards,
Caro De Weze

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Caro,
the problem is that in the last OrderLine (of type Tax=4) the field OrderLineProductNumber has a value of "4.51" which does not belong to any existing product number from the products order lines, so it needs to have a value of "A000003" instead, then the tax order line will be associated as a child of product parent order line.
Try to fix the response for that tax order line field and check if it helps.
BR, Dmitrij

 
Caro De Weze
Reply

Hi Dmitirj,

Unfortunately this doesn't help and the data is correct:

10/28/2024 04:00:42.538 p.m.: DebugInfo: Response CalculateOrder (ID: ORDER950, CreateOrder: True) received: '
<?xml version="1.0" encoding="utf-8"?>
<tables version="1.2.0.19_NAV1.0.25940">
    <table tableName="EcomOrderLines">
        <item table="EcomOrderLines">
            <column columnName="OrderLineProductNumber">
                <![CDATA[A000003]]>
            </column>
            <column columnName="OrderLineProductVariantId">
                <![CDATA[]]>
            </column>
            <column columnName="OrderLineUnitId">
                <![CDATA[Unit_ST]]>
            </column>
            <column columnName="OrderLineId">
                <![CDATA[10000]]>
            </column>
            <column columnName="OrderLineQuantity">
                <![CDATA[100]]>
            </column>
            <column columnName="OrderLineType">
                <![CDATA[0]]>
            </column>
            <column columnName="OrderLinePriceWithoutVat">
                <![CDATA[1,593.15]]>
            </column>
            <column columnName="OrderLineUnitPriceWithoutVat">
                <![CDATA[15.9315]]>
            </column>
            <column columnName="OrderLinePriceWithVat">
                <![CDATA[1,927.71]]>
            </column>
            <column columnName="OrderLineUnitPriceWithVat">
                <![CDATA[19.28]]>
            </column>
            <column columnName="OrderLinePriceVat">
                <![CDATA[334.56]]>
            </column>
            <column columnName="OrderLineUnitPriceVat">
                <![CDATA[3.35]]>
            </column>
            <column columnName="OrderLinePriceVatPercent">
                <![CDATA[21]]>
            </column>
            <column columnName="OrderLineUnitPriceVatPercent">
                <![CDATA[21]]>
            </column>
        </item>
        <item table="EcomOrderLines">
            <column columnName="OrderLineProductNumber">
                <![CDATA[A000003]]>
            </column>
            <column columnName="OrderLineProductVariantId">
                <![CDATA[]]>
            </column>
            <column columnName="OrderLineUnitId">
                <![CDATA[Unit_ST]]>
            </column>
            <column columnName="OrderLineParentLineId">
                <![CDATA[10000]]>
            </column>
            <column columnName="OrderLineType">
                <![CDATA[3]]>
            </column>
            <column columnName="OrderLineQuantity">
                <![CDATA[1]]>
            </column>
            <column columnName="OrderLinePriceWithoutVat">
                <![CDATA[836.40]]>
            </column>
            <column columnName="OrderLineUnitPriceWithoutVat">
                <![CDATA[836.40]]>
            </column>
            <column columnName="OrderLinePriceWithVat">
                <![CDATA[1,012.04]]>
            </column>
            <column columnName="OrderLineUnitPriceWithVat">
                <![CDATA[1,012.04]]>
            </column>
            <column columnName="OrderLineDiscountPercentage">
                <![CDATA[52.5]]>
            </column>
            <column columnName="OrderLinePriceVat">
                <![CDATA[175.64]]>
            </column>
            <column columnName="OrderLineUnitPriceVat">
                <![CDATA[175.64]]>
            </column>
            <column columnName="OrderLinePriceVatPercent">
                <![CDATA[21]]>
            </column>
            <column columnName="OrderLineUnitPriceVatPercent">
                <![CDATA[21]]>
            </column>
        </item>
        <item table="EcomOrderLines">
            <column columnName="OrderLineProductNumber">
                <![CDATA[A000003]]>
            </column>
            <column columnName="OrderLineProductVariantId">
                <![CDATA[]]>
            </column>
            <column columnName="OrderLineParentLineId">
                <![CDATA[20000]]>
            </column>
            <column columnName="OrderLineType">
                <![CDATA[4]]>
            </column>
            <column columnName="OrderLineQuantity">
                <![CDATA[100]]>
            </column>
            <column columnName="OrderLineProductName">
                <![CDATA[Recupel Battery chargers]]>
            </column>
            <column columnName="OrderLinePriceWithoutVat">
                <![CDATA[5.79]]>
            </column>
            <column columnName="OrderLineUnitPriceWithoutVat">
                <![CDATA[0.0579]]>
            </column>
            <column columnName="OrderLinePriceWithVat">
                <![CDATA[7.0059]]>
            </column>
            <column columnName="OrderLineUnitPriceWithVat">
                <![CDATA[0.07006]]>
            </column>
            <column columnName="OrderLinePriceVat">
                <![CDATA[1.2159]]>
            </column>
            <column columnName="OrderLineUnitPriceVat">
                <![CDATA[0.01216]]>
            </column>
            <column columnName="OrderLinePriceVatPercent">
                <![CDATA[21]]>
            </column>
            <column columnName="OrderLineUnitPriceVatPercent">
                <![CDATA[21]]>
            </column>
        </item>
    </table>
    <table tableName="EcomOrders">
        <item table="EcomOrders">
            <column columnName="OrderShippingMethodName">
                <![CDATA[Afhalen]]>
            </column>
            <column columnName="OrderShippingMethodId">
                <![CDATA[SHIP17]]>
            </column>
            <column columnName="OrderShippingFee">
                <![CDATA[0]]>
            </column>
            <column columnName="OrderCreated">
                <![CDATA[TRUE]]>
            </column>
            <column columnName="OrderId">
                <![CDATA[VOR24/043942]]>
            </column>
            <column columnName="OrderCurrencyCode">
                <![CDATA[]]>
            </column>
            <column columnName="OrderDate">
                <![CDATA[10/28/24]]>
            </column>
            <column columnName="OrderPaymentMethodName">
                <![CDATA[OVERSCHR]]>
            </column>
            <column columnName="OrderCustomerName">
                <![CDATA[S.T.I.B. - M.I.V.B.]]>
            </column>
            <column columnName="OrderCustomerAddress">
                <![CDATA[Rue Royale 76]]>
            </column>
            <column columnName="OrderCustomerAddress2">
                <![CDATA[]]>
            </column>
            <column columnName="OrderCustomerCity">
                <![CDATA[BRUXELLES 1]]>
            </column>
            <column columnName="OrderCustomerCountryCode">
                <![CDATA[BE]]>
            </column>
            <column columnName="OrderCustomerEmail">
                <![CDATA[]]>
            </column>
            <column columnName="OrderCustomerFax">
                <![CDATA[]]>
            </column>
            <column columnName="OrderCustomerPhone">
                <![CDATA[]]>
            </column>
            <column columnName="OrderCustomerZip">
                <![CDATA[1000]]>
            </column>
            <column columnName="OrderDeliveryName">
                <![CDATA[S.T.I.B. - M.I.V.B.]]>
            </column>
            <column columnName="OrderDeliveryAddress">
                <![CDATA[Rue Royale 76]]>
            </column>
            <column columnName="OrderDeliveryAddress2">
                <![CDATA[]]>
            </column>
            <column columnName="OrderDeliveryCity">
                <![CDATA[BRUXELLES 1]]>
            </column>
            <column columnName="OrderDeliveryCountryCode">
                <![CDATA[BE]]>
            </column>
            <column columnName="OrderDeliveryEmail">
                <![CDATA[davy.capiau@ewings.be]]>
            </column>
            <column columnName="OrderDeliveryFax">
                <![CDATA[]]>
            </column>
            <column columnName="OrderDeliveryPhone">
                <![CDATA[02/515.34.91]]>
            </column>
            <column columnName="OrderDeliveryZip">
                <![CDATA[1000]]>
            </column>
            <column columnName="OrderPriceWithVat">
                <![CDATA[922.6759]]>
            </column>
            <column columnName="OrderPriceWithoutVat">
                <![CDATA[762.54]]>
            </column>
            <column columnName="OrderPriceVat">
                <![CDATA[160.1359]]>
            </column>
            <column columnName="OrderSalesDiscount">
                <![CDATA[836.4]]>
            </column>
            <column columnName="OrderExternalDocumentNo">
                <![CDATA[]]>
            </column>
            <column columnName="OrderYourReference">
                <![CDATA[ref]]>
            </column>
            <column columnName="OrderOrderCustomerComment">
                <![CDATA[test recupel in cart]]>
            </column>
            <column columnName="OrderOrderReference">
                <![CDATA[ref]]>
            </column>
            <column columnName="OrderOrderShippingDate">
                <![CDATA[]]>
            </column>
            <column columnName="OrderOrderId">
                <![CDATA[ORDER950]]>
            </column>
            <column columnName="CompletelyPaid">
                <![CDATA[]]>
            </column>
            <column columnName="RemainingAmount">
                <![CDATA[0]]>
            </column>
        </item>
    </table>
</tables>'.

Kind regards,
Caro De Weze

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Caro,
the next problem that can cause this issue is not correct UnitId in the Tax OrderLine, so if you have in the Live integration option "Use unit prices" ON then the correct unit id is also needed in the response. Your product order line has it set to:
<column columnName="OrderLineUnitId"> <![CDATA[Unit_ST]]> </column>
and also it is present on the discount order line (type 3) but missed in the last order line (type 4), so can you add the correct UnitId to the response or disable the option "Use unit prices" and try again?
Also check if you are using the latest version of the Live integration in your solution (Settings->Developer->Nuget)
BR, Dmitrij

 
Davy Capiau
Reply

HI Dmitriy,

I'm following up for Caro.

- We didn't have 'unit prices' on, but we enabled it
- We added the value on line type 4 (see below)
- We upgraded the live integration to the latest 10.4.9

I want to make a difference between the cart and the order success page:

- The cart:

It's not in the response, so we'r still looking into it

- The order success page:

These are the responses we've been talking about. As you see it's in the response. The only problem we have is that the 'label' (='OrderLineProductName') doesn't render properly. It shows a default 'Sales Tax', as you see in the screenshot below.

 

    <item table="EcomOrderLines">
      <column columnName="OrderLineProductNumber">
        <![CDATA[A000003]]>
      </column>
      <column columnName="OrderLineProductVariantId">
        <![CDATA[]]>
      </column>
      <column columnName="OrderLineUnitId">
        <![CDATA[Unit_ST]]>
      </column>
      <column columnName="OrderLineParentLineId">
        <![CDATA[20000]]>
      </column>
      <column columnName="OrderLineType">
        <![CDATA[4]]>
      </column>
      <column columnName="OrderLineQuantity">
        <![CDATA[1]]>
      </column>
      <column columnName="OrderLineProductName">
        <![CDATA[Recupel Battery chargers]]>
      </column>
      <column columnName="OrderLinePriceWithoutVat">
        <![CDATA[0.0579]]>
      </column>
      <column columnName="OrderLineUnitPriceWithoutVat">
        <![CDATA[0.0579]]>
      </column>
      <column columnName="OrderLinePriceWithVat">
        <![CDATA[0.07006]]>
      </column>
      <column columnName="OrderLineUnitPriceWithVat">
        <![CDATA[0.07006]]>
      </column>
      <column columnName="OrderLinePriceVat">
        <![CDATA[0.01216]]>
      </column>
      <column columnName="OrderLineUnitPriceVat">
        <![CDATA[0.01216]]>
      </column>
      <column columnName="OrderLinePriceVatPercent">
        <![CDATA[21]]>
      </column>
      <column columnName="OrderLineUnitPriceVatPercent">
        <![CDATA[21]]>
      </column>
    </item>
 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Davy,
you can change the text 'Sales tax' which is hardcoded in the templates code.
Try in those files:
Files\Templates\Designs\Swift\eCom7\CartV2\Step\Helpers\OrderSummary.cshtml
Files\Templates\Designs\Swift\Swift_CartSummary.cshtml
BR, Dmitrij
 

 

You must be logged in to post in the forum