A
Alokai•14mo ago
Sky

Not displaying the correct row total in cart page

My vue storefront is not displaying the row total including tax when I have already set to display price including tax in magento configuration.
No description
No description
6 Replies
skirianov
skirianov•14mo ago
can you please add info if you're using SDK or VSF2. Also, can you please show me the code you use to display price and the response object you're receiving from Magento
Sky
Sky•14mo ago
Cart.vue is the code I am using to display cart item price. message.txt is the response object I am receiving from magento , this should be the graphql query used: https://github.com/vuestorefront/magento2/blob/main/packages/api-client/src/api/customerCart/customerCart.ts I am using VSF2.
GitHub
magento2/packages/api-client/src/api/customerCart/customerCart.ts a...
Vue Storefront 2 integration for Magento 2. Contribute to vuestorefront/magento2 development by creating an account on GitHub.
Sky
Sky•14mo ago
It is displaying row total instead of row total including tax
skirianov
skirianov•14mo ago
okay, I'm on it, brb alright, in your store, please find modules/checkout/getters/cartGetters,ts - this is the file where getItemPrice getter is declared. You will see that we return an object with different prices and one of them is total: total: product.prices?.row_total?.value,. If you look at your response object, there is product.prices.row_total_including_tax property. You can add additional return value to getItemPrice named totalWithTax: product.prices?.row_total_including_tax?.value - and then replace $fc(cartGetters.getItemPrice(product).regular - regular with totalWithTax Let me know if that helped
Sky
Sky•14mo ago
Alright, it works. Thank you.
skirianov
skirianov•14mo ago
awesome 🙂 Marking as solved
Want results from more Discord servers?
Add your server