WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. atoompjenl
    Member
    Posted 1 year 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
    Gerry

    http://wordpress.org/extend/plugins/woocommerce/

  2. terrytsang
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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
    http://www.romanza.nl/product-categorie/grafmonumenten/lettertypen/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
    Member
    Posted 1 year 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.

    Cheers!

  5. marvmckay66
    Member
    Posted 7 months 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

About this Topic

Tags

No tags yet.