Functions
[useCouponCode(props)] ⇒ [CouponCodeTalonProps]
This talon contains the logic for a coupon code form component. It performs effects and returns props data for rendering the component.
This talon performs the following effects:
- Fetch all coupons associated with the cart
- Manage the updating state of the cart while a coupon is being applied or removed
[useShippingForm(props)] ⇒ [ShippingFormTalonProps]
Contains logic for a shipping form component. It performs effects and returns props data related to rendering a shipping address form.
This talon performs the following effects:
- Manage the updating state of the cart while the mutation for setting the shipping address is in flight
[useShippingMethods(props)] ⇒ [ShippingMethodsTalonProps]
Contains logic for a shipping method selector component. It performs effect and returns props data used to render that component.
This talon performs the following effects:
- Set the shipping form visibility value based on the shipping methods associated with the cart
[useShippingRadios(props)] ⇒ [ShippingRadiosTalonProps]
Contains logic for a component that renders a radio selector for shipping. It performs effects and returns props data used for rendering that component.
This talon performs the following effects:
- Sets the value of the shipping method to a default value if there is no current method selected
- Manage the updating state of the cart while a shipping method is being applied
Typedefs
[CouponCodeMutations] : Object
GraphQL mutations for a cart's coupon code. This is a type used by the useCouponCode talon.
[CouponCodeQueries] : Object
GraphQL queries for a cart's coupon code. This is a type used by the useCouponCode talon.
[CouponCodeTalonProps] : Object
Object type returned by the useCouponCode talon. It provides props data to use when rendering a coupon code component.
[SelectShippingFields] : Object
Values for the select input fields on the shipping form. This is a prop used by the useShippingForm talon.
[ShippingFormMutations] : Object
GraphQL mutations for the shipping form. This is a type used by the useShippingForm talon.
[ShippingFormQueries] : Object
GraphQL queries for the shipping form. This is a type used by the useShippingForm talon.
[ShippingFormTalonProps] : Object
Object type returned by the useShippingForm talon. It provides props data to use when rendering a shipping form component.
[ShippingMethodsQueries] : Object
GraphQL queries for shipping methods. This is a type used in the useShippingMethods talon.
[ShippingMethodsTalonProps] : Object
Object type returned by the useShippingMethods talon. It provides prop data to use when rendering shipping methods.
[ShippingRadiosMutations] : Object
GraphQL mutations for a shipping radio selector component. This is a type used by the useShippingRadios talon.
[ShippingRadiosTalonProps] : Object
Object type returned by the useShippingRadios talon. It provides data to use when rendering a radio selector for shipping methods.
This talon contains the logic for a coupon code form component. It performs effects and returns props data for rendering the component.
This talon performs the following effects:
- Fetch all coupons associated with the cart
- Manage the updating state of the cart while a coupon is being applied or removed
Returns: Parameters
ObjectfunctionCouponCodeMutationsCouponCodeQueriesExample (Importing into your project)
import { useCouponCode } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/CouponCode/useCouponCode';
Contains logic for a shipping form component. It performs effects and returns props data related to rendering a shipping address form.
This talon performs the following effects:
- Manage the updating state of the cart while the mutation for setting the shipping address is in flight
Returns: Parameters
ObjectSelectShippingFieldsfunctionShippingFormMutationsShippingFormQueriesExample (Importing into your project)
import { useShippingForm } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/ShippingMethods/useShippingForm';
Contains logic for a shipping method selector component. It performs effect and returns props data used to render that component.
This talon performs the following effects:
- Set the shipping form visibility value based on the shipping methods associated with the cart
Returns: Parameters
ObjectShippingMethodsQueriesExample (Importing into your project)
import { useShippingMethods } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/ShippingMethods/useShippingMethods';
Contains logic for a component that renders a radio selector for shipping. It performs effects and returns props data used for rendering that component.
This talon performs the following effects:
- Sets the value of the shipping method to a default value if there is no current method selected
- Manage the updating state of the cart while a shipping method is being applied
Returns: Parameters
ObjectfunctionString$\{carrier-code}\ | $\{method-code\}, eg. usps|priority.Array.<Object>ShippingRadiosMutationsExample (Importing into your project)
import { useShippingRadios } from '@magento/peregrine/lib/talons/CartPage/PriceAdjustments/ShippingMethods/useShippingRadios';
GraphQL mutations for a cart's coupon code. This is a type used by the useCouponCode talon.
See: CouponCode.js for the queries used Venia
Properties
GraphQLASTGraphQLASTGraphQL queries for a cart's coupon code. This is a type used by the useCouponCode talon.
See: CouponCode.js for the queries used Venia
Properties
GraphQLASTObject type returned by the useCouponCode talon. It provides props data to use when rendering a coupon code component.
Properties
booleanObjectgetAppliedCouponsQuery.StringObjectfunctionfunctionfunctionfunctionbooleanValues for the select input fields on the shipping form. This is a prop used by the useShippingForm talon.
Properties
StringStringStringGraphQL mutations for the shipping form. This is a type used by the useShippingForm talon.
See: shippingForm.js for the query used in Venia
Properties
GraphQLASTGraphQL queries for the shipping form. This is a type used by the useShippingForm talon.
See: shippingMethods.gql.js for the query used in Venia
Properties
GraphQLASTObject type returned by the useShippingForm talon. It provides props data to use when rendering a shipping form component.
Properties
Array.<Error>functionfunctionfunctionbooleanGraphQL queries for shipping methods. This is a type used in the useShippingMethods talon.
See: shippingMethods.gql.js for the queries used in Venia
Properties
GraphQLASTObject type returned by the useShippingMethods talon. It provides prop data to use when rendering shipping methods.
Properties
numberbooleanSelectShippingFieldsString$\{carrier-code}\ |$\{method-code\}, eg. usps|priority.Array.<Object>functionisShowingForm value to true.functionisShowingForm value to true.GraphQL mutations for a shipping radio selector component. This is a type used by the useShippingRadios talon.
Properties
GraphQLASTObject type returned by the useShippingRadios talon. It provides data to use when rendering a radio selector for shipping methods.
Properties
ObjectfunctionSource Code: pwa-studio/packages/peregrine/lib/talons/CartPage/PriceAdjustments/CouponCode/useCouponCode.js