diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-09-04 00:07:01 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-09-04 00:07:01 +0200 |
commit | 7582955791fa9a720852bba7288544c55444fa70 (patch) | |
tree | 57c31d83310da4ee9c752e8e2c63812baeaef416 /server-build | |
parent | 58efd0a22ecd656eb57649ee421212b78a59ec8a (diff) | |
download | woocommerce-taler-7582955791fa9a720852bba7288544c55444fa70.tar.gz woocommerce-taler-7582955791fa9a720852bba7288544c55444fa70.tar.bz2 woocommerce-taler-7582955791fa9a720852bba7288544c55444fa70.zip |
find a better place for OIDC/WooCommerce integration: snipptes
Diffstat (limited to 'server-build')
-rw-r--r-- | server-build/QEMU-autobuild/KUDOS-WooCommerce-Support.php.txt | 21 | ||||
-rwxr-xr-x | server-build/QEMU-autobuild/buildWebstore.sh | 18 |
2 files changed, 16 insertions, 23 deletions
diff --git a/server-build/QEMU-autobuild/KUDOS-WooCommerce-Support.php.txt b/server-build/QEMU-autobuild/KUDOS-WooCommerce-Support.php.txt deleted file mode 100644 index 0ddcb3f..0000000 --- a/server-build/QEMU-autobuild/KUDOS-WooCommerce-Support.php.txt +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Support for the KUDOS and TESTKUDOS currency. This goes into functions.php - * https://gist.github.com/woogists/72947b71e48a62f15f5548283d4ed00f#file-wc-add-currency-symbol-php - */ -add_filter( 'woocommerce_currencies', 'add_my_currency' ); - -function add_my_currency( $currencies ) { - $currencies['KUDOS'] = __( 'KUDOS', 'woocommerce' ); - $currencies['TESTKUDOS'] = __( 'TESTKUDOS', 'woocommerce' ); - return $currencies; -} - -add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2); - -function add_my_currency_symbol( $currency_symbol, $currency ) { - switch( $currency ) { - case 'KUDOS': $currency_symbol = 'ク'; break; - case 'TESTKUDOS': $currency_symbol = 'テ'; break; - } - return $currency_symbol; -} diff --git a/server-build/QEMU-autobuild/buildWebstore.sh b/server-build/QEMU-autobuild/buildWebstore.sh index a28fba5..e47884e 100755 --- a/server-build/QEMU-autobuild/buildWebstore.sh +++ b/server-build/QEMU-autobuild/buildWebstore.sh @@ -167,12 +167,26 @@ sudo -u www-data wp media import https://live.staticflickr.com/7199/6929220523_1 # Add Snippet to enable KUDOS currency in WooCommerce # Note: this will break the shop badly if run twice, # recovery by deleting the duplicate entries! -SNIPPET=`cat ${ORIGIN}/woocommerce-taler/server-build/QEMU-autobuild/KUDOS-WooCommerce-Support.php.txt` +SNIPPET=`cat ${ORIGIN}/woocommerce-taler/snippets/kudos-currency.php` cat | mysql wordpress <<EOF PREPARE stmt FROM 'INSERT INTO wp_snippets (name, description, code, scope, priority, active, modified) VALUES (?,?,?,?,?,?,?)'; SET @name='KUDOS currency support'; -SET @description='This snippets adds support for the KUDOS currency of the Taler demo to WooCommerce'; +SET @description='This snippet adds support for the KUDOS currency of the Taler demo to WooCommerce'; +SET @code="$SNIPPET"; +EXECUTE stmt USING @name, @description, @code, "global", 10, 1, NOW(); +EOF + + +# Add Snippet to integrate OIDC with WooCommerce. +# Note: this will break the shop badly if run twice, +# recovery by deleting the duplicate entries! +SNIPPET=`cat ${ORIGIN}/woocommerce-taler/snippets/oidc-reclaim.php` + +cat | mysql wordpress <<EOF +PREPARE stmt FROM 'INSERT INTO wp_snippets (name, description, code, scope, priority, active, modified) VALUES (?,?,?,?,?,?,?)'; +SET @name='Re:ClaimID integration with WooCommerce'; +SET @description='This snippet adds the integration between Re:ClaimID and WooCommerce, allowing users to import their shipping details from Re:ClaimID into WooCommerce during checkout'; SET @code="$SNIPPET"; EXECUTE stmt USING @name, @description, @code, "global", 10, 1, NOW(); EOF |