Changeset 2730820
- Timestamp:
- 05/25/2022 01:27:21 PM (4 years ago)
- Location:
- wc-unzer-direct/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (1 diff)
-
classes/instances/instance.php (modified) (2 diffs)
-
classes/instances/unzer-direct-debit.php (modified) (1 diff)
-
classes/instances/unzer-direct-invoice.php (modified) (2 diffs)
-
wc-unzer-direct.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-unzer-direct/trunk/README.txt
r2729310 r2730820 32 32 33 33 == Changelog == 34 = 1.4.4 = 35 * Fix: Disable Unzer Denit Invoice if country is not CH as well. 36 * Feat: Hide Unzer specific gateways if "Ship to different address" is enabled since the addresses must match. 37 34 38 = 1.4.3 = 35 39 * Fix: Remove VISA Electron card logo -
wc-unzer-direct/trunk/classes/instances/instance.php
r2481316 r2730820 54 54 'section' => 'unzer_direct' 55 55 ]; 56 $html = sprintf( "<p><small>Version: %s</small>", WC_UNZER_DIRECT_VERSION );57 $html .= "<p>" . sprintf( __( 'Allows you to receive payments via %s', 'wc-unzer-direct' ), $this->method_title ) . "</p>";58 $html .= "<p>" . sprintf( __( 'This module has it\'s main configuration inside the \'Unzer Direct\' tab.', 'wc-unzer-direct' ), 's' ) . "</p>";59 $html .= "<p>" . sprintf( __( 'Click <a href="%s">here</a> to access the main configuration.', 'wc-unzer-direct' ), add_query_arg( $main_settings_args, admin_url( 'admin.php' ) ) ) . "</p>";56 $html = sprintf( "<p><small>Version: %s</small>", WC_UNZER_DIRECT_VERSION ); 57 $html .= "<p>" . sprintf( __( 'Allows you to receive payments via %s', 'wc-unzer-direct' ), $this->method_title ) . "</p>"; 58 $html .= "<p>" . sprintf( __( 'This module has it\'s main configuration inside the \'Unzer Direct\' tab.', 'wc-unzer-direct' ), 's' ) . "</p>"; 59 $html .= "<p>" . sprintf( __( 'Click <a href="%s">here</a> to access the main configuration.', 'wc-unzer-direct' ), add_query_arg( $main_settings_args, admin_url( 'admin.php' ) ) ) . "</p>"; 60 60 61 61 $html .= get_parent_class( get_parent_class( get_parent_class( $this ) ) )::generate_settings_html( $form_fields, $echo ); … … 115 115 return str_replace( 'Unzer Direct - ', '', $this->method_title ); 116 116 } 117 118 /** 119 * @return bool 120 */ 121 protected function is_checkout_different_shipping_address_enabled() { 122 parse_str( wc()->checkout()->get_value( 'post_data' ), $data ); 123 124 return isset( $data['ship_to_different_address'] ) && wc_string_to_bool( $data['ship_to_different_address'] ); 125 } 117 126 } -
wc-unzer-direct/trunk/classes/instances/unzer-direct-debit.php
r2729310 r2730820 96 96 $country = strtoupper( WC()->checkout()->get_value( 'billing_country' ) ); 97 97 98 if ( ! ( $cart_total >= $cart_min && $cart_total <= $cart_max ) || ( 'EUR' !== $currency && 'CHF' !== $currency ) || ( 'DE' !== $country && 'AT' !== $country ) ) {98 if ( ! ( $cart_total >= $cart_min && $cart_total <= $cart_max ) || ( 'EUR' !== $currency && 'CHF' !== $currency ) || ( 'DE' !== $country && 'AT' !== $country ) || $this->is_checkout_different_shipping_address_enabled() ) { 99 99 unset( $gateways[ $this->id ] ); 100 100 } -
wc-unzer-direct/trunk/classes/instances/unzer-direct-invoice.php
r2729310 r2730820 79 79 public function filter_icon( $icon ) { 80 80 if ( 'invoice' === $icon ) { 81 $icon = 'unzer';81 $icon = 'unzer'; 82 82 } 83 83 84 return $icon; 84 85 } … … 89 90 public function maybe_disable_gateway( $gateways ) { 90 91 if ( isset( $gateways[ $this->id ] ) && is_checkout() && ( $cart = WC()->cart ) ) { 91 $cart_total = (float) $cart->get_total( 'edit' ); 92 $cart_min = 10; 93 $cart_max = 3500; 94 $currency = strtoupper( get_woocommerce_currency() ); 92 $cart_total = (float) $cart->get_total( 'edit' ); 93 $cart_min = 10; 94 $cart_max = 3500; 95 $currency = strtoupper( get_woocommerce_currency() ); 96 $country = strtoupper( WC()->checkout()->get_value( 'billing_country' ) ); 95 97 96 if ( ! ( $cart_total >= $cart_min && $cart_total <= $cart_max ) || ( 'EUR' !== $currency && 'CHF' !== $currency ) ) {98 if ( ! ( $cart_total >= $cart_min && $cart_total <= $cart_max ) || ( 'EUR' !== $currency && 'CHF' !== $currency ) || ( 'DE' !== $country && 'AT' !== $country && 'CH' !== $country ) || $this->is_checkout_different_shipping_address_enabled() ) { 97 99 unset( $gateways[ $this->id ] ); 98 100 } -
wc-unzer-direct/trunk/wc-unzer-direct.php
r2729310 r2730820 4 4 * Plugin URI: http://wordpress.org/plugins/wc-unzer-direct/ 5 5 * Description: Integrate Unzer Direct payment gateway with WooCommerce 6 * Version: 1.4. 36 * Version: 1.4.4 7 7 * Author: Unzer 8 8 * Text Domain: wc-unzer-direct … … 17 17 } 18 18 19 define( 'WC_UNZER_DIRECT_VERSION', '1.4. 3' );19 define( 'WC_UNZER_DIRECT_VERSION', '1.4.4' ); 20 20 define( 'WC_UNZER_DIRECT_URL', plugins_url( __FILE__ ) ); 21 21 define( 'WC_UNZER_DIRECT_PATH', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.