• Resolved dewiratna2022

    (@dewiratna2022)


    function pw_rcp_custom_currency( $currencies ) {
    	$currencies['IDR'] = 'Indonesian Rupiah (Rp.)';
    	return $currencies;
    }
    
    function ag_rcp_idr_currency_filter_before($formatted_price, $currency_code, $price) {
      return 'Rp'. ' '.$price;
    }
    function ag_rcp_idr_currency_filter_after($formatted_price, $currency_code, $price) {
      return $price.' '.'IDR';
    }
    
    add_filter( 'rcp_currencies', 'pw_rcp_custom_currency' );
    add_filter( 'rcp_idr_currency_filter_after', 'ag_rcp_idr_currency_filter_after', 10, 3 );
    add_filter( 'rcp_idr_currency_filter_before', 'ag_rcp_idr_currency_filter_before', 10, 3 );

    I have pasted the code above in (functions.php) and it worked.

    But that’s not true,How to change Rp 100000 to Rp 100.000

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support ramilbatoy

    (@ramilbatoy)

    Hi @dewiratna2022

    A user has shared a code and you might need to tweak a little. You may check and apply the code below if this would work for you.

    function pw_rcp_custom_currency( $currencies ) {
    	$currencies['IDR'] = 'Indonesian Rupiah (Rp)';
    	return $currencies;
    }
    
    function ag_rcp_idr_currency_filter_before($formatted_price, $currency_code, $price) {
      return 'Rp ' . '' . rcp_format_amount( $price ) ;
    }
    function ag_rcp_idr_currency_filter_after($formatted_price, $currency_code, $price) {
      return $price.' '.'IDR';
    }
    
    add_filter( 'rcp_currencies', 'pw_rcp_custom_currency' );
    add_filter( 'rcp_idr_currency_filter_after', 'ag_rcp_idr_currency_filter_after', 10, 3 );
    add_filter( 'rcp_idr_currency_filter_before', 'ag_rcp_idr_currency_filter_before', 10, 3 );
    
    Plugin Support ramilbatoy

    (@ramilbatoy)

    Hey?@dewiratna2022

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved. Please feel free to open a new thread if any other questions come up and we’d be happy to help.

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