@swell/apps-sdk 1.0.135 → 1.0.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -14471,8 +14471,15 @@ function ShopifyLineItem(instance, item, cart, options = {}) {
14471
14471
  if (item instanceof ShopifyResource) {
14472
14472
  return item.clone();
14473
14473
  }
14474
+ let swellItem = {};
14475
+ if (item instanceof StorefrontResource) {
14476
+ item = cloneStorefrontResource(item);
14477
+ } else {
14478
+ swellItem = { ...item };
14479
+ }
14474
14480
  const discountAllocations = getDiscountAllocations(cart, item);
14475
14481
  return new ShopifyResource({
14482
+ ...swellItem,
14476
14483
  // Deprecated by Shopify
14477
14484
  discounts: getDeprecatedDiscounts(cart, item),
14478
14485
  discount_allocations: discountAllocations,
@@ -14544,8 +14551,8 @@ function ShopifyLineItem(instance, item, cart, options = {}) {
14544
14551
  }),
14545
14552
  taxable: item.tax_total > 0,
14546
14553
  title: deferWith(
14547
- [item.product, item.variant],
14548
- (product, variant) => `${product?.name || item.product_id}${variant?.name ? ` - ${variant.name}` : ""}`
14554
+ item.product,
14555
+ (product) => product?.name || item.product_id
14549
14556
  ),
14550
14557
  total_discount: item.discount_total,
14551
14558
  unit_price: void 0,
@@ -14698,7 +14705,7 @@ function ShopifyCart(instance, cart) {
14698
14705
  attributes: defer(() => cart.metadata),
14699
14706
  cart_level_discount_applications: [],
14700
14707
  // TODO cart-level promotions
14701
- checkout_charge_amount: defer(() => cart.grand_total),
14708
+ checkout_charge_amount: defer(() => cart.capture_total),
14702
14709
  currency: deferWith(
14703
14710
  cart,
14704
14711
  (cart2) => ShopifyCurrency(instance, cart2.currency)
@@ -14719,7 +14726,7 @@ function ShopifyCart(instance, cart) {
14719
14726
  }),
14720
14727
  items_subtotal_price: defer(() => cart.sub_total),
14721
14728
  note: defer(() => cart.comments),
14722
- original_total_price: deferWith(cart, (cart2) => cart2.capture_total),
14729
+ original_total_price: deferWith(cart, (cart2) => cart2.sub_total),
14723
14730
  requires_shipping: defer(() => Boolean(cart.shipment_delivery)),
14724
14731
  taxes_included: defer(() => Boolean(cart.item_tax_included)),
14725
14732
  total_discount: defer(() => cart.discount_total),