Move cart and checkout notices from top - by rwlee33

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

  • Avatar: rwlee33
    rwlee33
    Participant
    March 23, 2017 at 12:31

    Hi,

    There are a few cart notices from YITH Themes that print at the top of the cart and checkout page.

    Can you help me move them to another location. preferably to woocommerce_cart_collaterals and woocommerce_checkout_after_customer_details

    https://snag.gy/5UfD2C.jpg

    I’d like to leave the “Returning Customer” message at the top.

    The YITH developer gave me a bit of code to try, but it didn’t work:

    function move_woocommerce_message(){
      remove_action( 'woocommerce_before_cart', 'wc_print_notices', 10 );
      add_action( 'woocommerce_cart_collaterals', 'wc_print_notices', 35 ); }
    add_filter('wp', 'move_woocommerce_message');

    He says they are defined in the cart.php file:
    https://snag.gy/a0Io2T.jpg

    Any help would be appreciated! Thanks!

    8 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    March 24, 2017 at 14:27

    Hello,

    You sent screenshot from the checkout page but you are talking about cart page. Let’s clear the situation: code does not work for the cart page or for the checkout page?
    Because cart page code won’t work for the checkout page.

    Regards

    Avatar: rwlee33
    rwlee33
    Participant
    March 24, 2017 at 18:39

    The issue is for cart and checkout.

    Avatar: rwlee33
    rwlee33
    Participant
    March 25, 2017 at 05:14

    Here is screenshot of cart too:
    https://snag.gy/Brvljh.jpg

    Avatar: rwlee33
    rwlee33
    Participant
    March 27, 2017 at 12:44

    Hello? Any help on this?

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    March 29, 2017 at 16:05

    Hello,

    We are not sure if the code you get from the previous developer works even for the default theme.

    To move notices on the cart page add the following code in child theme functions.php

    function move_woocommerce_message(){
    	add_action( 'woocommerce_cart_coupon', 'wc_print_notices', 35 ); }
    add_filter('wp', 'move_woocommerce_message');

    Then copy file xstore/woocommerce/cart/cart.php into child theme and comment out the line from screenshot http://prntscr.com/epxve0

    If you need any other additional customization, please, contact customization team because theme support does not includes additional customization service.

    Regards

    Avatar: rwlee33
    rwlee33
    Participant
    March 30, 2017 at 11:11

    Thanks! When I copy into the child theme, should it be in:
    xstore/xstore-child/woocommerce/cart
    or just:
    xstore/xstore-child/woocommerce/

    Avatar: rwlee33
    rwlee33
    Participant
    March 30, 2017 at 11:23

    Also, I just edited the file xstore/woocommerce/cart/cart.php and it did nothing

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    March 30, 2017 at 13:09

    Hello,

    Files should be paced in wp-content/themes/xstore-child/woocommerce/cart/cart.php + code into child theme functions.php (wp-content/themes/xstore-child/functions.php).

    Regards

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

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

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