PluginProbe
Pay with Vipps and MobilePay for WooCommerce / 5.4.3
Pay with Vipps and MobilePay for WooCommerce v5.4.3
6.2.1 6.2.0 6.1.10 6.1.9 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1.0 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 5.4.3 5.4.2 5.4.1 5.4.0 5.3.4 trunk All 183 releases
woo-vipps / payment / Blocks / Products / js / editor.js

editor.js in Pay with Vipps and MobilePay for WooCommerce 5.4.3, at payment/Blocks/Products/js/editor.js

46 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 ( function( wp ) {
2
3 if (!wp) return;
4 if (typeof(wp['blocks']) == 'undefined') return;
5 if (typeof(wp['element']) == 'undefined') return;
6
7 const { getCategories, registerBlockType, setCategories } = wp.blocks;
8 var el = wp.element.createElement;
9 var __ = wp.i18n.__;
10
11
12 const VippsBuyNow = ( props ) => {
13 return el('div', {"class": 'wp-block-button wc-block-components-product-button wc-block-button-vipps'},
14 el ('a', {"javascript":'void(0)', "data-product_id":props.product.id,
15 "class": "single-product button vipps-buy-now wp-block-button__link",
16 "title":VippsConfig['BuyNowWithVipps']},
17 el('span', { "class": "vippsbuynow" }, VippsConfig['BuyNowWith']),
18 el('img', { "class":"inline vipps-logo negative",
19 "src":VippsConfig['vippslogourl'],
20 "alt":"Vipps", "border":0})));
21 };
22
23
24 const blockConfig = {
25 category: 'woocommerce',
26 keywords: [ __( 'WooCommerce', 'woo-gutenberg-products-block' ) ],
27 supports: {
28 html: false,
29 },
30 parent: [ 'woocommerce/all-products' ],
31 icon: el('img', {"class": "vipps-smile vipps-component-icon", "src": VippsConfig['vippssmileurl'] }),
32 title: VippsConfig['vippsbuynowbutton'],
33 description: VippsConfig['vippsbuynowdescription'],
34 edit: function( props ) {
35 return el(VippsBuyNow, { product: {} } );
36 }
37 };
38
39 registerBlockType( 'vipps/buy-now', blockConfig );
40
41 }(
42 window.wp
43 ) );
44
45
46