Cart Page B2B Pricing

Display negotiated B2B pricing on Shopify cart pages for PunchOut and enterprise buyers.

Extend PunchOut B2B pricing to your Shopify cart page so enterprise buyers see their negotiated prices throughout the entire shopping journey — from product pages through to checkout.

The cart pricing script automatically detects the buyer's fromIdentity session, resolves their customer pricing, and updates cart prices in real time. It works with Shopify's Dawn theme out of the box and supports custom themes through configurable CSS selectors.

Note:

Prerequisite: The PunchOut tracker script must already be installed and working on your store before setting up cart pricing. The tracker captures the fromIdentity parameter that the cart pricing script relies on.

How It Works

1

Buyer Arrives via PunchOut

The enterprise buyer clicks through from their procurement system (SAP Ariba, Coupa, etc.). The existing tracker script captures their fromIdentity and stores it in the browser session.

2

Buyer Navigates to Cart

When the buyer opens the cart page, the cart pricing script automatically detects the active fromIdentity session.

3

B2B Prices Are Fetched

The script resolves the buyer's identity to their Shopify customer record and fetches their negotiated pricing for all items in the cart.

4

Cart Prices Update

Unit prices, line totals, and the cart subtotal are updated to reflect the buyer's B2B rates. Optionally, the original prices are shown with a strikethrough for comparison.

5

PunchOut Cloud Receives Correct Prices

The pricing data is made available to PunchOut Cloud so the correct B2B prices transfer back to the procurement system at checkout.

Installation

Add the cart pricing script to your Shopify cart page template.

1

Open Theme Editor

In your Shopify admin, go to Online StoreThemesEdit code.

2

Locate Your Cart Template

Find the cart template file. Depending on your theme, this is typically one of:

  • templates/cart.liquid
  • sections/main-cart-items.liquid
  • sections/cart-template.liquid
3

Add the Cart Pricing Script

Add the following script tag near the bottom of your cart template, before the closing tag:

<!-- Weevio Cart B2B Pricing -->
<script src="https://cloud.weevio.co/ecommerce-widget/cartBssPricing.js" defer="defer"></script>
4

Add Configuration (Optional)

If you need to customize the behavior, add a configuration block before the script tag:

<script>
  window.weevioWidgetConfig = {
    shopifyDomain: '{{ shop.permanent_domain }}',
    teamID: 'YOUR_TEAM_ID',
    baseURL: 'https://cloud.weevio.co',
    cartBssPricing: {
      enableDomUpdates: true
    }
  };
</script>

<!-- Weevio Cart B2B Pricing -->
<script src="https://cloud.weevio.co/ecommerce-widget/cartBssPricing.js" defer="defer"></script>

Note:

If you already have a window.weevioWidgetConfig block on the page (for example, from the product page widget), add the cartBssPricing property to the existing configuration rather than creating a second block.

5

Save and Test

Save your theme changes. Visit your cart page with an active PunchOut session to verify pricing updates.

Configuration

Dawn Theme (Default)

For stores using Shopify's Dawn theme or most standard themes, the default settings work out of the box with no additional configuration:

window.weevioWidgetConfig = {
  shopifyDomain: '{{ shop.permanent_domain }}',
  teamID: 'YOUR_TEAM_ID',
  baseURL: 'https://cloud.weevio.co',
  cartBssPricing: {
    enableDomUpdates: true
  }
};

The script automatically detects Dawn's cart HTML structure and updates the correct price elements.

BSS B2B App Compatibility

If your store uses the BSS B2B app, the cart pricing script is fully compatible with no special configuration needed. The script automatically detects BSS B2B attributes in your theme:

  • bss-b2b-cart-item-key — Cart item identifiers
  • bss-b2b-item-original-price — Unit price elements
  • bss-b2b-cart-total-price — Cart total elements

These attributes are prioritized over standard selectors, ensuring seamless integration with BSS-powered themes.

Custom Themes

For custom Shopify themes, you may need to specify CSS selectors that match your theme's cart HTML structure.

1

Inspect Your Cart Page

Open your cart page in a browser and use Developer Tools (F12) to inspect the HTML structure. Identify the CSS selectors for:

  • The cart container (wraps all items)
  • Individual cart item rows
  • Unit price elements
  • Line total elements
  • The cart subtotal
