@@ -7,80 +7,80 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | -do_action( 'getpaid_before_payment_form_cart_item', $form, $item ); |
|
| 12 | +do_action('getpaid_before_payment_form_cart_item', $form, $item); |
|
| 13 | 13 | |
| 14 | 14 | $currency = $form->get_currency(); |
| 15 | 15 | |
| 16 | 16 | ?> |
| 17 | -<div class='getpaid-payment-form-items-cart-item getpaid-<?php echo $item->is_required() ? 'required' : 'selectable'; ?> item-<?php echo $item->get_id(); ?>'> |
|
| 17 | +<div class='getpaid-payment-form-items-cart-item getpaid-<?php echo $item->is_required() ? 'required' : 'selectable'; ?> item-<?php echo $item->get_id(); ?>'> |
|
| 18 | 18 | <div class="form-row"> |
| 19 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
| 20 | - <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?>-<?php echo $item->get_id(); ?>"> |
|
| 19 | + <?php foreach ($columns as $key => $label) : ?> |
|
| 20 | + <div class="<?php echo 'name' == $key ? 'col-12 col-sm-5' : 'col-12 col-sm' ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?>-<?php echo $item->get_id(); ?>"> |
|
| 21 | 21 | <?php |
| 22 | 22 | |
| 23 | 23 | // Item name. |
| 24 | - if ( 'name' == $key ) { |
|
| 25 | - echo sanitize_text_field( $item->get_name() ); |
|
| 24 | + if ('name' == $key) { |
|
| 25 | + echo sanitize_text_field($item->get_name()); |
|
| 26 | 26 | $description = $item->get_description(); |
| 27 | 27 | |
| 28 | - if ( ! empty( $description ) ) { |
|
| 29 | - $description = wp_kses_post( $description ); |
|
| 28 | + if (!empty($description)) { |
|
| 29 | + $description = wp_kses_post($description); |
|
| 30 | 30 | echo "<small class='form-text text-muted pr-2 m-0'>$description</small>"; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - $description = getpaid_item_recurring_price_help_text( $item, $currency ); |
|
| 33 | + $description = getpaid_item_recurring_price_help_text($item, $currency); |
|
| 34 | 34 | |
| 35 | - if ( $description ) { |
|
| 35 | + if ($description) { |
|
| 36 | 36 | echo "<small class='form-text text-muted pr-2 m-0'>$description</small>"; |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | // Item price. |
| 41 | - if ( 'price' == $key ) { |
|
| 41 | + if ('price' == $key) { |
|
| 42 | 42 | |
| 43 | 43 | // Set the currency position. |
| 44 | 44 | $position = wpinv_currency_position(); |
| 45 | 45 | |
| 46 | - if ( $position == 'left_space' ) { |
|
| 46 | + if ($position == 'left_space') { |
|
| 47 | 47 | $position = 'left'; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if ( $position == 'right_space' ) { |
|
| 50 | + if ($position == 'right_space') { |
|
| 51 | 51 | $position = 'right'; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - if ( $item->user_can_set_their_price() ) { |
|
| 55 | - $price = max( (float) $item->get_price(), (float) $item->get_minimum_price() ); |
|
| 54 | + if ($item->user_can_set_their_price()) { |
|
| 55 | + $price = max((float) $item->get_price(), (float) $item->get_minimum_price()); |
|
| 56 | 56 | ?> |
| 57 | 57 | <div class="input-group input-group-sm"> |
| 58 | - <?php if( 'left' == $position ) : ?> |
|
| 58 | + <?php if ('left' == $position) : ?> |
|
| 59 | 59 | <div class="input-group-prepend"> |
| 60 | - <span class="input-group-text"><?php echo wpinv_currency_symbol( $currency ); ?></span> |
|
| 60 | + <span class="input-group-text"><?php echo wpinv_currency_symbol($currency); ?></span> |
|
| 61 | 61 | </div> |
| 62 | 62 | <?php endif; ?> |
| 63 | - <input type="text" name="getpaid-items[<?php echo (int) $item->get_id(); ?>][price]" value="<?php echo $price; ?>" placeholder="<?php echo esc_attr( $item->get_minimum_price() ); ?>" class="getpaid-item-price-input border"> |
|
| 63 | + <input type="text" name="getpaid-items[<?php echo (int) $item->get_id(); ?>][price]" value="<?php echo $price; ?>" placeholder="<?php echo esc_attr($item->get_minimum_price()); ?>" class="getpaid-item-price-input border"> |
|
| 64 | 64 | |
| 65 | - <?php if( 'left' != $position ) : ?> |
|
| 65 | + <?php if ('left' != $position) : ?> |
|
| 66 | 66 | <div class="input-group-append"> |
| 67 | - <span class="input-group-text"><?php echo wpinv_currency_symbol( $currency ); ?></span> |
|
| 67 | + <span class="input-group-text"><?php echo wpinv_currency_symbol($currency); ?></span> |
|
| 68 | 68 | </div> |
| 69 | 69 | <?php endif; ?> |
| 70 | 70 | </div> |
| 71 | 71 | <?php |
| 72 | 72 | } else { |
| 73 | - echo wpinv_price( wpinv_format_amount( $item->get_price() ), $currency ); |
|
| 73 | + echo wpinv_price(wpinv_format_amount($item->get_price()), $currency); |
|
| 74 | 74 | ?> |
| 75 | - <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][price]' type='hidden' class='getpaid-item-price-input' value='<?php echo esc_attr( $item->get_price() ); ?>'> |
|
| 75 | + <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][price]' type='hidden' class='getpaid-item-price-input' value='<?php echo esc_attr($item->get_price()); ?>'> |
|
| 76 | 76 | <?php |
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // Item quantity. |
| 81 | - if ( 'quantity' == $key ) { |
|
| 81 | + if ('quantity' == $key) { |
|
| 82 | 82 | |
| 83 | - if ( $item->allows_quantities() ) { |
|
| 83 | + if ($item->allows_quantities()) { |
|
| 84 | 84 | ?> |
| 85 | 85 | <input name='getpaid-items[<?php echo (int) $item->get_id(); ?>][quantity]' type='number' class='getpaid-item-quantity-input pr-1 border' value='<?php echo (int) $item->get_qantity(); ?>' min='1' required> |
| 86 | 86 | <?php |
@@ -94,15 +94,15 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | // Item sub total. |
| 97 | - if ( 'subtotal' == $key ) { |
|
| 98 | - echo wpinv_price( wpinv_format_amount( $item->get_sub_total() ), $currency ); |
|
| 97 | + if ('subtotal' == $key) { |
|
| 98 | + echo wpinv_price(wpinv_format_amount($item->get_sub_total()), $currency); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - do_action( "getpaid_payment_form_cart_item_$key", $item, $form ); |
|
| 101 | + do_action("getpaid_payment_form_cart_item_$key", $item, $form); |
|
| 102 | 102 | ?> |
| 103 | 103 | </div> |
| 104 | 104 | <?php endforeach; ?> |
| 105 | 105 | </div> |
| 106 | 106 | </div> |
| 107 | 107 | <?php |
| 108 | -do_action( 'getpaid_payment_form_cart_item', $form, $item ); |
|
| 108 | +do_action('getpaid_payment_form_cart_item', $form, $item); |
|