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
}
}
Related
Here is a piece of my code.
<div class="thim-course-grid">
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="lpr_course <?php echo 'course-grid-' . $columns; ?>">
**<div class="course-item" onmouseover="hide_card('<?= get_the_ID()?>');" onmouseout="show_card('<?= get_the_ID()?>');">**
<div class="course-thumbnail" id="course-thumbnail-<?= get_the_ID()?>">
<a href="<?php echo esc_url( get_the_permalink( get_the_ID() ) ); ?>">
<?php echo thim_get_feature_image( get_post_thumbnail_id( get_the_ID() ), 'full', $thumb_w, $thumb_h, get_the_title() ); ?>
</a>
<?php do_action( 'thim_inner_thumbnail_course' ); ?>
<!-- <a class="course-readmore"
href="<?php echo esc_url( get_the_permalink( get_the_ID() ) ); ?>"><?php echo esc_html__( 'Read More', 'eduma' ); ?></a> -->
</div>
<div class="thim-course-content" id="thim-course-content-<?= get_the_ID()?>">
<?php learn_press_courses_loop_item_instructor();
the_title( sprintf( '<h2 class="course-title">', esc_url( get_permalink() ) ), '</h2>' );
?>
<?php if ( class_exists( 'LP_Addon_Coming_Soon_Courses_Preload' ) && learn_press_is_coming_soon( get_the_ID() ) ): ?>
<div class="message message-warning learn-press-message coming-soon-message">
<?php esc_html_e( 'Coming soon', 'eduma' ) ?>
</div>
<?php else: ?>
<div class="course-meta">
<?php learn_press_courses_loop_item_instructor(); ?>
<?php thim_course_ratings(); ?>
<?php learn_press_courses_loop_item_students(); ?>
<?php thim_course_ratings_count(); ?>
<?php learn_press_courses_loop_item_price(); ?>
</div>
<?php learn_press_courses_loop_item_price(); ?>
<?php endif; ?>
<div class="course-readmore">
<?php esc_html_e( 'Read More', 'eduma' ); ?>
</div>
</div>
</div>
</div>
<?php
endwhile;
?>
</div>
On the 4th line, I wanted to truncate the course maps on mouse over, so that all the part of the map at the bottom of the image disappears, only to reappear when there is no more flyover. The result obtained is different from what I wanted.
I put the link to the site to see: www.formatine.com
And here is the JS part that I added as well.
function hide_card(id) {
document.getElementById('thim-course-content-'+id).style.display = 'none';
document.getElementById('course-thumbnail-'+id).innerHTML = "<?= wp_oembed_get( $media_intro ) ?>";
}
function show_card(id) {
document.getElementById('thim-course-content-'+id).style.display = 'block';
document.getElementById('course-thumbnail-'+id).style.display = 'block';
}
Do you have an idea for me please? Thank you.
Don't use "display: none" because once it has it, the element "disappears".
It is better for you, to then, if you want to include a video instead of the card, for example, do it by having both, one behind the other by default, if you "mouseover" display the code INSIDE of one, and on "mouseout", display the other.
<div class="mycard">
<div class="myinfoforthevideo"></div>
<div class="myvideo"></div>
</div>
You controll the events on mycard class, and hide myinfoforthevideo by default, on "mouseover", hide it and show then myvideo, and on "mouseout" hide myvideo and show myinfoforthevideo
You're hidding everything so now since its a width: 0/height: 0 let's say, you don't have any place to do the mouseover now.
Extra:
You can try flip cards as another option, like this:
https://codepen.io/Aoyue/pen/pLJqgE
Im trying to show the title of the wordpress category, Im using a standard woocommerce hook, however it is behaving very weird, the PHP variable escapes outside of the html tags, any idea why?
This is the code:
add_action ( 'woocommerce_before_main_content', 'ebani_show_category_name' );
function ebani_show_category_name() {
if ( is_product_category() ) {
$category_title = single_cat_title();
?>
<div class='container'>
<div class='row ebani-title'>
<div class='col-xs-12'>
<h3 class='title'><?php $category_title ?></h3>
</div>
</div>
</div>
<?php
}
}
It prints in the page this way:
Category 1
<div class='container'>
<div class='row ebani-title'>
<div class='col-xs-12'>
<h3 class='title'></h3>
</div>
</div>
</div>
As you can see the category shows above the tags, and the <h3> shows empty in the markup, Im not sure what am I doing wrong here.
single_cat_title title will echo the value when called by default. You can override this with the second param by passing in a false value. Just make sure to add the default value '' (empty string) as the first param if you are not adding a prefix.
Update to either:
add_action ( 'woocommerce_before_main_content', 'ebani_show_category_name' );
function ebani_show_category_name() {
if ( is_product_category() ) {
$category_title = single_cat_title('', false);
?>
<div class='container'>
<div class='row ebani-title'>
<div class='col-xs-12'>
<h3 class='title'><?php echo $category_title; ?></h3>
</div>
</div>
</div>
<?php
}
}
or
add_action ( 'woocommerce_before_main_content', 'ebani_show_category_name' );
function ebani_show_category_name() {
if ( is_product_category() ) {
?>
<div class='container'>
<div class='row ebani-title'>
<div class='col-xs-12'>
<h3 class='title'><?php single_cat_title(); ?></h3>
</div>
</div>
</div>
<?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>
I need to remove a filter that sets the template of my results, in this case, it uses UL to organize the content. I don't need this.
Case 1) Remove this and my code takes care os the layout
Case 2) Apply another filter to set my own template.
woocommerce/includes/widgets/class-wc-widgets-products.php
line 192
echo apply_filters( 'woocommerce_before_widget_product_list', '<ul class="product_list_widget">' );
line 199
echo apply_filters( 'woocommerce_after_widget_product_list', '</ul>');
There is another element that comes from the hook, but this one I couldn't found the place it comes from, my rendered html shows it:
<div class="listaprodutos"><h2 class="widgettitle">Produtos</h2>
<ul class="product_list_widget">
My goal is remove all these two settings (widgettitle and product_list_widget).
I add this lines in my functions.php page, but it didn't work:
// Remove UL format for products_widget
remove_filter( 'woocommerce_before_widget_product_list', '<ul class="product_list_widget">' );
remove_filter( 'woocommerce_after_widget_product_list', '</ul>' );
front-page.php
<p class="display-4" style="text-align:center">Produtos mais vendidos</p>
<div class="container">
<?php if ( is_active_sidebar( 'listaprodutos' ) ) : ?>
<?php dynamic_sidebar( 'listaprodutos' ); ?>
<?php endif; ?>
</div>
content-widget-product.php
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="card" style="width: 19rem; margin-bottom:3rem; margin-top:3rem;">
<img class="card-img-top img-fluid" src=<?php echo $product->get_image(); ?>
<div class="card-block">
<h4 class="card-title"><?php echo $product->get_name(); ?></h4>
<p class="card-text">
<?php echo $product->get_price_html(); ?>
</p>
<a class="btn btn-quick" href="<?php echo esc_url( $product->get_permalink() ); ?>">Ler o post</a>
</div>
</div>
</div>
</div>
Right now the code below generates the content seen here:
Currently the title has to be clicked for the post page to be loaded, but I want to allow the entire background image to be clickable. Is this possible? I've tried surrounding the card div with the tag from the title code, but that still did not let me click the background image like a link.
<article id="post-<?php the_ID(); ?>" <?php post_class('card-box col-lg-4 col-md-6 col-sm-12 col-xs-12'); ?>>
<div class="card" data-background="image" data-src="<?php esc_url( the_post_thumbnail_url( 'large' ) ); ?>">
<div class="header">
<?php
$categories = get_the_category();
if ( ! empty( $categories ) ) {
?>
<div class="category">
<h6>
<span class="category">
<?php echo '<a class="category" href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a>'; ?>
</span>
</h6>
</div>
<?php } ?>
</div>
<div class="content">
<?php the_title( '<h4 class="entry-title">', '</h4>' ); ?>
<span class="date"><?php echo esc_html( get_the_date() ); ?></span>
</div>
<div class="filter"></div>
</div> <!-- end card -->
</article>
Try jQuery approach like below
$('.card').on('click', function(event){
var elementTag = event.target.tagName.toLowerCase();
if(elementTag === 'div') {
var pageurl = $(this).find('.entry-title a').attr('href');
window.location.href = pageurl;
}
});`