Title: Problem with coding
Last modified: December 11, 2017

---

# Problem with coding

 *  [rafaelrafael](https://wordpress.org/support/users/rafaelrafael/)
 * (@rafaelrafael)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/problem-with-coding-2/)
 * hi!
    I’m trying to add prices to more than 500 products for 60 countries, manually(
   not by exchange rate). And i want this procces to be automatic. I parce prices
   from file to variables. So in line 51 (which is: $_price_method = get_post_meta(
   get_the_ID(), $_id_prefix . ‘_price_method’ , true ); ) i need to change to something
   like this: $_price_method = $MyVariable and in lines 85 and 90 i need to change
   values in ” …value=”<?php echo wc_format_localized_price( $_regular_price ); ?
   > ” and ” …value=”<?php echo wc_format_localized_price( $_sale_price ); ?> ” 
   to my variables $myregularprice and $mysaleprice. Or mabe some call some custom
   methods or functions instead of these variables. How can i make this?
    -  This topic was modified 8 years, 5 months ago by [rafaelrafael](https://wordpress.org/support/users/rafaelrafael/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [rafaelrafael](https://wordpress.org/support/users/rafaelrafael/)
 * (@rafaelrafael)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/problem-with-coding-2/#post-9777399)
 * or better:
    woocommerce_wp_radio( array( ‘id’ => $_id_prefix . ‘_price_method’,‘
   value’ => $_price_method, //here instaed of $_price_method i need ‘manual’ ‘class’
   => ‘wcpbc_price_method’, ‘label’ => __( ‘Price for’, ‘wc-price-based-country’).‘‘.
   $value[‘name’]. ‘ (‘ . get_woocommerce_currency_symbol( $value[‘currency’] ) .‘)’,‘
   options’ => array( ‘exchange_rate’ => __(‘Calculate prices by exchange rate’,‘
   wc-price-based-country’), ‘manual’ => __(‘Set prices manually’, ‘wc-price-based-
   country’) ) ) );
 * and in input fields i need $_regular_price and $_sale_price change to $myregularprice
   and $mysaleprice

Viewing 1 replies (of 1 total)

The topic ‘Problem with coding’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-product-price-based-on-countries/assets/icon-
   256x256.png?rev=1976858)
 * [Price Based on Country for WooCommerce](https://wordpress.org/plugins/woocommerce-product-price-based-on-countries/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-product-price-based-on-countries/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-product-price-based-on-countries/reviews/)

## Tags

 * [Coding](https://wordpress.org/support/topic-tag/coding/)
 * [pbc](https://wordpress.org/support/topic-tag/pbc/)

 * 1 reply
 * 1 participant
 * Last reply from: [rafaelrafael](https://wordpress.org/support/users/rafaelrafael/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/problem-with-coding-2/#post-9777399)
 * Status: not resolved