[Support request] Shopping cart in header showing price with applied couon?

Home Forums Support [Support request] Shopping cart in header showing price with applied couon?

Home Forums Support Shopping cart in header showing price with applied couon?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2061195
    Éva

    Hi Team,

    Hope you had a wonderful holiday 🙂
    Quick question. Is it possible that the cart in the header shows the price with a coupon applied? With the default settings I can see only the full price, however I would love it if it was possible that it would reflect any applied coupons.

    Thank you so much for your help.
    Regards
    Éva

    #2061278
    Elvin
    Staff
    Customer Support

    Hi Éva,

    It’s possible but this will require a plugin that can actually fetch the discounted price by coupon and be displayed in place of the default GP Premium cart.

    You’ll need something like this PHP snippet:

    This one removes the default GP premium cart and adds a custom one depending on what you’ve added as callback function

    add_action( 'wp', function() {
        remove_action( 'generate_menu_bar_items', 'generate_wc_do_cart_menu_item', 5 );
        add_action('generate_menu_bar_items', 'gp_woo_custom_cart', 5 );
    } );

    And then you can create a sample function like this where you can add the replacement cart.

    function gp_woo_custom_cart(){
    	//do your plugin's shortcode for displaying cart here.
    }

    Here’s how to add PHP – https://docs.generatepress.com/article/adding-php/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.