Skip to main content

Cofidis Widget setup

caution

If you are using Cofidis 4xcard payment method it is mandatory to put view details link. You can put this link in you cart or checkout page.

To improve user experience and show additional information to the user we provide a Cofidis 4xcard Widget that will display financial conditions based on the amount of the order. It already includes view details link so if you're using our Cofidis 4xcard Widget there is no need to put the link separately.

Add this widget to your cart or product page to inform your customers about Cofidis 4xcard payment option, and it's conditions.

Cofidis Widget Preview

To add the widget to your cart or product page create a container element in the HTML file where the widget will be displayed

<div id="cofidis_widget">
<!-- Cofidis Widget will be rendered here -->
</div>

Place this code snippet at the end of your page, before closing </body> tag and

<script src="https://js.monei.com/v2/monei.js"></script>
<script>
const cofidisWidget = monei.CofidisWidget({
accountId: '2975bcfa-7bbc-422d-af48-c66759d87b69', // Your MONEI Account ID
amountInt: {{cart.total_price}}, // The amount you want to display in cents
language: 'en', // Language, supported en, es

// You can pass additional styles
style: {
base: {
textAlign: 'right',
fontFamily: 'Helvetica,"Helvetica Neue",Arial,"Lucida Grande",sans-serif',
justifyContent: 'end'
}
}
});

// Render Cofidis Widget to the container element
cofidisWidget.render('#cofidis_widget');

// Assign a global variable to cofidisWidget so you can update props later
window.cofidisWidget = cofidisWidget;
</script>
note

You can specify amount property for the amount as positive float number (9.99 is 9.99 EUR) or amountInt property as positive integer in the smallest currency unit (999 is 9.99 EUR)

If you are updating your cart page using JavaScript (without page reload) you can update the widget amount like so:

window.cofidisWidget.updateProps({amountInt: 999});
note

If the amount is less than 75 EUR or more than 1000 EUR the widget will not be displayed as Cofidis 4xcard only allows payments in this range.