Skip to main content

@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 and totalPrice 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 and cart?.total.

    Orders Plugin

    Deprecated Properties and Adjustments

    Changes to buildCart Function:

    Adjustments for subtotal, total, and totalItems are now within the adjustments array. The cartQuantity is calculated and added as totalItems in the adjustments array.

    Required Updates:

    Replace any direct usage of subtotal, total, and totalItems properties with their respective entries within the adjustments 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

5.5.1

Patch Changes

  • 30fb80d: fix: remove the auth cookie on a 302 response status from the logout request instead of a 200.
  • 93f906e: update: to use proper stock values in useProduct build function.

5.5.0

Minor Changes

  • 13a8b3f: Add: order plugin for drupal commerce intergration to allow pulling customer orders.

5.4.0

Minor Changes

  • 6f94395: Migrating decodeHTMLEntities to only impact clientside components.

Patch Changes

  • 31898b1: Fix: don't return a product if its missing a price.
  • 985625f: update the transformProductName function to better handle entity names
  • 66ff6f2: Fix the product links when navigated from within the cart
  • 376d958: Enhance sorting methods and behaviour within Product plugin to align API call with expected UI in catalog templates.
  • dbc9b6b: Fix: update where gesso-auth is set so data is ready when status is updated.
  • cc635e3: Update: add brand to useProduct response.
  • Updated dependencies [6f94395]
    • @acromedia/gesso-core@5.3.0

5.3.0

Minor Changes

  • 00be2ab: Revert: remove JWT authentication and revert to using session cookie.

Patch Changes

  • 15b9b24: Add missing fields in cypress test to pass form validation for updating address.

5.2.7

Patch Changes

  • 5b09db0: Edit: update updatePassword method to take in existingPassword prop and move request to middleware.
  • d82199a: Fix: offest property is now only applied to a page filter instead of a product filter.
  • bbf5d9d: Edit: change direct drupal reqs to drupal middleware reqs.
  • 74ee579: Handle product media as possible array for the product search plugin
  • 17b4197: Update: make phone field in checkout hook use field name from config if avaible.
  • 6051b51: Switch plugins to call the drupal commerce middleware instead of the cms directly to allow for jwt authentication.

5.2.6

Patch Changes

  • e92f212: Adds improved type safety to drupal commerce useProductSearch. Fixes error thrown when product index has no facets.
  • b9d4398: Allow drupal product variation image field name to be configurable
  • 499474f: Edit: logout request to use logout token to properly end the session.
  • b07a19a: Return unmapped product data under data property
  • 69e66da: Replace call to graphqlClient with call to middleware and fix tests accordingly.
  • f86c00d: Allow user to alter default product image field name
  • 1fe5639: Adjusted the graphql query for useProduct to use the product-variation-type name instead of product-type name.
  • Updated dependencies [b07a19a]
    • @acromedia/gesso-core@5.2.4

5.2.5

Patch Changes

  • 8252de6: Allow for the configuration of machine names for first name, last name and phone number for Customer rest and jsonapi methods
  • fde46e7: Added optional includes parameter to Product and Catalog plugins to drupalcommerce.

5.2.4

Patch Changes

  • 1d727c0: Fix: switch grabbing attributes from search api to graphql.
  • Updated dependencies [eda72b5]
    • @acromedia/gesso-core@5.2.3

5.2.3

Patch Changes

  • 02e87c2: Allow for custom query fragment for fetching current customer

5.2.2

Patch Changes

  • 09c9d84: Allow use of config to set the search api index names else default to hardcoded names

5.2.1

Patch Changes

  • 3e3651e: Includes the checkout plugins and test for drupal commerce integration

5.2.0

Minor Changes

  • cbc6432: Feat: add catalog hook to drupal-commerce plugin to allow pulling catalogs from drupal.

Patch Changes

  • 40aafb0: Fix: only return the matching product variant.
  • b187c95: fix: add missing last name update functionality to update function.
  • 6508257: Added the adjustments property to the cart object when no items are available and adjusted some verbiage.

5.1.0

Minor Changes

  • af19949e5: feat: add cart plugin for drupal-commerce to allow for cart actions

Patch Changes

  • Updated dependencies [af19949e5]
    • @acromedia/gesso-core@5.2.2

7.1.0

Minor Changes

  • 29d64f7: feat: add productSearch and product hook to drupal-commerce plugin to allow pulling products from drupal.

Patch Changes

  • Updated dependencies [29d64f7]
    • @acromedia/gesso-core@5.2.1
    • @acromedia/gesso-commerce@5.3.1

7.0.0

Patch Changes

  • Updated dependencies [9dbfed6]
  • Updated dependencies [ede7130]
    • @acromedia/gesso-core@5.2.0
    • @acromedia/gesso-commerce@5.3.0

6.0.0

Patch Changes

  • Updated dependencies [8f9c3c8]
  • Updated dependencies [24e76cb]
  • Updated dependencies [8f9c3c8]
  • Updated dependencies [517db02]
  • Updated dependencies [e10e52b]
    • @acromedia/gesso-core@5.1.0
    • @acromedia/gesso-commerce@5.2.0

5.0.0

Minor Changes

  • de7fa73: feat: add drupal commerce customer plugin.

Patch Changes

  • Updated dependencies [34e0807]
  • Updated dependencies [de7fa73]
  • Updated dependencies [5a2fc8b]
  • Updated dependencies [2386c76]
  • Updated dependencies [352ef12]
  • Updated dependencies [478fe55]
    • @acromedia/gesso-commerce@5.1.0
    • @acromedia/gesso-core@5.0.1