Skip to content

Commit

Permalink
Added build and src folders
Browse files Browse the repository at this point in the history
  • Loading branch information
nidhitatosaniya committed Feb 10, 2024
1 parent a26ed86 commit b95e6f6
Show file tree
Hide file tree
Showing 11 changed files with 47,537 additions and 1 deletion.
22 changes: 22 additions & 0 deletions build/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "checkout-fees-for-woocommerce/Payment Gateway Based Fees and Discounts",
"version": "1.0.0",
"title": "Payment Gateway Based Fees and Discounts",
"category": "woocommerce",
"parent": [
"woocommerce/checkout-shipping-address-block"
],
"attributes": {
"lock": {
"type": "object",
"default": {
"remove": true,
"move": true
}
}
},
"textdomain": "checkout-fees-for-woocommerce",
"editorScript": "file:./build/index.js"
}
33 changes: 33 additions & 0 deletions build/checkout-block-frontend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
(()=>{
"use strict";
const e = window.wp.element
, t = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"checkout-fees-for-woocommerce/add-fees","version":"1.0.0","title":"Payment Gateway Based Fees and Discounts","category":"woocommerce","parent":["woocommerce/checkout-shipping-address-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"textdomain":"checkout-fees-for-woocommerce","editorScript":"file:./build/index.js"}')
, o = window.wc.blocksCheckout
, {registerCheckoutBlock: c} = (window.wp.i18n,
wc.blocksCheckout);
c({
metadata: t,
component: ({children: t, checkoutExtensionData: c})=>{
const [a,n] = (0,
e.useState)("")
, {setExtensionData: s} = c;
(0,
e.useEffect)((()=>{
jQuery(document).on("change", 'input[name="radio-control-wc-payment-method-options"]', (function(e) {
console.log("here"),
(0,
o.extensionCartUpdate)({
namespace: "checkout-fees-for-woocommerce",
data: {
shipping_method: document.querySelector('input[name="radio-control-0"]:checked').value,
payment_method: e.target.value
}
})
}
))
}
), []);
}
})
}
)();
1 change: 1 addition & 0 deletions build/index.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php return array('dependencies' => array('wc-blocks-checkout', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '462ac974dfcd81f992ca');
1 change: 1 addition & 0 deletions build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion checkout-block/class-blocks-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function register_block_frontend_scripts() {

wp_register_script(
'checkout-block-frontend',
trailingslashit( plugin_dir_url( __DIR__ ) ) . 'includes/js/checkout-block-frontend.js',
trailingslashit( plugin_dir_url( __DIR__ ) ) . 'src/frontend.js',
array(),
PGBF_BLOCK_VERSION,
true
Expand Down
Loading

0 comments on commit b95e6f6

Please sign in to comment.