@acromedia/gesso-drupal-commerce
6.2.2
Patch Changes
- e60450e: Add a secondary jsonapi option for fetching product details with drupal commerce
6.2.1
Patch Changes
- 4cca8e8: Cart was using both the Drupal supplied cart and the cookie supplied one, sometimes causing conflicts
6.2.0
Minor Changes
- da18e67: Update types related to Order and PageInfo, moving them to the Core package
Patch Changes
- f2d42d2: Include possible attributes on orders query for display on order details
- Updated dependencies [da18e67]
- @acromedia/gesso-core@6.2.0
6.1.11
Patch Changes
- 76a1990: Include basic product information on the product object even if no variations are found
- 0907fd1: Fix: return selected options under optionSelections instead of selectedOptions.
- a98eeac: Fix: properly map selected cart item options to
properties.optionsSelected
property. - 76a1990: Make retrieving the default variation more robust in the useProductSearch query for drupal commerce
- Updated dependencies [a98eeac]
- Updated dependencies [a98eeac]
- @acromedia/gesso-core@6.1.4
6.1.10
Patch Changes
- f3b68ba: Make sure drupal commerce plugin for useProductSearch returns the formattedDescription in addition to the description
6.1.9
Patch Changes
- 2baff6e: Fix: return placed attribute instead of created attribute for the created property in drupal-commerce order plugin response as gesso's createdproperty really means when the order was placed.
6.1.8
Patch Changes
- 5ed61b8: Update: map price value to msrp price property on product responses from useProduct and useProductSearch.
- 079b767: Fix: Return the total order count in itemsTotal from jsonapi if it exists.
- 5ed61b8: Update: add ability to add additional fields to product variants data prop when using useProduct.
6.1.7
Patch Changes
- c49be5c: Update: add logic for plugin to handle useOrder offset param to offset the order response for drupal commerce.
- 7df7d9e: Fix: use the config for the customer phone field to return the proper data in the get method for the checkout plugin.
- Updated dependencies [3bcf44c]
- @acromedia/gesso-core@6.1.3
6.1.6
Patch Changes
- 70b7a36: Fix: allow drupal commerce errors to propagate to provider by removing misplaced try catch statements in plugin.
- ae8c363: Fix: return full order in updateBilling and updateShipping methods for drupal commerce so the shipping methods can properly update.
- 11c66a4: Use the adjustments on the jsonapi response attribtues.order_total rather than just the attributes to be more consistent with the cart and checkout plugins and to get the most accurate picture of the order cost items
6.1.5
Patch Changes
- 376b237: Fix: remove circular dependencies from jsonapi response when cart is requested by id to avoid cart response error.
- b2795f6: Fix: format the state attribute from the JSONAPI orders response so multi word status only use alphanumeric characters.
- 7f61668: Update: return shipping methods and chosen method in checkout response.
- 66ed396: Fix: return price on shipping methods property in checkout response.
- c41841b: Fix: attach extra order data to respective order items and shipment items instead of directly in the order data prop.
- Updated dependencies [66ed396]
- @acromedia/gesso-core@6.1.2
6.1.4
Patch Changes
- baa721c: Add: map unmapped json api data to cart and cart items data property.
- a022889: Update: add included resource data from json api responses to data prop on orders and product plugins.
- Updated dependencies [baa721c]
- @acromedia/gesso-core@6.1.1
6.1.3
Patch Changes
-
80eddc0: Create a type for drupal cart state. We still accept string here as any field might be generated in a drupal config for cart state.
Remove the gesso cart id cookie on logout. Prevents fetching incorrect carts when multiple accounts are being used on the same device.
-
dd96054: Fix: allow useCart to pull images off the product or the variation.
6.1.2
Patch Changes
- 2259718: Update: sort orders newest to oldest.
- ab8efe6: Include the shipping information in the use order plugin and apply to OrderDetails component
- 0902248: Allow an optional and configurable purchase order field on a gesso order
6.1.1
Patch Changes
- e8fa722: TS type fixes
- 8d232d0: Enhanced error message handling in Customer login method.
- 1e5712e: Feat: pass unmapped order data to generic data prop on Order type.
- d0235aa: feat: map payment options to the paymentInfo.methods property in the checkout plugin.
- Updated dependencies [0a5c916]
- @acromedia/gesso-core@6.1.0
6.1.0
Minor Changes
- a1aa4d6: Convert drupal commerce pagination to use cursor pagination to match useProductSearch plugin pagination data structure.
6.0.0
Major Changes
-
609c5e9: ### Cart Plugin
buildCart
Removed deprecated properties:
subtotal
: Removed from the returned Cart object.total
: Removed from the returned Cart object.Cart Interface
The Cart interface has been updated to remove the deprecated subtotal and total properties. These values are now exclusively available through the
adjustments
array.Checkout Plugin
useCheckout
Updated get function:
Changed how
subtotalPrice
andtotalPrice
are calculated in the initial return object:subtotalPrice:
cart?.adjustments?.find((a) => a.id === 'subtotal')?.value ?? 0,
totalPrice:
cart?.adjustments?.find((a) => a.id === 'total')?.value ?? 0,This replaces the previous usage of deprecated
cart?.subtotal
andcart?.total
.Orders Plugin
Deprecated Properties and Adjustments
Changes to buildCart Function:
Adjustments for
subtotal
,total
, andtotalItems
are now within theadjustments
array. ThecartQuantity
is calculated and added astotalItems
in theadjustments
array.Required Updates:
Replace any direct usage of
subtotal
,total
, andtotalItems
properties with their respective entries within theadjustments
array.Example Code Before:
const cart = {
id: data.id,
items: buildCartItems(format, items) ?? [],
subtotal: format(data?.attributes?.order_total?.subtotal?.number ?? "0"),
total: format(data?.attributes?.order_total?.total?.number ?? "0"),
totalItems: data?.relationships?.order_items?.data?.length ?? 0,
};Example Code After:
const cartQuantity =
items?.reduce(
(total, item) => total + parseInt(item.attributes?.quantity ?? "0", 10),
0
) ?? 0;
const cart = {
id: data.id,
items: buildCartItems(format, items) ?? [],
adjustments: [
{
id: "totalItems",
label: "Total Items",
value: cartQuantity,
},
{
id: "subtotal",
label: "Subtotal",
value: format(data?.attributes?.order_total?.subtotal?.number ?? "0"),
},
{
id: "total",
label: "Total",
value: format(data?.attributes?.order_total?.total?.number ?? "0"),
},
],
};
Patch Changes
- Updated dependencies [609c5e9]
- Updated dependencies [609c5e9]
- @acromedia/gesso-commerce@6.0.0
- @acromedia/gesso-core@6.0.0
5.7.1
Patch Changes
- cc252ca: Fix: build cart items with a type property and remove / update them using the type property.
- df8c22b: Fix: format state to be in iso format when updating shipping and billing address.
- f00b894: Fix: in useOrder grab product images if variation images don't exist.
- Updated dependencies [cc252ca]
- @acromedia/gesso-core@5.3.2
5.7.0
Minor Changes
- e2ac202: add: passwordReset and passwordResetEmail to password plugin
Patch Changes
- 2524e0b: include the IN operator on filters
5.6.0
Minor Changes
- 2b606f9: Pass a cartId inside the get method for drupal-commerce to conditionally invoke a jsonapi request for a specific cart. Update our buildOrder parser for optional conditions where appropriate, this fixes any page attempting to render drupal-commerce orders that was previously breaking.
Patch Changes
- Updated dependencies [2b606f9]
- @acromedia/gesso-core@5.3.1
5.5.4
Patch Changes
- ebd36a8: fix: add a optional chaining operator so orders are built correctly without errors
5.5.3
Patch Changes
- c6bd11e: add: config for order state filter to support custom order workflows in Drupal Commerce. add: config for image fields to support fields with diffrent names. fix: type errors in missing jsonapi data.
5.5.2
Patch Changes
- 51bb1f6: fix: only ever return published variants in useProduct response.
- 522659d: fix: revert 302 check on logout and continue to use 200 to check successful logouts