Woocommerce empty cart customization - by PIYUSH AGRAWAL

This topic has 3 replies, 2 voices, and was last updated 7 years, 10 months ago ago by Olga Barlow

  • Avatar: PIYUSH AGRAWAL
    PIYUSH AGRAWAL
    Participant
    February 19, 2017 at 18:29

    I am trying to customize the empty cart page in xstore.

    copied the file
    from:/themes/xstore/woocommerce/cart/cart-empty.php
    to:themes/xstore-child/woocommerce/cart/cart-empty.php

    and made changes to the file in child-thme. Still the site not showing the updates. Tell me what am I doing wrong.

    original file:
    <?php
    /**
    * Empty cart page
    *
    * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-empty.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.woothemes.com/document/template-structure/
    * @author WooThemes
    * @package WooCommerce/Templates
    * @version 2.0.0
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly
    }

    wc_print_notices();

    $empty_cart_content = etheme_get_option(’empty_cart_content’);

    ?>

    <?php do_action(‘woocommerce_cart_is_empty’); ?>

    <div class=”cart-empty empty-cart-block”>
    <i class=”icon-shopping-cart”></i>

    <?php if( empty( $empty_cart_content ) ): ?>
    <h1 style=”text-align: center;”><?php _e(‘YOUR SHOPPING CART IS EMPTY’, ‘xstore’) ?></h1>
    <p style=”text-align: center;”><?php _e(‘We invite you to get acquainted with an assortment of our shop. Surely you can find something for yourself!’, ‘xstore’) ?></p>
    <?php else: ?>
    <?php echo do_shortcode( $empty_cart_content ); ?>
    <?php endif; ?>
    <?php if ( wc_get_page_id( ‘shop’ ) > 0 ) : ?>
    <p>“><span><?php esc_html_e(‘Return To Shop’, ‘xstore’) ?></span></p>
    <?php endif; ?>

    </div>

    customized file in child:

    application/x-httpd-php cart-empty.php
    PHP script text
    <?php
    /**
    * Empty cart page
    *
    * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-empty.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.woothemes.com/document/template-structure/
    * @author WooThemes
    * @package WooCommerce/Templates
    * @version 2.0.0
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly
    }

    wc_print_notices();

    $empty_cart_content = etheme_get_option(’empty_cart_content’);

    ?>

    <?php do_action(‘woocommerce_cart_is_empty’); ?>

    <div class=”cart-empty empty-cart-block”>
    <i class=”icon-shopping-cart”></i>

    <?php if( empty( $empty_cart_content ) ): ?>
    <h1 style=”text-align: center;”><?php _e(‘YOUR ORDER IS EMPTY’, ‘xstore’) ?></h1>
    <p style=”text-align: center;”><?php _e(‘We invite you to get acquainted with an assortment of our menu. Surely you can find something for yourself!’, ‘xstore’) ?></p>
    <?php else: ?>
    <?php echo do_shortcode( $empty_cart_content ); ?>
    <?php endif; ?>
    <?php if ( wc_get_page_id( ‘shop’ ) > 0 ) : ?>
    <p>“><span><?php esc_html_e(‘Return To Shop’, ‘xstore’) ?></span></p>
    <?php endif; ?>

    </div>

    2 Answers
    Avatar: PIYUSH AGRAWAL
    PIYUSH AGRAWAL
    Participant
    February 19, 2017 at 21:46

    I figured this out. Basically we need to update the $empty_cart_content==”

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 20, 2017 at 18:38

    Hello,

    I’m glad that you sorted out. Feel free to ask if you need any other help.

    Regards

  • Viewing 3 results - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.Log in/Sign up

Helpful Topics

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.