Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent json response when updating cart. #1293

Closed
samhibberd opened this issue Feb 21, 2020 · 1 comment
Closed

Inconsistent json response when updating cart. #1293

samhibberd opened this issue Feb 21, 2020 · 1 comment
Labels

Comments

@samhibberd
Copy link

samhibberd commented Feb 21, 2020

Adding items to the cart using ajax commerce/carts/update-cart returns zero values in the cart json:

cart: {
    ...
    storedTotalPrice: "288.0000"
    storedTotalPaid: "0.0000"
    storedItemTotal: "288.0000"
    storedTotalShippingCost: "0.0000"
    storedTotalDiscount: "0.0000"
    storedTotalTax: "48.0000"
    storedTotalTaxIncluded: "0.0000"
    adjustmentSubtotal: 50
    adjustmentsTotal: 50
    isPaid: false
    itemSubtotal: 250
    itemTotal: 300
    lineItems: [,…]
    orderAdjustments: []
    outstandingBalance: 300
    paidStatus: "unpaid"
    recalculationMode: "all"
    shortNumber: "ced4cfd"
    totalPaid: 0
    total: 300
    totalPrice: 300
    totalQty: 21
    totalSaleAmount: 0
    totalTaxablePrice: 250
    totalWeight: 0
    adjustmentSubtotalAsCurrency: "£0"
    adjustmentsTotalAsCurrency: "£0"
    itemSubtotalAsCurrency: "£0"
    itemTotalAsCurrency: "£0"
    outstandingBalanceAsCurrency: "£0"
    totalPaidAsCurrency: "£0"
    totalAsCurrency: "£0"
    totalPriceAsCurrency: "£300.00"
    totalSaleAmountAsCurrency: "£0"
    totalTaxablePriceAsCurrency: "£0"
    totalTaxAsCurrency: "£0"
    totalTaxIncludedAsCurrency: "£0"
    totalShippingCostAsCurrency: "£0"
    totalDiscountAsCurrency: "£0"
    totalTax: 50
    totalTaxIncluded: 0
    totalShippingCost: 0
    totalDiscount: 0
    ...
}

The incorrect values are also reflected in the cp order view, see Total Price: £0.

Screenshot 2020-02-21 at 10 23 21

Craft CMS 3.4.7.1
Commerce 3.0.10

@samhibberd samhibberd changed the title Add Inconsistent json response when updating cart. Feb 21, 2020
@nfourtythree
Copy link
Contributor

Hi @samhibberd

Thank you for bringing this to our attention. We have pushed an update that fixes this issue and it will be included in the next release.

To get this early, change your craftcms/commerce requirement in composer.json to:

"require": {
  "craftcms/commerce": "dev-develop#1029f46a084111897c709cfe0e56257dbc2a482d as 3.0.10",
  "...": "..."
}

Then run composer update.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants