Skip to content
Install app
English
  • English
  • FrançaisSoon
  • DeutschSoon
  • EspañolSoon
  • ItalianoSoon
  • Português (Brasil)Soon
  • Português (Portugal)Soon
  • 日本語Soon
  • 한국어Soon
  • 简体中文Soon
  • 繁體中文Soon
  • NederlandsSoon
  • DanskSoon
  • SuomiSoon
  • Norsk (bokmål)Soon
  • PolskiSoon
  • ČeštinaSoon
  • TürkçeSoon

JavaScript API - Online store

Globo Preorder provides a JavaScript API for custom integrations within your Shopify theme. This API is accessible through the window.Globo.Preorder object when our app loads into your theme.

1. Global variable

window.Globo.Preorder
// Use it with function app, after app loaded or window loaded
// Example reload preorder form in product page after variant change
// Use: Globo.Preorder.initPreorder();
window.GloboPreorderParams
// Defined selectors, classes, postion display

2. Defined selector - integrate theme

By default, the app defines selectors to display correctly in the right positions; however, themes may have updated versions, or there may be custom themes that the app doesn’t yet support. You can use the variable window.GloboPreorderParams to redefine the selectors.

  • Go to theme.liquid, add Javascript code before </body>
  • Example override selector productAddToCartTextElement on product page
<script>
window.GloboPreorderParams = window.GloboPreorderParams || {};
window.GloboPreorderParams.selectors = window.GloboPreorderParams.selectors || {};
window.GloboPreorderParams.selectors.productAddToCartTextElement = 'span[data-add-to-cart-text], .add-to-cart-text'; // class of the text element added to cart on product page
</script>

3 List keys

window.GloboPreorderParams.selectors

KeyTypePage​Define
cartFormSelectorstringcartcart container
cartRowSelectorstringcartcart item row
cartElementHandlestringcartelement handle product, must be inside the cartRowSelector element.
cartQuantitySelectorstringcartquantity product container, must be inside cartRowSelector element
cartInputQuantitySelectorstringcartinput quantity product
cartPositionLimitMessagestringcartposition display limit product message
cartProductParentSelectorstringcartuse to show Line item badge in cart page.
cartProductTitleSelectorstringcartuse to show Line item badge in cart page.
minusQuantitySelectorstringproductdisable click button minus qty when input quantity reach to limit
addQuantitySelectorstringproductdisable click button plus qty when input quantity reach to limit
productDetailSelectorstringproductproduct detail container
productDetailImagesSelectorstringproductproduct detail image selector
productImageSelectorsarrayproduct collection product image selector
pricePositionSelectorsstringproductprice product position show label preorder
priceSelectorsstringproductprice product wrapper
productFormarrayproductproduct form action add to cart
paymentButtonstringproductpayment button selector
productVariantActivatorstringproductproduct variant selector add event listener click , change and rerender Pre-order status
variantSelectorstringproductproduct variant id selector [name="id"]
productQuantityWrapperSelectorstringproductproduct quantity wrapper, use show limit message
productQuantitySelectorstringproductinput quantity selector
productAddToCartSelectorstringproductselector button add to cart,
productAddToCartBtnarrayproduct, quickviewbutton add to cart
productAddToCartTextElementstringproduct, quickviewadd to cart text
spinnerAtcElementstringproducthide spinner selector in product add to cart
productSoldOutBadgestringproducthide badge sold out selector when product show pre-order
productPositionMessagestringproductposition show message above text
productPositionLimitMessagestringproductposition show warning limit quantity message
productPositionPaymentOptionstringproductposition show payment option
productPositionBisstringproductposition show back in stock butotn

Was this helpful?

Report an issue