Bypass "Billing" section when customer is paying with gift card - woocommerce - php

My wp theme was custom built and has a great ajax checkout experience, but I am having an issue when customers attempt to pay with a yith gift card that covers the total amount of the cart. Essentially throughout the checkout process there is a single button to proceed through the checkout steps; Shipping>billing>summary.
When a gift card is applied that covers the total amount, customers put in their shipping info, then click next to go to billing, at this point the credit card fields are hidden (as they should be), but the button (which now states "Proceed To Summary") is no longer clickable. The customer cant move from the empty billing page to complete their order. As such, is there a way to bypass the "billing" step if the order total is 0 and go straight to summary so the customer can complete their order?
Here is the code from my theme form-checkout.php :
<?php
/**
* Checkout Form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* #see https://docs.woocommerce.com/document/template-structure/
* #package WooCommerce/Templates
* #version 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
do_action( 'woocommerce_before_checkout_form', $checkout );
// If checkout registration is disabled and not logged in, the user cannot checkout.
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) );
return;
}
?>
<div class="checkout-container d-lg-flex">
<!-- Checkout main -->
<div class="checkout-main">
<!-- Header -->
<div class="checkout-header"><?php _e('Secure checkout', 'woocommerce'); ?></div>
<?php if( !is_user_logged_in() ){ ?>
<div class="checkout-section section-checkout-logreg">
<?php
if( isset($_GET['action']) && $_GET['action'] == 'register' ) {
//wc_get_template( '/checkout/checkout_registration_page.php' );
wc_get_template( 'myaccount/form-registration.php' );
}
else if( isset($_GET['action']) && $_GET['action'] == 'forgot_pass' ) {
//wc_get_template( '/checkout/checkout_registration_page.php' );
wc_get_template( 'myaccount/form-lost-password.php' );
}
else{
//wc_get_template( '/checkout/checkout_login_page.php' );
wc_get_template( 'myaccount/form-login-single.php' );
}
?>
<!-- Button area -->
<div class="checkout-button-area d-flex flex-wrap justify-content-between">
<?php _e('Back To store', 'woocommerce'); ?>
</div>
</div>
<?php } ?>
<!-- Progress -->
<div class="checkout-progress"<?php if(!is_user_logged_in()){ echo ' style="display: none;"'; } ?>>
<div class="progress-step active" id="progress-shipping">
<?php _e('Shipping', 'woocommerce'); ?>
</div>
<div class="progress-step" id="progress-payment">
<?php _e('Payment', 'woocommerce'); ?>
</div>
<div class="progress-step" id="progress-summary">
<?php _e('Summary', 'woocommerce'); ?>
</div>
</div>
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data"<?php if(!is_user_logged_in()){ echo ' style="display: none;"'; } ?>>
<?php if ( $checkout->get_checkout_fields() ) : ?>
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
<div id="customer_details">
<!-- Checkout Shipping -->
<div class="checkout-section section-shipping">
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
</div>
<!-- Checkout Billing -->
<div class="checkout-section section-billing" style="display: none;">
<?php do_action( 'woocommerce_checkout_billing' ); ?>
</div>
<!-- Checkout Summary -->
<div class="checkout-section section-summary" style="display: none;">
<div class="row">
<div class="summary-section summary-shipping col-12 col-sm-6">
<div class="summary-section-wrap">
<h4 class="summary-title"><?php _e('Shipping Address', 'woocommerce'); ?></h4>
<button type="button" class="summary-edit" title="<?php _e('Edit', 'woocommerce'); ?>"><?php _e('Edit', 'woocommerce'); ?></button>
<div class="summary-section-content"></div>
</div>
</div>
<div class="summary-section summary-option col-12 col-sm-6">
<div class="summary-section-wrap">
<h4 class="summary-title"><?php _e('Shipping Option', 'woocommerce'); ?></h4>
<button type="button" class="summary-edit" title="<?php _e('Edit', 'woocommerce'); ?>"><?php _e('Edit', 'woocommerce'); ?></button>
<div class="summary-section-content"></div>
</div>
</div>
<div class="summary-section summary-payment col-12 col-sm-6" data-ending="<?php _e('Ending in', 'woocommerce'); ?>">
<div class="summary-section-wrap">
<h4 class="summary-title"><?php _e('Payment Details', 'woocommerce'); ?></h4>
<button type="button" class="summary-edit" title="<?php _e('Edit', 'woocommerce'); ?>"><?php _e('Edit', 'woocommerce'); ?></button>
<div class="summary-section-content"></div>
</div>
</div>
</div>

Related

woocommerce change html structure of checkout page

Currently trying to change the html structure of the checkout page in woocommerce. I was looking for the template file, so I could add a title here and there. Some re-ordering of the input fields, like e-mail address at the top. But I can't find the template or way how to do it.
I did find the checkout form php file, but that is not what I was looking for. The code of the file:
<?php
/**
* Checkout Form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* #see https://docs.woocommerce.com/document/template-structure/
* #package WooCommerce\Templates
* #version 3.5.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
do_action( 'woocommerce_before_checkout_form', $checkout );
// If checkout registration is disabled and not logged in, the user cannot checkout.
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) );
return;
}
?>
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
<?php if ( $checkout->get_checkout_fields() ) : ?>
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
<div class="col2-set" id="customer_details">
<div class="col-1">
<?php do_action( 'woocommerce_checkout_billing' ); ?>
</div>
<div class="col-2">
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
</div>
</div>
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
<?php endif; ?>
<?php do_action( 'woocommerce_checkout_before_order_review_heading' ); ?>
<h3 id="order_review_heading"><?php esc_html_e( 'Your order', 'woocommerce' ); ?></h3>
<?php do_action( 'woocommerce_checkout_before_order_review' ); ?>
<div id="order_review" class="woocommerce-checkout-review-order">
<?php do_action( 'woocommerce_checkout_order_review' ); ?>
</div>
<?php do_action( 'woocommerce_checkout_after_order_review' ); ?>
</form>
<?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?>
So the result I want is to re-order the input fields (e-mail at top for example), adding some text here and there and it would be amazing to add some custom classes.
The only thing I found online is to add some filters/hooks into the functions.php. But it feels a little bit hacky to do that.
Edit / additional info:
Sorry if my question wasn't clear. I'm trying to achieve this layout:
<div class="column">
<h2 class="title">Billing Details</h2>
<?php if ( $checkout->get_checkout_fields() ) : ?>
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
<h2> CONTACT INFO </h2>
<div class="field">
<label class="label">First Name</label>
<div class="control">
<input class="input" type="text" placeholder="First Name">
</div>
</div>
<h2> SHIPPING INFO </h2>
etc......
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
<?php endif; ?>
</div>
As you can see I want to re-order the field, but also adding some html tags in it for titles or additional texts. That's why I'm looking for changing the HTML structure/template, instead of the array order of the fields.

Change Woocommerce variable.php from table to div

I am currently customizing (or trying) the yourtheme/woocommerce/single-product/add-to-cart/variable.php in my theme however even though I've tried I can't seem to get rid of the table in the woocommerce code and replace it by divs and dropdown lists. I would like it to look like the sections below:
<!-- Product Section -->
<section>
<div class="container my-5 px-5 pt-4 bg-light">
<div class="row no-gutters">
<div class="col-md-5">
<img src="<?php bloginfo('template_directory'); ?>/assets/images/best-seller.jpg" class="img-fluid w-75 m-auto d-block"
alt="Best Seller">
</div>
<div class="col-md-7 pr-md-5">
<h1 class="main-heading my-4">BLACK MATTE JAR</h1>
<form>
<div class="form-row">
<div class="form-group col-md-7">
<label for="inputSize">Size</label>
<select id="inputSize" class="form-control">
<option selected>Big - 14 oz</option>
<option>Small - 10 oz</option>
</select>
</div>
<div class="form-group col-md-4 offset-md-1">
<label for="inputQuantity">Quantity</label>
<select id="inputQuantity" class="form-control">
<option selected>1 unit</option>
<option>2 unit</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-7">
<label for="inputFragrance">Fragrance</label>
<select id="inputFragrance" class="form-control">
<option selected><img src="<?php bloginfo('template_directory'); ?>/assets/images/icon-1.png" class="d-inline w-25">Peace
of mind</option>
<option>Refreshing</option>
</select>
</div>
<div class="form-group col-md-4 offset-md-1 mt-auto">
<div class="product-price pb-3">
<h5>Price <span class="float-right">25$</span></h5>
</div>
</div>
</div>
<button type="submit" class="btn btn-lg px-5 my-4">ADD TO CART</button>
</form>
</div>
</div>
</div>
</section>
So when I started all this, I managed to get all my product variations with the code below, however I couldn't figure out how to manage the woocommerce hooks and how to get the proper variation price when the user changed the dropdown list (so the code below was not using hooks at all)
`<div class="col-md-7 pr-md-5">
<h1 class="main-heading my-4"><?php the_title(); ?></h1>
<?php
/*** ADD TO CART DYNAMIC */
$attribute_keys = array_keys( $attributes );
$variations_json = wp_json_encode( $available_variations );
$variations_attr = function_exists( 'wc_esc_json' ) ? wc_esc_json( $variations_json ) : _wp_specialchars( $variations_json, ENT_QUOTES, 'UTF-8', true );
do_action( 'woocommerce_before_add_to_cart_form' ); ?>
<form class="variations_form cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->get_id() ); ?>" data-product_variations="<?php echo $variations_attr; // WPCS: XSS ok. ?>">
<div class="form-row">
<div class="form-group col-md-7">
<label for="inputSize">Size</label>
<select id="inputSize" class="form-control">
<?php
$product = wc_get_product( get_the_id() );
$size = $product->get_attribute('size');
$size_array = print_r ($size , TRUE);
$size_text = explode ('|', $size_array);
$aux_size = 0;
foreach ($size_text as $s_txt){
if ($aux ==0) {
?><option selected><?php echo $s_txt ?></option>
<?php
} else {
?><option><?php echo $s_txt ?></option>
<?php
}
}
?>
</select>
</div>
<div class="form-group col-md-4 offset-md-1">
<label for="inputQuantity">Quantity</label>
<select id="inputQuantity" class="form-control">
<option selected>1 Unit</option>
<option>2 Units</option>
<option>3 Units</option>
<option>4 Units</option>
<option>5 Units</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-7">
<label for="inputFragrance">Fragrance</label>
<select id="inputFragrance" class="form-control">
<?php
$fragrance = $product->get_attribute('fragrance');
$fragrance_array = print_r ($fragrance , TRUE);
$fragrance_text = explode ('|', $fragrance_array);
$aux_size = 0;
foreach ($fragrance_text as $f_txt){
if ($aux ==0) {
?><option selected><?php echo $f_txt ?></option>
<?php
} else {
?><option><?php echo $f_txt ?></option>
<?php
}
}
?>
</select>
</div>
<div class="form-group col-md-4 offset-md-1 mt-auto">
<div class="product-price pb-3">
<h5>Price <span class="float-right">25$</span></h5>
</div>
</div>
</div>
<button onclick="Add_to_cart(<?php $product?>)" type="submit" class="btn btn-lg px-5 my-4">ADD TO CART</button>`
Then I discovered the variable.php, so below is what I can't make it:
1 - can't seem to give the same look and feel as before (refer to first code shown in this post.
2 - When I replace in the below code the and by div's the first div on the first iteration gives me $attribute_name = null.
<?php foreach ( $attributes as $attribute_name => $options ) : ?>
<tr>
<td class="label"><label for="<?php echo esc_attr( sanitize_title( $attribute_name ) ); ?>"><?php echo wc_attribute_label( $attribute_name ); // WPCS: XSS ok. ?></label></td>
<td class="value">
3 - I can't seem to fetch the variation price upon user change the product attributes.
Did any of you managed to achieve this? If so could you share your code? I really hope this thread is cleaner and clearer. I've added till where I've got in the code below.
<div class="col-md-7 pr-md-5">
<h1 class="main-heading my-4"><?php the_title(); ?></h1>
<?php
/*** ADD TO CART DYNAMIC */
$available_variations = $product->get_available_variations();
$attributes = $product->get_variation_attributes();
$attribute_keys = array_keys( $attributes );
$variations_json = wp_json_encode( $available_variations );
$variations_attr = function_exists( 'wc_esc_json' ) ? wc_esc_json( $variations_json ) : _wp_specialchars( $variations_json, ENT_QUOTES, 'UTF-8', true );
do_action( 'woocommerce_before_add_to_cart_form' ); ?>
<form class="variations_form cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->get_id() ); ?>" data-product_variations="<?php echo $variations_attr; // WPCS: XSS ok. ?>">
<?php do_action( 'woocommerce_before_variations_form' );
?>
<?php if ( empty( $available_variations ) && false !== $available_variations ) : ?>
<p class="stock out-of-stock"><?php echo esc_html( apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'woocommerce' ) ) ); ?></p>
<?php else : ?>
<table class="variations" cellspacing="0">
<tbody>
<?php foreach ( $attributes as $attribute_name => $options ) : ?>
<tr>
<td class="label"><label for="<?php echo esc_attr( sanitize_title( $attribute_name ) ); ?>"><?php echo wc_attribute_label( $attribute_name ); // WPCS: XSS ok. ?></label></td>
<td class="value">
<?php
wc_dropdown_variation_attribute_options(
array(
'options' => $options,
'attribute' => $attribute_name,
'product' => $product,
)
);
?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="single_variation_wrap">
<?php
/**
* Hook: woocommerce_before_single_variation.
*/
do_action( 'woocommerce_before_single_variation' );
/**
* Hook: woocommerce_single_variation. Used to output the cart button and placeholder for variation data.
*
* #since 2.4.0
* #hooked woocommerce_single_variation - 10 Empty div for variation data.
* #hooked woocommerce_single_variation_add_to_cart_button - 20 Qty and cart button.
*/
do_action( 'woocommerce_single_variation' );
/**
* Hook: woocommerce_after_single_variation.
*/
do_action( 'woocommerce_after_single_variation' );
?>
</div>
<?php endif; ?>
Ive been trying to change it for days without any success I return back to the original code most of the time this is the reason why I made my first post here as I cannot add the price into this code, nor turn it as per my html design.
Sorry for the simple question but I can't find anyone online that have achieved this before.
I've managed to do it with the following code:
<?php endforeach; ?>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="">Quantity</label>
<div class="single_variation_wrap">
<?php
/**
* Hook: woocommerce_before_single_variation.
*/
do_action( 'woocommerce_before_single_variation' );
/**
* Hook: woocommerce_single_variation. Used to output the cart button and placeholder for variation data.
*
* #since 2.4.0
* #hooked woocommerce_single_variation - 10 Empty div for variation data.
* #hooked woocommerce_single_variation_add_to_cart_button - 20 Qty and cart button.
*/
do_action( 'woocommerce_single_variation' );
/**
* Hook: woocommerce_after_single_variation.
*/
do_action( 'woocommerce_after_single_variation' );
?>
</div>
</div>
<div class="form-group col-md-6 mt-6">
<div class="product-price pb-3">
<h5 >Price <?php echo $product->get_price_html(); ?></h5>
</div>
</div>
</div>
<?php endif; ?>
<?php do_action( 'woocommerce_after_variations_form' ); ?>
</form>
I've converted the tds into div's in an easy manner that is still identifiable by woocommerce. Furthermore I've managed to fetch the price as shown in the code.
Now I am only having one issue which is to force the user to stay in my custom page if no selection is made.
Hope someone can suport me

How to load WooCommerce cross sell and cart-collaterals inside one div

I'm trying to load the WooCommerce .cross-sells div inside a custom div named .cart-collaterals-cross-sell which already includes the .cart-collaterals elements, so that i can style them better in one row. At the moment the .cross-sells is loaded by the cross-sells.php and i tried to implement the code of it into the cart.php, so that i have both functions in one file and that i could put them inside the same div. Problem is that the cross sells doesn't load when i copy the code inside the cart.php
That's the original code of the cart.php which includes already the .cart-collaterals
<div class="cart-collaterals-cross-sell">
<div class="cart-collaterals">
<h2><?php _e( 'Cart totals', 'woocommerce' ); ?></h2>
<?php if ( ! is_ajax() && wc_coupons_enabled() ) { ?>
<div class="nm-coupon-wrap">
<div class="nm-coupon-inner">
<?php esc_html_e( 'Gutschein', 'nm-framework' ); ?>
<div class="nm-coupon">
<input type="text" id="nm-coupon-code" class="input-text" name="nm_coupon_code" value="" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" />
<input type="submit" id="nm-apply-coupon-btn" class="button border" name="nm_apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>" />
<?php do_action( 'woocommerce_cart_coupon' ); ?>
</div>
</div>
</div>
<?php } ?>
<?php
/**
* Cart collaterals hook.
*
* #hooked woocommerce_cross_sell_display
* #hooked woocommerce_cart_totals - 10
*/
do_action( 'woocommerce_cart_collaterals' );
?>
</div>
</div>
And that's the way i tried it. What am i doing wrong?
<div class="cart-collaterals-cross-sell">
<div class="cart-collaterals">
<h2><?php _e( 'Cart totals', 'woocommerce' ); ?></h2>
<?php if ( ! is_ajax() && wc_coupons_enabled() ) { ?>
<div class="nm-coupon-wrap">
<div class="nm-coupon-inner">
<?php esc_html_e( 'Gutschein', 'nm-framework' ); ?>
<div class="nm-coupon">
<input type="text" id="nm-coupon-code" class="input-text" name="nm_coupon_code" value="" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" />
<input type="submit" id="nm-apply-coupon-btn" class="button border" name="nm_apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>" />
<?php do_action( 'woocommerce_cart_coupon' ); ?>
</div>
</div>
</div>
<?php } ?>
<?php
/**
* Cart collaterals hook.
*
* #hooked woocommerce_cross_sell_display
* #hooked woocommerce_cart_totals - 10
*/
do_action( 'woocommerce_cart_collaterals' );
?>
</div>
<div class="cross-sells">
<h2><?php _e( 'You may be interested in…', 'woocommerce' ) ?></h2>
<?php woocommerce_product_loop_start(); ?>
<?php foreach ( $cross_sells as $cross_sell ) : ?>
<?php
$post_object = get_post( $cross_sell->get_id() );
setup_postdata( $GLOBALS['post'] =& $post_object );
wc_get_template_part( 'content', 'product' ); ?>
<?php endforeach; ?>
<?php woocommerce_product_loop_end(); ?>
</div>
</div>
You can use following two functions
For Cart collaterals ==> woocommerce_cart_totals();
For Cross Sells =======> woocommerce_cross_sell_display();
Try Using following code I am providing here:
<div class="cart-collaterals-cross-sell">
<div class="cart-collaterals">
<h2><?php _e( 'Cart totals', 'woocommerce' ); ?></h2>
<?php if ( ! is_ajax() && wc_coupons_enabled() ) { ?>
<div class="nm-coupon-wrap">
<div class="nm-coupon-inner">
<?php esc_html_e( 'Gutschein', 'nm-framework' ); ?>
<div class="nm-coupon">
<input type="text" id="nm-coupon-code" class="input-text" name="nm_coupon_code" value="" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" />
<input type="submit" id="nm-apply-coupon-btn" class="button border" name="nm_apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>" />
<?php do_action( 'woocommerce_cart_coupon' ); ?>
</div>
</div>
</div>
<?php } ?>
<?php
/**
* Cart collaterals hook.
*
* #hooked woocommerce_cross_sell_display
* #hooked woocommerce_cart_totals - 10
*/
//do_action( 'woocommerce_cart_collaterals' );
woocommerce_cart_totals();
?>
</div>
<div class="cross-sells">
<?php woocommerce_cross_sell_display(); ?>
</div>
</div>

WooCommerce order details after checkout page

Hi im creating my custom woocommerce theme and i want to display to user his order details like order id, total price etc. after checkout. Currently when user click on pay button on checkout page (shop.com/checkout/ where he can fill out billing information) my url change to shop.com/checkout/order-received/98/?key=wc_order_5a70a40f30bde and order appears in woocommerce admin panel so everything works fine, but the user still see checkout page (billing form etc), not the order details page. So the only thing that's change is url, not the page.
Here is my checkout page code:
https://pastebin.com/R3kyE6TW
<?php
$checkout = WC()->checkout;
do_action( 'woocommerce_before_checkout_form', $checkout );
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) );
return;
}
?>
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
<div class="row">
<div class="col-md-6">
<?php if ( $checkout->get_checkout_fields() ) : ?>
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
<div class="" id="customer_details">
<div class="">
<?php do_action( 'woocommerce_checkout_billing' ); ?>
</div>
<div class="clearfix"></div>
<div class="woocomerce_additional_custom">
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
</div>
</div>
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
<?php endif; ?>
</div>
<div class="col-md-6">
<h3 id="order_review_heading"><?php _e( 'Your order', 'woocommerce' ); ?></h3>
<?php do_action( 'woocommerce_checkout_before_order_review' ); ?>
<div id="order_review" class="woocommerce-checkout-review-order">
<?php do_action( 'woocommerce_checkout_order_review' ); ?>
</div>
<?php do_action( 'woocommerce_checkout_after_order_review' ); ?>
</div>
</div>
</form>
<?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?>
So how can display to user his order details? Is there any shortcode for order details page like there is for checkout page [woocommerce_checkout] where i can past woocommerce/order/order-details.php code?

Change woocommerce checkout page form labels

How can I change the label "Your Order" to "Your Items" in WooCommerce checkout page. I dont need to change any fields, just the name of the form categories. Also is it possible to remove the number in front of the label?
You need to change file woocommerce/templates/checkout/form-checkout.php
around line number 55
Change <h3 id="order_review_heading"><?php _e( 'Your order', 'woocommerce' ); ?></h3>
Your Order to Your Item
<h3 id="order_review_heading"><?php _e( 'Your Item', 'woocommerce' ); ?></h3>
Thanks
I was able to change the text by altering the following code in wp-content/themes/yourselectedtheme/inc/woocommerce/template-tags.php
if( ! function_exists( 'unicase_review_wrapper_start' ) ) {
function unicase_review_wrapper_start() {
?>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingFour">
<h3 class="panel-title">
<a data-toggle="collapse" href="#collapseFour" aria-expanded="true" aria-controls="collapseFour">
<?php
if ( !is_user_logged_in() && 'yes' === get_option( 'woocommerce_enable_checkout_login_reminder' ) && WC()->cart->coupons_enabled() ) {
?>
<span>5</span>
<?php
} elseif ( is_user_logged_in() && WC()->cart->coupons_enabled() ) {
?>
<span>2</span>
<?php
} else{
?>
<span>2</span>
<?php
}
?>
<?php esc_html_e('YOUR ITEM (**************)' , 'unicase'); ?></a>
</h3>
</div>
<div id="collapseFour" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingFour">
<div class="panel-body">
<?php
}
}

Categories