imranhsayed / woo-next

:rocket: React WooCommerce theme, built with Next JS, Webpack, Babel, Node, Express, using GraphQL and Apollo Client
https://codeytek.com/course/woocommerce-with-react-course/
881 stars 256 forks source link

Shipping costs based on configured Shipping zones are not accounted for in the front end #104

Open brianpereradap opened 2 years ago

brianpereradap commented 2 years ago

Steps:

Expected:

Actual:

Looks like the front-end implementation for the above is still not available on this project. Any idea on how to achieve it?

fabiojundev commented 2 years ago

I'm also interested in this feature.

I changed the graphql in get-cart.js to include the available shipping methods, but the rates only works in the graphiQL IDE (only the flat rate works in the front end)

get-cart.js file: import { gql } from "@apollo/client";

const GET_CART = gql query GET_CART { cart { contents { nodes { key product { node { id productId: databaseId name description type onSale slug averageRating reviewCount image { id sourceUrl srcSet altText title } galleryImages { nodes { id sourceUrl srcSet altText title } } } } variation { node { id variationId: databaseId name description type onSale price regularPrice salePrice image { id sourceUrl srcSet altText title } } attributes { id name value } } quantity total subtotal subtotalTax } } appliedCoupons { code discountAmount discountTax } subtotal subtotalTax shippingTax shippingTotal total totalTax feeTax feeTotal discountTax discountTotal availableShippingMethods { packageDetails rates { id label cost methodId } } } } ;

export default GET_CART;

thefoxes86 commented 2 years ago

I'm interested to this issue too.