Comfino installments WooCommerce

Comfino widget integration with WooCommerce

In order to embed the widget on any page of the store, the following initialization code should be placed:

var script = document.createElement('script');
script.onload = function () {
    ComfinoProductWidget.init({
        widgetKey: '{WIDGET_KEY}',
        priceSelector: '{WIDGET_PRICE_SELECTOR}',
        widgetTargetSelector: '{WIDGET_TARGET_SELECTOR}',
        priceObserverSelector: '{WIDGET_PRICE_OBSERVER_SELECTOR}',
        priceObserverLevel: {WIDGET_PRICE_OBSERVER_LEVEL},
        type: '{WIDGET_TYPE}',
        offerType: '{OFFER_TYPE}',
        embedMethod: '{EMBED_METHOD}',
        numOfInstallments: 0,        
        price: null,
        callbackBefore: function () {},
        callbackAfter: function () {},
        onOfferRendered: function (jsonResponse, widgetTarget, widgetNode) { },
        onGetPriceElement: function (priceSelector, priceObserverSelector) { return null; },
        debugMode: window.location.hash && window.location.hash.substring(1) === 'comfino_debug'
    });
};
script.src = '{WIDGET_SCRIPT_URL}';
script.async = true;
document.getElementsByTagName('head')[0].appendChild(script);

The Comfino WooCommerce plugin provides a ready-made initialization script template and makes it easy to configure the widget. To enable the widget, open the plug-in configuration form.

Konfiguracja

To activate the widget logic on the store page, set the switch "Widget enabled?". For the widget to function, an individual key is required, which must be entered into the "Widget key" field.

The initialization script can be modified according to your needs.

After saving the changes, the widget should display on all pages that meet the criteria defined in item selectors: "Widget price element selector", "Widget anchor element selector".

The first selector points to an HTML document element that contains the product's price (usually a product detail page). The second selector points to the element in which the widget will be embedded.

Additional detailed information about the operation and configuration of the widget can be found in the main Comfino widget documentation.