2

Configure Custom Selectors

Add your theme's selectors to the configuration:

window.weevioWidgetConfig = {
  shopifyDomain: '{{ shop.permanent_domain }}',
  teamID: 'YOUR_TEAM_ID',
  baseURL: 'https://cloud.weevio.co',
  cartBssPricing: {
    enableDomUpdates: true,
    selectors: {
      cartContainer: '#my-custom-cart',
      cartItemRow: '.custom-cart-row',
      cartItemPrice: '.custom-unit-price',
      cartItemLinePrice: '.custom-line-total',
      cartSubtotal: '#custom-subtotal',
      variantIdAttribute: 'data-product-variant-id'
    }
  }
};

Selector reference:

SelectorDescriptionDefault
cartContainerElement wrapping all cart itemscart-items, .cart__items
cartItemRowEach individual cart line item.cart-item, .cart__item
cartItemPriceUnit price display per item.cart-item__price .price
cartItemLinePriceLine total (qty × price).cart-item__totals .price
cartSubtotalCart subtotal element.totals__subtotal-value
variantIdAttributeHTML attribute containing variant IDdata-variant-id

Note:

Make sure your cart item rows include a data-cart-item-key or data-variant-id attribute so the script can match each row to the correct pricing data. Most Shopify themes include this by default.

Data-Only Mode

If you only need to pass B2B pricing data to PunchOut Cloud without visually updating the cart page, disable DOM updates:

cartBssPricing: {
  enableDomUpdates: false
}

In this mode, the script still populates the pricing data that PunchOut Cloud reads at checkout, but the cart UI shows standard Shopify prices.

Price Formatting

Customize how B2B prices are displayed in the cart using the formatting options:

cartBssPricing: {
  enableDomUpdates: true,
  formatting: {
    currencySymbol: '$',
    currencyPosition: 'before',
    decimalPlaces: 2,
    thousandsSeparator: ',',
    decimalSeparator: '.'
  }
}

Formatting options:

OptionDescriptionDefaultExample
currencySymbolCurrency symbol to display$, £, ¥
currencyPositionSymbol placementbeforebefore → $19.99, after → 19.99€
decimalPlacesNumber of decimal digits20, 2, 3
thousandsSeparatorThousands grouping character,, → 1,000 or . → 1.000
decimalSeparatorDecimal point character.. → 19.99 or , → 19,99

European store example (EUR):

cartBssPricing: {
  enableDomUpdates: true,
  formatting: {
    currencySymbol: '€',
    currencyPosition: 'after',
    decimalSeparator: ',',
    thousandsSeparator: '.'
  }
}

This displays prices as 1.299,99€ instead of $1,299.99.

Visual Indicators

Show original prices alongside B2B prices using the indicators options:

cartBssPricing: {
  enableDomUpdates: true,
  indicators: {
    showOriginalPrice: true,
    modifiedPriceClass: 'b2b-price',
    originalPriceClass: 'original-price'
  }
}

When showOriginalPrice is enabled, each updated price element shows both the original retail price (with strikethrough styling) and the B2B price.

Add CSS to style the prices:

.original-price {
  text-decoration: line-through;
  opacity: 0.6;
  margin-right: 0.5em;
}

.b2b-price {
  font-weight: bold;
  color: #007acc;
}

Indicator options:

OptionDescriptionDefault
showOriginalPriceDisplay original price with strikethroughtrue
modifiedPriceClassCSS class applied to B2B priceweevio-b2b-price
originalPriceClassCSS class applied to original priceweevio-original-price

Configuration Examples

Minimal Setup (Dawn Theme)

window.weevioWidgetConfig = {
  shopifyDomain: '{{ shop.permanent_domain }}',
  teamID: 'YOUR_TEAM_ID',
  baseURL: 'https://cloud.weevio.co',
  cartBssPricing: {
    enableDomUpdates: true
  }
};

Show Original Price with Strikethrough

window.weevioWidgetConfig = {
  shopifyDomain: '{{ shop.permanent_domain }}',
  teamID: 'YOUR_TEAM_ID',
  baseURL: 'https://cloud.weevio.co',
  cartBssPricing: {
    enableDomUpdates: true,
    indicators: {
      showOriginalPrice: true,
      modifiedPriceClass: 'b2b-price',
      originalPriceClass: 'original-price'
    }
  }
};

