[ad_1]
Hi,
In the checkout page of my e-commerce I’d like to add an icon “logo.svg” before the name of the payment in the “label” field of the object passed to the method “registerPaymentMethod”.
How can I modify this code to accomplish this task?
(function() {
"use strict";
const settings = window.wc.wcSettings.getSetting( 'my_gateway_data', {} );
const label = window.wp.htmlEntities.decodeEntities( settings.title || '' );
const icon = settings.icon;
const supports = settings.supports || '';
const Content = () => {
return window.wp.htmlEntities.decodeEntities( settings.description || '' );
};
console.log(settings);
const Block_Gateway = {
name: settings.id,
label: label,
content: Object( window.wp.element.createElement )( Content, null ),
edit: Object( window.wp.element.createElement )( Content, null ),
canMakePayment: () => true,
ariaLabel: label,
supports: {
features: settings.supports,
},
supports: {
features: supports,
},
icon: icon || '',
};
window.wc.wcBlocksRegistry.registerPaymentMethod( Block_Gateway );
})();Thank you very much
Claudio
