Changeset 2987178
- Timestamp:
- 11/01/2023 05:08:22 AM (2 years ago)
- Location:
- blockonomics-bitcoin-payments/trunk
- Files:
-
- 3 edited
-
blockonomics-woocommerce.php (modified) (2 diffs)
-
php/Blockonomics.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
blockonomics-bitcoin-payments/trunk/blockonomics-woocommerce.php
r2984526 r2987178 4 4 * Plugin URI: https://github.com/blockonomics/woocommerce-plugin 5 5 * Description: Accept Bitcoin Payments on your WooCommerce-powered website with Blockonomics 6 * Version: 3.6. 76 * Version: 3.6.8 7 7 * Author: Blockonomics 8 8 * Author URI: https://www.blockonomics.co … … 573 573 add_action('admin_notices', 'blockonomics_plugin_activation'); 574 574 575 add_action( 'before_woocommerce_init', function() { 576 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 577 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 578 } 579 } ); 580 575 581 global $blockonomics_db_version; 576 582 $blockonomics_db_version = '1.4'; -
blockonomics-bitcoin-payments/trunk/php/Blockonomics.php
r2984526 r2987178 516 516 // Save the new address to the WooCommerce order 517 517 public function record_address($order_id, $crypto, $address){ 518 $wc_order = wc_get_order( $order_id ); 518 519 $addr_meta_key = 'blockonomics_payments_addresses'; 519 $addr_meta_value = get_post_meta($order_id,$addr_meta_key);520 $addr_meta_value = $wc_order->get_meta($addr_meta_key); 520 521 if (empty($addr_meta_value)){ 521 update_post_meta($order_id, $addr_meta_key, $address);522 $wc_order->update_meta_data( $addr_meta_key, $address ); 522 523 } 523 524 // when address meta value is not empty and $address is not in it 524 else if (strpos($addr_meta_value[0], $address) === false) { 525 update_post_meta($order_id, $addr_meta_key, $addr_meta_value[0]. ', '. $address); 526 } 525 else if (strpos($addr_meta_value, $address) === false) { 526 $wc_order->update_meta_data( $addr_meta_key, $addr_meta_value. ', '. $address ); 527 } 528 $wc_order->save(); 527 529 } 528 530 … … 784 786 public function save_transaction($order, $wc_order){ 785 787 $txid_meta_key = 'blockonomics_payments_txids'; 786 $txid_meta_value = get_post_meta($order['order_id'],$txid_meta_key);788 $txid_meta_value = $wc_order->get_meta($txid_meta_key); 787 789 $txid = $order['txid']; 788 790 if (empty($txid_meta_value)){ 789 update_post_meta($wc_order->get_id(),$txid_meta_key, $txid);791 $wc_order->update_meta_data($txid_meta_key, $txid); 790 792 } 791 793 // when txid meta value is not empty and $txid is not in it 792 else if (strpos($txid_meta_value[0], $txid) === false){ 793 update_post_meta($wc_order->get_id(), $txid_meta_key, $txid_meta_value[0].', '. $txid); 794 } 794 else if (strpos($txid_meta_value, $txid) === false){ 795 $wc_order->update_meta_data($txid_meta_key, $txid_meta_value.', '. $txid); 796 } 797 $wc_order->save(); 795 798 } 796 799 -
blockonomics-bitcoin-payments/trunk/readme.txt
r2984526 r2987178 4 4 Requires at least: 3.0.1 5 5 Tested up to: 6.3.1 6 Stable tag: 3.6. 76 Stable tag: 3.6.8 7 7 License: MIT 8 8 License URI: http://opensource.org/licenses/MIT … … 84 84 == Changelog == 85 85 86 = 3.6.8 = 87 * Made plugin Woocommerce HPOS compatible 88 86 89 = 3.6.7 = 87 90 * Fix shortcode execution with page builders
Note: See TracChangeset
for help on using the changeset viewer.