Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Shopping cart grand total and taxes coverage #441

Merged
merged 10 commits into from
Apr 16, 2019

Conversation

rogyar
Copy link
Contributor

@rogyar rogyar commented Mar 5, 2019

Description (*)

This PR introduces a possibility to view cart totals as well as taxes applied within scope of the current shopping cart

Fixed Issues (if relevant)

  1. [Place order] Cart tax #426: [Place order] Cart tax
  2. [Place order] Cart grand total #425: [Place order] Cart grand total

Manual testing scenarios (*)

  1. Configure taxes for products/zones/customer
  2. Add a taxable product to the shopping cart
  3. Assign shipping address (that corresponds a taxable zone) to the shopping cart
  4. Use the following query to check the totals and taxes:
{
  cart(cart_id: "$cart_id") {
    prices {
      grand_total {
        value,
        currency
      }
      subtotal_including_tax {
        value
        currency
      }
      subtotal_excluding_tax {
        value
        currency
      }
      subtotal_with_discount_excluding_tax {
        value
        currency
      }
      applied_taxes {
        label
        amount {
          value
          currency
        }
      }
    }
  }
}

@rogyar rogyar force-pushed the 245-cart-grand-total branch from 0f0637b to 4b89ee0 Compare March 6, 2019 15:42
# Conflicts:
#	app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@TomashKhamlai TomashKhamlai self-assigned this Apr 11, 2019
@TomashKhamlai TomashKhamlai added the QA in progress We are checking label Apr 11, 2019
@TomashKhamlai
Copy link
Contributor

@rogyar, do you know anything about?

1 exception(s):
Exception #0 (BadMethodCallException): Missing required argument $msrpPriceCalculators of Magento\Msrp\Pricing\MsrpPriceCalculator.

Exception #0 (BadMethodCallException): Missing required argument $msrpPriceCalculators of Magento\Msrp\Pricing\MsrpPriceCalculator.

It looks like not connected with your pull request, however the defect was found on this branch.

@rogyar
Copy link
Contributor Author

rogyar commented Apr 11, 2019

Hi @TomashKhamlai. Didn't get something like this. Please, try the recent version, I've merged the mainline commits to the current branch.
If you still experience this issue, please describe steps to reproduce, so I can figure out what goes wrong.
Thank you

@TomashKhamlai
Copy link
Contributor

TomashKhamlai commented Apr 11, 2019

magento2#22190

@TomashKhamlai
Copy link
Contributor

Got this:

{
   "data" : {
      "cart" : {
         "prices" : {
            "grand_total" : {
               "value" : 10.83,
               "currency" : "USD"
            },
            "subtotal_excluding_tax" : {
               "value" : 10,
               "currency" : "USD"
            },
            "subtotal_including_tax" : {
               "currency" : "USD",
               "value" : 10.83
            },
            "applied_taxes" : [
               {
                  "amount" : {
                     "value" : 0.83,
                     "currency" : "USD"
                  },
                  "label" : "US-CA-*-Rate 1"
               }
            ],
            "subtotal_with_discount_excluding_tax" : {
               "value" : 10,
               "currency" : "USD"
            }
         }
      }
   }
}

I am not sure but I it looks like value is cropped. I believe that value should have format {integer number}{localized decimal sign}{fraction according to currency}. Pay attention that some currency has 3 positions after decimal sign and if I not mistaken some of the currency do not have fraction. In USD the value should be:
10.00
in subtotal_excluding_tax.value and subtotal_with_discount_excluding_tax.value

@magento-engcom-team magento-engcom-team merged commit c617619 into 2.3-develop Apr 16, 2019
@ghost
Copy link

ghost commented Apr 16, 2019

Hi @rogyar, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@keharper
Copy link
Contributor

Documented as part of magento/devdocs#4502

@lenaorobei lenaorobei deleted the 245-cart-grand-total branch September 10, 2019 19:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants