WooCommerce - excelling eCommerce
How to put ,- after the price woocommerse (5 posts)

  1. atoompjenl
    Posted 2 years ago #

    Hello WooCommerce users.

    first of all I think its a great store add on for wordpress.

    so mi question is can anyone tell me how I can get ,- after all the prices in my store. I think that I need some string or code to put in a scrip php or css but I am searching now for more then 2 weeks and I can not find it so please is there somebody who can tell me watt string or code to put where.

    I really be great full to the person that can tell me how to establish it.
    thanks in advanced


  2. terrytsang
    Posted 2 years ago #

    Hi, you can paste below code at the bottom of your theme functions.php file:

    This will apply changes to product details page only

    add_filter( 'woocommerce_get_price_html', 'custom_price_html', 100, 2 );
    function custom_price_html( $price, $product ){
        if(is_single() && $price != "")
          $price = $price . ',-';
         return apply_filters( 'woocommerce_get_price', $price );

    This will apply to all pages and catalog as well:

    add_filter( 'woocommerce_get_price_html', 'custom_price_html', 100, 2 );
    function custom_price_html( $price, $product ){
        $price = $price . ',-';
        return apply_filters( 'woocommerce_get_price', $price );
  3. atoompjenl
    Posted 2 years ago #

    Hello terrytsang.

    You are my hero thanks. can I ask you another question.

    when you look at this url http://www.romanza.nl/product-categorie/grafmonumenten/

    you see at the left the menu when u push on the product categories the menu stays the same but not when u push on the categories zandstralen-inwendig
    then all the menus are showing
    is the explanation also simple for you to tell me I hope so.

    I am really happy that you helpt me whit my first question another big thanks for you.

    greetings from the netherlands

  4. terrytsang
    Posted 2 years ago #

    Hello atoompjenl, glad the previous tips worked.

    Anyway, for your 2nd question, i think it is related to your sidebar widget that display product categories list based on the level of category. You can have a look at the code for generating sidebar product category list.


  5. marvmckay66
    Posted 1 year ago #

    I think this "add_filter" code is close to what I need to solve my problem, but still need a little help -
    woocommerce_get_price_html seems to retrieve both the regular price and the sale price and outputs them side by side (with regular price having a strikethrough) - how can I move the regular price below the sale price?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.