Woocommerce for Money Transfer Site – displaying target price after conversion

I want to set up a site for a money transfer service using Woocommerce. I created a product and used a plugin to allow the customer set the price (the amount to be sent). I need to display the value of the destination currency after conversion. I wish to set the exchange rate manually.

Any advice?

How to target all woocommerce categories that don’t have any subcategories in them?

I want to target all pages (product categories) that are displaying the products themselves.

My woocommerce settings set to show only categories/subcategories (unless there are none) and then by default the products grid is displayed on the page.

is_product_category() function doesn’t help since it also targets the parent categories which don’t have direct products in them.

Most of my categories that don’t any subcategories in them are grandchildren categories if it matters for the answer.

How can I achieve it and to use it in woocommerce hooks?

Woocommerce, If Purchase more then 9, change Role!

I got this code and its working great.

    add_action( 'woocommerce_order_status_processing','change_role_on_purchase' );     function change_role_on_purchase( $  order_id ) {       $  order = wc_get_order( $  order_id );       $  items = $  order->get_items();       $  products_to_check = array( '2205','2207','2209','2211','2213','2226','2227','2230','2450','2444','2235','2237','2238','2239','2240'  );       foreach ( $  items as $  item ) {         if ( $  order->user_id > 0 && in_array( $  item['product_id'], $  products_to_check ) ) {             $  user = new WP_User( $  order->user_id );             // Change role             $  user->remove_role( 'Customer' );             $  user->add_role( 'Distributor' );             // Exit the loop             break;         }     } } 

But, I want to add:- If user purchase more than 9, change role to Distributor.

Edit Woocommerce Pricing Formula

I need to edit the way woocommerce calculates the price on a client’s website. It’s a site that allows customers to purchase products on credit by choosing the number of months they wish to make payment. However, in the cart, if the customer selects 2 or more of the quantity of the product they wish to purchase, the total amount of the products appears in the "Price" column of the cart instead of the unit price of that product. I would like to edit it such that the unit price shows in the price column no matter the quantity selected and then the total amount can then show in the total and subtotal columns. I have tried editing the woocommerce cart file and a couple of others but nothing seems to work. This is the site: www.appliancepointgh.com Any help on how i can do this would be deeply appreciated.

Redirect to Invoice page after checkout in woocommerce

I have a scenario where in I need to redirect to invoice page after checkout in woocommerce. Avoiding going to payment gatway. I have two type of shipping Flat Rate and Pick at Store. when I select pick at store option no need to make the payment online. Instead it should redirect to invoice page. How do I redirect to invoice page without payment gateway?

Code to Update Prices and add them for Woocommerce Custom Product Variations Loop

I am actually struggling with some custom functions. Actually My aim is the following: Create 2 custom fields in a woocommerce variable product backend ✔ Show these custom fields text and prices in frontend Make able to add the product in the cart with these prices summed up.

I don’t know which hook I am using wrong and why the theme ajax doesn’t work. There is someone that can assist?

"Working" (I hope) Code

// Aggiunte campi asseverazione, legalizzazione Variazioni nel backend add_action( 'woocommerce_variation_options_pricing', 'add_variation_options_pricing_assev', 10, 3 ); function add_variation_options_pricing_assev( $  loop, $  variation_data, $  variation ){      woocommerce_wp_text_input( array(         'id' => '_assev_'.$  loop,         'wrapper_class' => 'form-row form-row-first',         'class' => 'short wc_input_price',         'label' => __( 'Asseverazione', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')',         'value' => wc_format_localized_price( get_post_meta( $  variation->ID, '_assev', true ) ),         'data_type' => 'price',     ) );     woocommerce_wp_text_input( array(         'id' => '_legal_'.$  loop,         'wrapper_class' => 'form-row form-row-last',         'class' => 'short wc_input_price',         'label' => __( 'Legalizzazione', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')',         'value' => wc_format_localized_price( get_post_meta( $  variation->ID, '_legal', true ) ),         'data_type' => 'price',     ) );      }  // Salvataggio in backend add_action( 'woocommerce_save_product_variation','save_variation_options_pricing_assev', 10, 2 ); function save_variation_options_pricing_assev( $  variation_id, $  loop ){     if( isset($  _POST['_assev_'.$  loop]))         update_post_meta( $  variation_id, '_assev', wc_clean( wp_unslash( str_replace( ',', '.', $  _POST['_assev_'.$  loop] ) ) ) );     if( isset($  _POST['_legal_'.$  loop]))         update_post_meta( $  variation_id, '_legal', wc_clean( wp_unslash( str_replace( ',', '.', $  _POST['_legal_'.$  loop] ) ) ) ); }  // Frontend (mi manca di aggiungere la legalizzazione) add_filter( 'woocommerce_available_variation', 'display_variation_assev', 10, 3 );  function display_variation_assev( $  data, $  product, $  variation ) {      if( $  assev = $  variation->get_meta('_assev') ) {         $  data['price_html'] = '<div class="woocommerce_assev">' . __( 'Asseverazione: ', 'woocommerce' ) .         '<span class="asseverazione-prezzo">' . wc_price( $  assev ) . '</span></div>' . $  data['price_html'];     }      return $  data; } 

Code Struggle:

/*add_filter( 'woocommerce_add_cart_item', 'aggiorna_prezzi_nuova', 10, 2 ); function aggiorna_prezzi_nuova( $  cart_item_data, $  cart_item_key, $  variation) {                if( isset( $  _POST['_assev_'][$  variation_id] ) )         $  cart_item_data['_assev'][$  variation_id] = $  _POST['_assev'][$  variation_id];     if(isset( $  _POST['_legal'] ) )        $  cart_item_data['_legal'] = $  _POST['_legal'];      return $  cart_item_data; }   add_action( 'woocommerce_before_calculate_totals', 'fissa_valore_var_carrello', 20, 1 ); function fissa_valore_var_carrello( $  cart ) {     if ( is_admin() && ! defined( 'DOING_AJAX' ) )         return;      if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 )         return;      // First loop to check if product 11 is in cart     foreach ( $  cart->get_cart() as $  cart_item ){         if( isset($  cart_item['_assev']) && isset($  cart_item['_legal'])          && ! empty($  cart_item['_assev']) && ! empty($  cart_item['_legal']) )             $  cart_item['data']->set_price( '30' );     } }*/ 

Other non functional code:

function aggiorna_prezzo( $  price, $  product ) {         $  shortcost_first = get_post_meta( $  variation->id, '_assev_0', true );    $  shortcost_mid = get_post_meta( $  product->id, '_assev_0', true );   $  shortcost_minimum = get_post_meta( $  product->id, 'assev_0', true );        $  unit_price = $  assev + $  shortcost_mid + $  shortcost_first + $  shortcost_minimum; //     +($  shortcost_mid * ($  shortcost_minimum - 1));    return $  price + $  unit_price;       } add_filter('woocommerce_get_price', 'aggiorna_prezzo', 10, 3); add_filter('woocommerce_get_regular_price','aggiorna_prezzo', 10, 3); add_filter('woocommerce_get_sale_price','aggiorna_prezzo', 10, 3); 

Thank you!

pick up day for woocommerce products with email notification

I searched the web for a kind of plugin or code that suits our need. We have a local food store and we want to sell products with an online shop.

The ordered products can be picked up in the local store then. So we have products which are ready for pick up a week after the customer ordered, but also have products which are ready for pick up 2,3 or 4 weeks after the order.

I want to notify the customer one day before he can pick up his order via Email!

Does anyone know a plugin or how can i achieve this instead?

How to connect a mobile app through the woocommerce API to “Create Order” for a product linked to a vendor

I want to connect a mobile app through the woocommerce API to “Create Order” for a product linked to a vendor such that this will create the sub-order automatically for a given vendor account. The woocommerce API does not provide this capability by default and the "post author" is assigned to the user authorised to make the API call. How do I go about this?