Developer Docs
  • 👋Get Started
  • Add Payment Methods in Optty
  • Custom API | Headless
    • 🖥️Direct API Integration
      • Environments
      • Order Flow
      • 1️⃣Create Access Token
      • 2️⃣Get APM Options
      • 3️⃣Create Order
      • 4️⃣Handle Payment Response
      • 5️⃣Refund Order
      • 🔥Handling Exceptions
  • Platforms
    • ◾BigCommerce
      • 🚀Activate Optty
      • ⚡Add Optty Widgets
        • 1️⃣Install the App
        • 2️⃣Create Widget Token
        • 3️⃣Edit Your Template
        • 4️⃣Widget Configuration
      • 💳Refunds
    • Magento 2
      • Install Optty Module
      • Configure the Optty Extension
      • One Step Checkout
    • Salesforce Commerce Cloud
      • Component Overview
      • Implementation Guide
      • Operation and Management
      • User Guide
    • 🟪WooCommerce
      • 🚀Install Optty
      • ⚡Setup Widgets
      • 💳Refunds
  • Widget
    • Widget Setup and Integration
    • Create Order Widget Integration
    • Handle Order Payment Widget Integration
  • API References
    • Create Order
      • Create Order Response
    • Refund Order
    • Void Order
    • Capture Order
    • Transaction Details
    • Create Customer Session
    • Best Practice
  • Go Live
  • Universal Payment Platform
    • Support Articles
Powered by GitBook
On this page
  • Product Cards
  • Product Listing Page
  • Cart
  • Footer
  1. Platforms
  2. BigCommerce
  3. Add Optty Widgets

Edit Your Template

PreviousCreate Widget TokenNextWidget Configuration

Last updated 1 year ago

You will now need to edit the template files to add the Widgets to the Product and cart pages.

In your BigCommerce admin, select Channel Manager from the menu.

Make a copy of your theme by clicking Edit storefront settings and then selecting Themes from the left menu, then under the [Advanced] button, click Make a Copy from the drop down menu. Once you name the new theme click Save a Copy.

Then under your new theme, you can click the 3 dot menu and select Edit Theme Files. BigCommerce may then ask for a confirmation, where you just click the [Edit Theme Files] button in the overlay.

Once you’re in the Theme Editor, select Templates from the Left Hand Side navigator, and then update the files as described in the following sections. .

Any example code has been created to work with the default “Cornerstone” theme and may need to be amended to fit your template.

Product Cards

Theme File: templates/components/card.html

Insert following code above the last </article> tag

<div class='product-listing-widget-container'>
<div id='product-listing-widget-0' class='product-listing-widget' data-amount='{{price.without_tax.value}}'></div>
<script type='text/javascript'>
mw( 'product-listing-widget', { amount:
{{price.without_tax.value}} } );
</script>
</div>

Product Listing Page

Theme File: templates/components/products/product-view.html

Insert following code after line 115: {{{region name="product_below_price"}}}

{{#if product}}
   <div class='product-box-widget'></div>
     {{#if product.price.with_tax}}
         <script>
            mw('product-box-widget', { 
             amount: '{{product.price.with_tax.value}}'
                  })
         </script>
     {{/if}}
     {{#if product.price.without_tax}}
         <script>
            mw('product-box-widget', { 
             amount: '{{product.price.without_tax.value}}'
                     })
         </script>
     {{/if}}
{{/if}}

Cart

Theme File: templates/pages/cart.html

Insert following code above the line {{else}} <h3 tabindex="0">{{lang 'cart.checkout.empty_cart'}}</h3>

<div class='cart-widget'>
<div class='cart-box-widget'></div>

<!-- The data in this input tag is needed for when the cart page has fragments rerendered →

<input type='hidden' id='cart-total' value='{{cart.grand_total.value}}'>
   <script type='text/javascript'>
         mw( 'cart-box-widget', { amount:  
            {{cart.grand_total.value}} }) 
    </script>
</div>

Footer

Theme File: templates/components/common/footer.html

Insert following code above the line {{#if theme_settings.show_powered_by}}

<div class='optty-footer-widget'></div>
   <script>
      mw('footer-widget', {});
    </script>
</div>
◾
⚡
3️⃣