• Resolved mygreenfootprint

    (@mygreenfootprint)


    Hi Guys I would like to hide the coupon field on my cart page but leave it showing on the checkout page. Is this possible?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there,

    Here’s the snippet that you’ll need:
    https://gist.github.com/maxrice/8550827

    If you only want to hide the coupon field on the cart, then you’ll just use the first part of the of the snippet related to the cart.

    Thread Starter mygreenfootprint

    (@mygreenfootprint)

    Hi Hannah,

    Thanks for the help!
    where about’s in my child theme should I place this?

    Also When I insert it i get a “syntax error unexpected <“

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Hi there!

    You should either place it in your child theme’s functions.php file, or use a snippets plugin to manage snippets, such as this one:
    https://www.ads-software.com/plugins/code-snippets/

    I’d recommend adding the entire snippet first. If that works, great – from there, you can remove sections that you don’t need.

    Thread Starter mygreenfootprint

    (@mygreenfootprint)

    Thanks Hannah,
    would this be placed at the bottom of the functions php file in the child theme? or does it need to be placed in the cart php file?

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    If you aren’t sure about the functions.php file, I’d recommend using a plugin instead – it makes it quite a bit easier. I personally use a plugin, because it lets me switch themes without losing the snippets.

    You can put it anywhere you like in the functions.php file, so long as you don’t put it in the middle of other code snippets.

    Thread Starter mygreenfootprint

    (@mygreenfootprint)

    Hi Hannah,
    I get the follow syntax when I insert the code. Any advice would be appreciated….?

    https://prnt.sc/nzw1cu

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there,

    That’s a screenshot of the snippet code in some sort of editor. I’m not seeing any errors, though – it’s just displaying code.

    Thread Starter mygreenfootprint

    (@mygreenfootprint)

    My apologies Hannah,

    Have tried again. thank you so much for your patience. I would rather include the code in the child theme functions file as I’m trying to keep the number of plugins to a minimum t=slow as not to slow things down.

    Thanks again!

    https://prnt.sc/nzw7ne

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    In this case, it doesn’t really matter if you’re using the Code Snippets plugin or the functions.php file. Either way, you’re adding extra code to the site.

    Thanks for pointing out the syntax error. <php only belongs at the very beginning of the file, so should be removed here. It’s included in the snippet for completeness. You may need to include an ?> at the end of the file.

    Thread Starter mygreenfootprint

    (@mygreenfootprint)

    Thanks Hannah all sorted now. Really appreciate your assistance!

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Glad that helped ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Hide Coupon on Cart Page’ is closed to new replies.