Changeset 2291750
- Timestamp:
- 04/25/2020 08:05:58 PM (6 years ago)
- Location:
- wc-express-checkout
- Files:
-
- 4 edited
-
tags/1.0.1/classes/class-woocommerce-express-checkout.php (modified) (8 diffs)
-
tags/1.0.1/templates/woocommerce/express-checkout/checkout/thankyou.php (modified) (1 diff)
-
trunk/classes/class-woocommerce-express-checkout.php (modified) (8 diffs)
-
trunk/templates/woocommerce/express-checkout/checkout/thankyou.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wc-express-checkout/tags/1.0.1/classes/class-woocommerce-express-checkout.php
r2290477 r2291750 7 7 add_filter( 'woocommerce_form_field', array( $this, 'remove_paragraph' ), 10, 4 ); 8 8 add_filter( 'page_template', array( $this, 'setup_page_template' ) ); 9 add_filter( 'woocommerce_enqueue_styles', array( $this, 'remove_woo_styles' ) );9 add_filter( 'woocommerce_enqueue_styles', array( $this, 'remove_woo_styles' ) ); 10 10 11 11 add_filter( 'woocommerce_enable_order_notes_field', '__return_false' ); … … 46 46 public function change_field_labels( $fields ) { 47 47 48 $fields['billing']['billing_postcode']['label'] = __( 'Zip Code', 'woocommerce-express-checkout' );49 $fields['billing']['billing_postcode']['placeholder'] = __( 'Zip Code', 'woocommerce-express-checkout' );48 $fields['billing']['billing_postcode']['label'] = __( 'Zip Code', 'woocommerce-express-checkout' ); 49 $fields['billing']['billing_postcode']['placeholder'] = __( 'Zip Code', 'woocommerce-express-checkout' ); 50 50 51 51 $fields['billing']['billing_company']['label'] = __( 'Company', 'woocommerce-express-checkout' ); … … 95 95 96 96 public function remove_woo_styles( $array ) { 97 if ( ! $this->is_enabled() ) {98 return $array;99 }100 return array();97 if ( ! $this->is_enabled() ) { 98 return $array; 99 } 100 return array(); 101 101 102 102 } … … 109 109 remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 ); 110 110 remove_action( 'woocommerce_thankyou', 'woocommerce_order_details_table', 10 ); 111 if ( class_exists( 'woocommerce' ) ) {112 wp_dequeue_style( 'select2' );113 wp_deregister_style( 'select2' );114 wp_dequeue_style( 'wc-block-style-css' );115 wp_deregister_style( 'wc-block-style-css' );116 117 wp_dequeue_script( 'select2' );118 wp_deregister_script( 'select2' );119 wp_dequeue_script( 'selectWoo' );120 wp_deregister_script( 'selectWoo' );121 wp_dequeue_script( 'wc-enhanced-select' );122 wp_deregister_script( 'wc-enhanced-select' );123 }111 if ( class_exists( 'woocommerce' ) ) { 112 wp_dequeue_style( 'select2' ); 113 wp_deregister_style( 'select2' ); 114 wp_dequeue_style( 'wc-block-style-css' ); 115 wp_deregister_style( 'wc-block-style-css' ); 116 117 wp_dequeue_script( 'select2' ); 118 wp_deregister_script( 'select2' ); 119 wp_dequeue_script( 'selectWoo' ); 120 wp_deregister_script( 'selectWoo' ); 121 wp_dequeue_script( 'wc-enhanced-select' ); 122 wp_deregister_script( 'wc-enhanced-select' ); 123 } 124 124 125 125 } … … 148 148 $screen_reader = array_search( 'screen-reader-text', $args['label_class'], true ); 149 149 if ( $screen_reader !== false ) { 150 unset( $args['label_class'][ $screen_reader ] );150 unset( $args['label_class'][ $screen_reader ] ); 151 151 } 152 152 switch ( $args['type'] ) { … … 318 318 } else { 319 319 if ( in_array( $key, array( 'billing_address_1', 'billing_address_2', 'billing_city', 'billing_phone', 'shipping_address_1', 'shipping_address_2', 'shipping_city', 'shipping_phone' ), true ) ) { 320 $args['class'] = array( 'col-12' );320 $args['class'] = array( 'col-12' ); 321 321 } elseif ( in_array( $key, array( 'billing_first_name', 'billing_last_name', 'shipping_address_1' ), true ) ) { 322 322 $args['class'] = array( 'col-md-6' ); … … 336 336 public function remove_unnecessary_styles() { 337 337 if ( $this->is_enabled() ) { 338 $enabled = array( 'wec', 'admin-bar', ' stripe_styles' );338 $enabled = array( 'wec', 'admin-bar', 'wec-icons' ); 339 339 global $wp_styles; 340 340 foreach ( $wp_styles->queue as $key => $value ) { … … 351 351 if ( $this->is_enabled() ) { 352 352 $suffix = SCRIPT_DEBUG ? '' : '.min'; 353 wp_enqueue_style( 'wec-icons', 'https://fonts.googleapis.com/icon?family=Material+Icons', array() ); 353 354 wp_enqueue_style( 'wec', WSC_URL . '/assets/css/style' . $suffix . '.css', array() ); 354 // wp_enqueue_script( 'wec-popper', WSC_URL . '/assets/js/popper.min.js', array( 'jquery' ), '1.0.0', true );355 355 wp_enqueue_script( 'wec-bootstrap', WSC_URL . '/assets/js/bootstrap.min.js', array( 'jquery' ), '1.0.0', true ); 356 356 wp_enqueue_script( 'wec', WSC_URL . '/assets/js/custom.js', array( 'jquery' ), '1.0.0', true ); -
wc-express-checkout/tags/1.0.1/templates/woocommerce/express-checkout/checkout/thankyou.php
r2290477 r2291750 96 96 <div class="card cart border-0 bg-light mb-3"> 97 97 <div class="card-body py-4"> 98 <?php woocommerce_order_details_table( $order->get_id() ); ?>98 <?php woocommerce_order_details_table( $order->get_id() ); ?> 99 99 </div> 100 100 <div class="card-footer border-0"> 101 101 <div class="d-flex justify-content-between align-items-center h5 mb-0"> 102 102 <strong>Order Total</strong> 103 <span> $30</span>103 <span><?php echo $order->get_total(); ?></span> 104 104 </div> 105 105 </div> -
wc-express-checkout/trunk/classes/class-woocommerce-express-checkout.php
r2290477 r2291750 7 7 add_filter( 'woocommerce_form_field', array( $this, 'remove_paragraph' ), 10, 4 ); 8 8 add_filter( 'page_template', array( $this, 'setup_page_template' ) ); 9 add_filter( 'woocommerce_enqueue_styles', array( $this, 'remove_woo_styles' ) );9 add_filter( 'woocommerce_enqueue_styles', array( $this, 'remove_woo_styles' ) ); 10 10 11 11 add_filter( 'woocommerce_enable_order_notes_field', '__return_false' ); … … 46 46 public function change_field_labels( $fields ) { 47 47 48 $fields['billing']['billing_postcode']['label'] = __( 'Zip Code', 'woocommerce-express-checkout' );49 $fields['billing']['billing_postcode']['placeholder'] = __( 'Zip Code', 'woocommerce-express-checkout' );48 $fields['billing']['billing_postcode']['label'] = __( 'Zip Code', 'woocommerce-express-checkout' ); 49 $fields['billing']['billing_postcode']['placeholder'] = __( 'Zip Code', 'woocommerce-express-checkout' ); 50 50 51 51 $fields['billing']['billing_company']['label'] = __( 'Company', 'woocommerce-express-checkout' ); … … 95 95 96 96 public function remove_woo_styles( $array ) { 97 if ( ! $this->is_enabled() ) {98 return $array;99 }100 return array();97 if ( ! $this->is_enabled() ) { 98 return $array; 99 } 100 return array(); 101 101 102 102 } … … 109 109 remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 ); 110 110 remove_action( 'woocommerce_thankyou', 'woocommerce_order_details_table', 10 ); 111 if ( class_exists( 'woocommerce' ) ) {112 wp_dequeue_style( 'select2' );113 wp_deregister_style( 'select2' );114 wp_dequeue_style( 'wc-block-style-css' );115 wp_deregister_style( 'wc-block-style-css' );116 117 wp_dequeue_script( 'select2' );118 wp_deregister_script( 'select2' );119 wp_dequeue_script( 'selectWoo' );120 wp_deregister_script( 'selectWoo' );121 wp_dequeue_script( 'wc-enhanced-select' );122 wp_deregister_script( 'wc-enhanced-select' );123 }111 if ( class_exists( 'woocommerce' ) ) { 112 wp_dequeue_style( 'select2' ); 113 wp_deregister_style( 'select2' ); 114 wp_dequeue_style( 'wc-block-style-css' ); 115 wp_deregister_style( 'wc-block-style-css' ); 116 117 wp_dequeue_script( 'select2' ); 118 wp_deregister_script( 'select2' ); 119 wp_dequeue_script( 'selectWoo' ); 120 wp_deregister_script( 'selectWoo' ); 121 wp_dequeue_script( 'wc-enhanced-select' ); 122 wp_deregister_script( 'wc-enhanced-select' ); 123 } 124 124 125 125 } … … 148 148 $screen_reader = array_search( 'screen-reader-text', $args['label_class'], true ); 149 149 if ( $screen_reader !== false ) { 150 unset( $args['label_class'][ $screen_reader ] );150 unset( $args['label_class'][ $screen_reader ] ); 151 151 } 152 152 switch ( $args['type'] ) { … … 318 318 } else { 319 319 if ( in_array( $key, array( 'billing_address_1', 'billing_address_2', 'billing_city', 'billing_phone', 'shipping_address_1', 'shipping_address_2', 'shipping_city', 'shipping_phone' ), true ) ) { 320 $args['class'] = array( 'col-12' );320 $args['class'] = array( 'col-12' ); 321 321 } elseif ( in_array( $key, array( 'billing_first_name', 'billing_last_name', 'shipping_address_1' ), true ) ) { 322 322 $args['class'] = array( 'col-md-6' ); … … 336 336 public function remove_unnecessary_styles() { 337 337 if ( $this->is_enabled() ) { 338 $enabled = array( 'wec', 'admin-bar', ' stripe_styles' );338 $enabled = array( 'wec', 'admin-bar', 'wec-icons' ); 339 339 global $wp_styles; 340 340 foreach ( $wp_styles->queue as $key => $value ) { … … 351 351 if ( $this->is_enabled() ) { 352 352 $suffix = SCRIPT_DEBUG ? '' : '.min'; 353 wp_enqueue_style( 'wec-icons', 'https://fonts.googleapis.com/icon?family=Material+Icons', array() ); 353 354 wp_enqueue_style( 'wec', WSC_URL . '/assets/css/style' . $suffix . '.css', array() ); 354 // wp_enqueue_script( 'wec-popper', WSC_URL . '/assets/js/popper.min.js', array( 'jquery' ), '1.0.0', true );355 355 wp_enqueue_script( 'wec-bootstrap', WSC_URL . '/assets/js/bootstrap.min.js', array( 'jquery' ), '1.0.0', true ); 356 356 wp_enqueue_script( 'wec', WSC_URL . '/assets/js/custom.js', array( 'jquery' ), '1.0.0', true ); -
wc-express-checkout/trunk/templates/woocommerce/express-checkout/checkout/thankyou.php
r2290477 r2291750 27 27 <?php if ( $order->has_status( 'failed' ) ) : ?> 28 28 29 <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php esc_html_e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p>29 <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php esc_html_e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p> 30 30 31 <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions"> 32 <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php esc_html_e( 'Pay', 'woocommerce' ); ?></a> 33 <?php if ( is_user_logged_in() ) : ?> 34 <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php esc_html_e( 'My account', 'woocommerce' ); ?></a> 35 <?php endif; ?> 36 </p> 37 38 <?php else : ?> 39 40 <div class="row"> 41 <div class="col-lg-7"> 42 <div class="media align-items-center mb-4"> 43 <i class="material-icons text-success display-3 mr-2"> 44 check_circle_outline 45 </i> 46 <div class="media-body"> 47 <div class="mb-1">Order #<?php echo $order->get_id(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div> 48 <div class="h5">Thank you <?php echo $order->get_billing_first_name(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>!</div> 49 </div> 50 </div> 51 <div class="card bg-light border-0 mb-4"> 52 <div class="card-header border-0"> 53 <h3 class="h6 mb-0">Your order is confirmed</h3> 54 </div> 55 <div class="card-body"> 56 <p class="card-text">We've accepted your order, and we're getting it ready. A confirmation email has been sent to <strong><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong></p> 57 </div> 58 </div> 59 <div class="card bg-light border-0 mb-4"> 60 <div class="card-header border-0"> 61 <h3 class="h6 mb-0">Customer information</h3> 62 </div> 63 <div class="card-body"> 64 <div class="row"> 65 <div class="col-sm-6"> 66 <h4 class="h6">Shipping Address</h4> 67 <p><?php echo $order->get_formatted_shipping_address(); ?></p> 68 </div> 69 <div class="col-sm-6"> 70 <h4 class="h6">Billing Address</h4> 71 <p><?php echo $order->get_formatted_billing_address(); ?></p> 72 </div> 73 <div class="col-sm-6"> 74 <h4 class="h6">Shipping Method</h4> 75 <p><?php echo $order->get_shipping_method(); ?></p> 76 </div> 77 <div class="col-sm-6"> 78 <h4 class="h6">Payment Method</h4> 79 <p class="payments"><?php echo $order->get_payment_method_title(); ?></p> 80 </div> 81 </div> 82 </div> 83 </div> 84 <div class="d-flex flex-wrap justify-content-between align-items-center mb-4"> 85 <p class="mb-sm-0"><i class="material-icons align-bottom"> 86 help_outline 87 </i> Need help? <a href="#">Contact us</a></p> 88 <a href="<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>" class="btn btn-primary"><?php _e( 'Continue Shopping', 'wcs' ); ?></a> 89 </div> 90 <div class="d-flex flex-wrap justify-content-between align-items-center mb-4"> 91 <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?> 92 <?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?> 93 </div> 94 </div> 95 <div class="col-lg-5"> 96 <div class="card cart border-0 bg-light mb-3"> 97 <div class="card-body py-4"> 98 <?php woocommerce_order_details_table( $order->get_id() ); ?> 99 </div> 100 <div class="card-footer border-0"> 101 <div class="d-flex justify-content-between align-items-center h5 mb-0"> 102 <strong>Order Total</strong> 103 <span>$30</span> 104 </div> 105 </div> 106 </div> 107 <div class="bg-light text-center p-3"> 108 <i class="material-icons align-bottom">lock</i> Secure Checkout 109 </div> 110 </div> 111 </div> 112 113 <?php endif; ?> 31 <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions"> 32 <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php esc_html_e( 'Pay', 'woocommerce' ); ?></a> 33 <?php if ( is_user_logged_in() ) : ?> 34 <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php esc_html_e( 'My account', 'woocommerce' ); ?></a> 35 <?php endif; ?> 36 </p> 114 37 115 38 <?php else : ?> 116 39 117 <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), null ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> 40 <div class="row"> 41 <div class="col-lg-7"> 42 <div class="media align-items-center mb-4"> 43 <i class="material-icons text-success display-3 mr-2"> 44 check_circle_outline 45 </i> 46 <div class="media-body"> 47 <div class="mb-1">Order #<?php echo $order->get_id(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div> 48 <div class="h5">Thank you <?php echo $order->get_billing_first_name(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>!</div> 49 </div> 50 </div> 51 <div class="card bg-light border-0 mb-4"> 52 <div class="card-header border-0"> 53 <h3 class="h6 mb-0">Your order is confirmed</h3> 54 </div> 55 <div class="card-body"> 56 <p class="card-text">We've accepted your order, and we're getting it ready. A confirmation email has been sent to <strong><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong></p> 57 </div> 58 </div> 59 <div class="card bg-light border-0 mb-4"> 60 <div class="card-header border-0"> 61 <h3 class="h6 mb-0">Customer information</h3> 62 </div> 63 <div class="card-body"> 64 <div class="row"> 65 <div class="col-sm-6"> 66 <h4 class="h6">Shipping Address</h4> 67 <p><?php echo $order->get_formatted_shipping_address(); ?></p> 68 </div> 69 <div class="col-sm-6"> 70 <h4 class="h6">Billing Address</h4> 71 <p><?php echo $order->get_formatted_billing_address(); ?></p> 72 </div> 73 <div class="col-sm-6"> 74 <h4 class="h6">Shipping Method</h4> 75 <p><?php echo $order->get_shipping_method(); ?></p> 76 </div> 77 <div class="col-sm-6"> 78 <h4 class="h6">Payment Method</h4> 79 <p class="payments"><?php echo $order->get_payment_method_title(); ?></p> 80 </div> 81 </div> 82 </div> 83 </div> 84 <div class="d-flex flex-wrap justify-content-between align-items-center mb-4"> 85 <p class="mb-sm-0"><i class="material-icons align-bottom"> 86 help_outline 87 </i> Need help? <a href="#">Contact us</a></p> 88 <a href="<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>" class="btn btn-primary"><?php _e( 'Continue Shopping', 'wcs' ); ?></a> 89 </div> 90 <div class="d-flex flex-wrap justify-content-between align-items-center mb-4"> 91 <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?> 92 <?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?> 93 </div> 94 </div> 95 <div class="col-lg-5"> 96 <div class="card cart border-0 bg-light mb-3"> 97 <div class="card-body py-4"> 98 <?php woocommerce_order_details_table( $order->get_id() ); ?> 99 </div> 100 <div class="card-footer border-0"> 101 <div class="d-flex justify-content-between align-items-center h5 mb-0"> 102 <strong>Order Total</strong> 103 <span><?php echo $order->get_total(); ?></span> 104 </div> 105 </div> 106 </div> 107 <div class="bg-light text-center p-3"> 108 <i class="material-icons align-bottom">lock</i> Secure Checkout 109 </div> 110 </div> 111 </div> 112 113 <?php endif; ?> 114 115 <?php else : ?> 116 117 <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), null ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> 118 118 119 119 <?php endif; ?>
Note: See TracChangeset
for help on using the changeset viewer.