European Store (EUR)

window.weevioWidgetConfig = {
  shopifyDomain: '{{ shop.permanent_domain }}',
  teamID: 'YOUR_TEAM_ID',
  baseURL: 'https://cloud.weevio.co',
  cartBssPricing: {
    enableDomUpdates: true,
    formatting: {
      currencySymbol: '€',
      currencyPosition: 'after',
      decimalSeparator: ',',
      thousandsSeparator: '.'
    }
  }
};

Custom Theme with Manual Selectors

window.weevioWidgetConfig = {
  shopifyDomain: '{{ shop.permanent_domain }}',
  teamID: 'YOUR_TEAM_ID',
  baseURL: 'https://cloud.weevio.co',
  cartBssPricing: {
    enableDomUpdates: true,
    selectors: {
      cartContainer: '#my-custom-cart',
      cartItemRow: '.custom-cart-row',
      cartItemPrice: '.custom-unit-price',
      cartItemLinePrice: '.custom-line-total',
      cartSubtotal: '#custom-subtotal',
      variantIdAttribute: 'data-product-variant-id'
    }
  }
};

Testing

1

Create a Test PunchOut Session

Open a test URL with a valid fromIdentity parameter:

https://your-store.com?fromIdentity=AN01631249352

Make sure the corresponding customer is tagged in Shopify and assigned to a B2B price list.

2

Add Items to Cart

Browse products and add items to the cart. The product page widget should already be showing B2B pricing if configured.

3

View Cart Page

Navigate to the cart. You should see:

  • Unit prices updated to B2B rates
  • Line totals recalculated
  • Cart subtotal reflecting B2B pricing
  • Original prices with strikethrough (if enabled)
4

Verify in Browser Console

Open developer tools (F12) and check the console:

// Verify pricing data is populated
console.log(window.BSS_B2B?.cart);

// Expected output:
// {
//   modifiedItemsSubtotalPrice: 8999,  (in cents)
//   cpPricingList: Map { "key1" => { modifiedItemPrice: 4500, ... } }
// }

Note:

Debug mode: During development, add debug: true to your cartBssPricing configuration. This enables detailed console logging on localhost to help identify selector or pricing issues.

Troubleshooting

Prices Not Updating on Cart Page

Check the script is loaded:

  • View page source and confirm the cartBssPricing.js script tag is present
  • Check the browser console for 404 or loading errors

Check the PunchOut session is active:

// In browser console:
sessionStorage.getItem('weevio_fromIdentity')
// Should return the buyer's identity string

Check that pricing data was fetched:

// In browser console:
console.log(window.BSS_B2B?.cart);
// Should show pricing data, not undefined

If BSS_B2B.cart is undefined, the script may not have resolved the customer. Verify the customer tag and price list setup in Shopify.

Cart Items Not Matching Prices

If some cart items show B2B prices but others don't:

  • Verify all products in the cart are included in the customer's B2B price list
  • Check that cart item rows have a data-cart-item-key or data-variant-id attribute
  • For custom themes, ensure the variantIdAttribute selector matches your theme's HTML

Selectors Not Working (Custom Themes)

If DOM updates aren't appearing:

  1. Open browser Developer Tools
  2. Use the Elements panel to inspect your cart's HTML
  3. Verify the CSS selectors in your configuration match the actual elements
  4. Try enabling debug: true on localhost for detailed logging

Cart Subtotal Not Updating

The subtotal selector may differ between themes. Common alternatives:

  • .totals__subtotal-value (Dawn)
  • .totals__total-value (some Dawn variants)
  • .cart__subtotal (older themes)

Update the cartSubtotal selector in your configuration to match your theme.

PunchOut Cloud Not Receiving B2B Prices

If PunchOut Cloud transfers standard prices instead of B2B prices:

  • Ensure enableDomUpdates is not the issue — even with DOM updates disabled, the pricing data is still populated for PunchOut Cloud
  • Check that the cart pricing script loads before punchout.min.js
  • Verify window.BSS_B2B.cart contains pricing data in the browser console

For additional help, see the PunchOut Commerce setup guide or the Widget Troubleshooting page.

Next Steps

Need Help?

For assistance, please send a message to our Support page.