• Resolved yologerix

    (@yologerix)


    Hi Greg,

    Now I see 3.000 HUF, but I would like to see 3.000 Ft, can you help me how can I change it?

    And in new advert menu at the price I always see .00 after the price, can I delete it? In the settings I made it that on the advert listing I can’t see .00

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    you can change the HUF to Ft, by adding following code in your theme functions.php file

    
    add_filter("adverts_currency_list", "my_adverts_currency_list");
    function my_adverts_currency_list( $list ) {
        foreach( $list as $k => $currency ) {
            if( $currency["code"] == "HUF" ) {
                $list[$k]["sign"] = "Ft";
            }
        }
        return $list;
    }
    

    I am not exactly sure about your second question. Where do you see the “.00”? and what are your currency settings in wp-admin / Options / Core?

    Thread Starter yologerix

    (@yologerix)

    Hi Greg,

    Currency change working, thanks!

    Second question:
    At the advert add page if I type the price, I get .00 after my price, here you can see:
    https://drive.google.com/open?id=0B0QRp-GaH1eLR21zSGE1SXZmeDg
    https://drive.google.com/open?id=0B0QRp-GaH1eLWjQxR0g4bC1pcHc

    Thanks!

    yologerix

    Plugin Author Greg Winiarski

    (@gwin)

    Right now i am afraid it is not really possible to remove the .00 at the end of the price, unless you will want to disable currency validation and formatting at all and validate the price as an integer only, if so then you can use the code below to do that

    
    add_filter( "adverts_form_load", "disable_price_validation" );
    function disable_price_validation( $form ) {
      if( $form['name'] != "advert" ) {
        return $form;
      }
      foreach( $form["field"] as $key => $field ) {
        if( $field["name"] == "adverts_price" ) {
            $form["field"][$key]["class"] = "";
            $form["field"][$key]["filter"] = array();
            $form["field"][$key]["validator"] = array( array( "name" => "is_integer" ) );
        }
      }
      return $form;
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Currency’ is closed to new replies.