The widget is a small bit of javascript code that you can place on your product pages to let customers know they can purchase with a Partial.ly payment plan, and interactively see the payment plan options available to them.

The widget has many different options to customize its look and behavior, which are detailed below in the options section.

The following bit of javascript illustrates the basic structure of the code to embed the Partial.ly widget on a page. There's a container element to hold the widget, javscript to set the widget options, and then loading the Partial.ly widget javascript.

<div id="partiallyWidget"></div>
<script>
document.partiallyWidgetConfig = {
offer: '<sample partial.ly offer>',
amount: 99.99,
targetSelector: '#partiallyWidget'
};
(function() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://partial.ly/js/partially-widget.js';
script.async = true;
document.head.appendChild(script);
})();
</script>

Options

• amount string the amount to use for the payment plan, typically product price

• offer string this decides the terms to use in the widget, the offer id from your Partial.ly merchant portal

• currency string currency to use, default USD

• language string language to use in the widget popup, defaults to en for English. options are de, en, es, fr, it, pt

• source string if your Partial.ly account integrates with your shopping cart, set the source here.  

• includeCheckout boolean true to include a Partial.ly checkout button in the widget

• checkoutButtonText string if including a checkout button

• style string widget style, either stacked or thin. default is stacked

• title string for stacked style widgets, text for the title

• actionText string text for the widget link to open popup

• popupDetails string custom text in the header of widget popup

• body string custom body text for the widget. Customplaceholders are available to insert. Leave empty for default dynamic body.

• targetSelector string css selector for element to render the widget inside of

• render boolean whether or not to automatically render the widget, default true

• actionSelector string if setting render to false, set this to a css selector to the element which should trigger opening the widget popup

• quantity integer quantity of the product, default 1

• quantitySelector string css selector of quantity input element to monitor for changes, and automatically update widget price

• checkoutButtonConfig object Checkout button config

Have More Questions?

Email us at support@partial.ly