@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | if ( !wpinv_is_gateway_active( $enabled_gateway ) && !empty( $gateways ) ) { |
| 311 | 311 | if(wpinv_is_gateway_active( wpinv_get_default_gateway()) ){ |
| 312 | 312 | $enabled_gateway = wpinv_get_default_gateway(); |
| 313 | - }else{ |
|
| 313 | + } else{ |
|
| 314 | 314 | $enabled_gateway = $gateways[0]; |
| 315 | 315 | } |
| 316 | 316 | |
@@ -336,8 +336,9 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | $payments = new WP_Query( $args ); |
| 338 | 338 | |
| 339 | - if( $payments ) |
|
| 340 | - $ret = $payments->post_count; |
|
| 339 | + if( $payments ) { |
|
| 340 | + $ret = $payments->post_count; |
|
| 341 | + } |
|
| 341 | 342 | return $ret; |
| 342 | 343 | } |
| 343 | 344 | |
@@ -512,7 +512,7 @@ |
||
| 512 | 512 | |
| 513 | 513 | $response['success'] = true; |
| 514 | 514 | $response['msg'] = __( 'Discount has been applied successfully.', 'invoicing' ); |
| 515 | - } else { |
|
| 515 | + } else { |
|
| 516 | 516 | $errors = wpinv_get_errors(); |
| 517 | 517 | if ( !empty( $errors['wpinv-discount-error'] ) ) { |
| 518 | 518 | $response['msg'] = $errors['wpinv-discount-error']; |
@@ -70,8 +70,9 @@ discard block |
||
| 70 | 70 | if( !empty( $tax_rates ) ) { |
| 71 | 71 | // Locate the tax rate for this country / state, if it exists |
| 72 | 72 | foreach( $tax_rates as $key => $tax_rate ) { |
| 73 | - if( $country != $tax_rate['country'] ) |
|
| 74 | - continue; |
|
| 73 | + if( $country != $tax_rate['country'] ) { |
|
| 74 | + continue; |
|
| 75 | + } |
|
| 75 | 76 | |
| 76 | 77 | if( !empty( $tax_rate['global'] ) ) { |
| 77 | 78 | if( !empty( $tax_rate['rate'] ) ) { |
@@ -79,8 +80,9 @@ discard block |
||
| 79 | 80 | } |
| 80 | 81 | } else { |
| 81 | 82 | |
| 82 | - if( empty( $tax_rate['state'] ) || strtolower( $state ) != strtolower( $tax_rate['state'] ) ) |
|
| 83 | - continue; |
|
| 83 | + if( empty( $tax_rate['state'] ) || strtolower( $state ) != strtolower( $tax_rate['state'] ) ) { |
|
| 84 | + continue; |
|
| 85 | + } |
|
| 84 | 86 | |
| 85 | 87 | $state_rate = $tax_rate['rate']; |
| 86 | 88 | if( 0 !== $state_rate || !empty( $state_rate ) ) { |
@@ -183,8 +185,9 @@ discard block |
||
| 183 | 185 | } |
| 184 | 186 | |
| 185 | 187 | function wpinv_cart_needs_tax_address_fields() { |
| 186 | - if( !wpinv_is_cart_taxed() ) |
|
| 187 | - return false; |
|
| 188 | + if( !wpinv_is_cart_taxed() ) { |
|
| 189 | + return false; |
|
| 190 | + } |
|
| 188 | 191 | |
| 189 | 192 | return ! did_action( 'wpinv_after_cc_fields', 'wpinv_default_cc_address_fields' ); |
| 190 | 193 | } |
@@ -971,8 +971,9 @@ |
||
| 971 | 971 | return false; |
| 972 | 972 | } |
| 973 | 973 | |
| 974 | - if ( empty( $this->ID ) ) |
|
| 975 | - return false; |
|
| 974 | + if ( empty( $this->ID ) ) { |
|
| 975 | + return false; |
|
| 976 | + } |
|
| 976 | 977 | |
| 977 | 978 | if ( ( ( is_user_logged_in() && current_user_can( 'manage_options' ) ) || $added_by_user ) && !$system ) { |
| 978 | 979 | $user = get_user_by( 'id', get_current_user_id() ); |
@@ -1,6 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | // Exit if accessed directly. |
| 3 | -if (!defined( 'ABSPATH' ) ) exit; |
|
| 3 | +if (!defined( 'ABSPATH' ) ) { |
|
| 4 | + exit; |
|
| 5 | +} |
|
| 4 | 6 | |
| 5 | 7 | class WPInv_EUVat { |
| 6 | 8 | private static $is_ajax = false; |
@@ -1445,16 +1447,18 @@ discard block |
||
| 1445 | 1447 | |
| 1446 | 1448 | if ( !empty( $tax_rates ) ) { |
| 1447 | 1449 | foreach ( $tax_rates as $key => $tax_rate ) { |
| 1448 | - if ( $country != $tax_rate['country'] ) |
|
| 1449 | - continue; |
|
| 1450 | + if ( $country != $tax_rate['country'] ) { |
|
| 1451 | + continue; |
|
| 1452 | + } |
|
| 1450 | 1453 | |
| 1451 | 1454 | if ( !empty( $tax_rate['global'] ) ) { |
| 1452 | 1455 | if ( 0 !== $tax_rate['rate'] || !empty( $tax_rate['rate'] ) ) { |
| 1453 | 1456 | $rate = number_format( $tax_rate['rate'], 4 ); |
| 1454 | 1457 | } |
| 1455 | 1458 | } else { |
| 1456 | - if ( empty( $tax_rate['state'] ) || strtolower( $state ) != strtolower( $tax_rate['state'] ) ) |
|
| 1457 | - continue; |
|
| 1459 | + if ( empty( $tax_rate['state'] ) || strtolower( $state ) != strtolower( $tax_rate['state'] ) ) { |
|
| 1460 | + continue; |
|
| 1461 | + } |
|
| 1458 | 1462 | |
| 1459 | 1463 | $state_rate = $tax_rate['rate']; |
| 1460 | 1464 | if ( 0 !== $state_rate || !empty( $state_rate ) ) { |
@@ -1,6 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // Exit if accessed directly. |
| 3 | -if (!defined( 'ABSPATH' ) ) exit; |
|
| 3 | +if (!defined( 'ABSPATH' ) ) { |
|
| 4 | + exit; |
|
| 5 | +} |
|
| 4 | 6 | |
| 5 | 7 | /** |
| 6 | 8 | * WPInv_Session Class. |
@@ -1,6 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // Exit if accessed directly |
| 3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 4 | + exit; |
|
| 5 | +} |
|
| 4 | 6 | |
| 5 | 7 | class WPInv_Item { |
| 6 | 8 | public $ID = 0; |
@@ -1,6 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // Exit if accessed directly |
| 3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 4 | + exit; |
|
| 5 | +} |
|
| 4 | 6 | |
| 5 | 7 | add_action( 'wpinv_worldpay_cc_form', '__return_false' ); |
| 6 | 8 | |
@@ -165,20 +165,17 @@ |
||
| 165 | 165 | { |
| 166 | 166 | $xmlx = $xml; |
| 167 | 167 | $first = false; |
| 168 | - } |
|
| 169 | - else |
|
| 168 | + } else |
|
| 170 | 169 | { |
| 171 | 170 | $parent = $xml->xpath('parent::*'); |
| 172 | 171 | $xmlx = $parent[0]->addChild($xml->getName()); |
| 173 | 172 | } |
| 174 | - } |
|
| 175 | - else |
|
| 173 | + } else |
|
| 176 | 174 | { |
| 177 | 175 | $xmlx = $xml->addChild($key); |
| 178 | 176 | } |
| 179 | 177 | $this->setParameters($xmlx, $value); |
| 180 | - } |
|
| 181 | - else |
|
| 178 | + } else |
|
| 182 | 179 | { |
| 183 | 180 | $xml->$key = $value; |
| 184 | 181 | } |