payment-method

Replace a specific word for BACS payment method in Woocommerce order edit pages

对着背影说爱祢 提交于 2019-12-06 15:31:56
Am new to woocommerce, by using gettext hook am able to replace the text "paid" with "placed" but i want to display this text based on one condition i.e when customer pick wire transfer(bacs) as there was no payment received then only text needs to replace with placed I've attached an image. here you go First let add the Change Text function : function change_text($translated_text, $text, $domain) { switch ($translated_text) { case 'Paid on %1$s @ %2$s': $translated_text = __('Placed on %1$s @ %2$s', 'woocommerce'); break; } return $translated_text; } The Condition: Now let's create our

WooCommerce change order status BACS processing

穿精又带淫゛_ 提交于 2019-12-06 07:24:02
问题 In WooCommerce any order placed with the BACS (direct bank transfer) is set to "on-hold" . How would one go about changing this automatically to processing? I wan't it to work inside the functions.php I have the following code but that doesn't work: add_filter( 'woocommerce_payment_complete_order_status', 'rfvc_update_order_status', 10, 2 ); function rfvc_update_order_status( $order_status, $order_id ) { $order = new WC_Order( $order_id ); if ( 'on-hold' == $order_status && 'on-hold' ==

Add fee for Cash on delivery payment method (cod) in Woocommerce

亡梦爱人 提交于 2019-12-05 16:01:00
In WooCommerce I need to apply a custom handling fee for a specific payment gateway. I have this piece of code from here: How to Add Handling Fee to WooCommerce Checkout . This is my code: add_action( 'woocommerce_cart_calculate_fees','endo_handling_fee' ); function endo_handling_fee() { global $woocommerce; if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; $fee = 5.00; $woocommerce->cart->add_fee( 'Handling', $fee, true, 'standard' ); } This function add a fee to all transactions Is it possible to tweak this function and make it apply for Cash on Delivery payments only ? The other

How to check payment method on a WooCommerce order by id?

匆匆过客 提交于 2019-12-03 05:04:06
问题 I want to make some changes if the chosen payment method is COD. On existing WC_Order i have used ($order->payment_method_title == 'Cash On Delivery' ? ... : ... ); to retrieve the title. But i would like to check against the id (cod) because the title string gets translated to different languages which doesn't make it a good solution. Is there a way to retrieve the id on a WC_Order in woocommerce? 回答1: The post meta key for the payment method ID is simply _payment_method So if $order-

How to check payment method on a WooCommerce order by id?

核能气质少年 提交于 2019-12-02 18:18:27
I want to make some changes if the chosen payment method is COD. On existing WC_Order i have used ($order->payment_method_title == 'Cash On Delivery' ? ... : ... ); to retrieve the title. But i would like to check against the id (cod) because the title string gets translated to different languages which doesn't make it a good solution. Is there a way to retrieve the id on a WC_Order in woocommerce? The post meta key for the payment method ID is simply _payment_method So if $order->payment_method doesn't have the magic methods in place to get that automatically, you could retrieve the post meta

Show hide payment methods based on selected shipping method in Woocommerce

白昼怎懂夜的黑 提交于 2019-12-02 13:21:19
问题 I would like to hide some payment method and enable another one when I select a specified “Shipping Method" in flexible Shipping plugin form wpdesk. I have already tried that code: add_filter( 'woocommerce_available_payment_gateways', 'gateway_disable_shipping_326' ); function gateway_disable_shipping_326( $available_gateways ) { global $woocommerce; if ( !is_admin() ) { $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]; if ( isset(

Show hide payment methods based on selected shipping method in Woocommerce

烂漫一生 提交于 2019-12-02 04:34:05
I would like to hide some payment method and enable another one when I select a specified “Shipping Method" in flexible Shipping plugin form wpdesk. I have already tried that code: add_filter( 'woocommerce_available_payment_gateways', 'gateway_disable_shipping_326' ); function gateway_disable_shipping_326( $available_gateways ) { global $woocommerce; if ( !is_admin() ) { $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]; if ( isset( $available_gateways['payment_method_cod'] ) && 0 === strpos( $chosen_shipping, 'flat_rate:6' ) ) { unset(

Validate and save additional checkout field for specific payment gateway in Woocommerce

巧了我就是萌 提交于 2019-12-01 23:25:18
问题 I need to show an text input field when customers select BACS gateway and I would like the input field value to be appended to orders and email notifications . I am using Additional field on checkout for specific payment gateway in Woocommerce answer code where I have changed the select field to an input text field: add_filter( 'woocommerce_gateway_description', 'gateway_bacs_custom_fields', 20, 2 ); function gateway_bacs_custom_fields( $description, $method_id ){ // if( $method_id == 'bacs'

Woocommerce - How to send custom emails based on payment type

╄→尐↘猪︶ㄣ 提交于 2019-11-30 04:47:58
问题 Here is the problem. My woocommerce website has 3 different payment options - Check Payment Western Union Cash On Delivery If my buyer checkout with "Check Payment" I want to send him an automated email that outlines the steps to make a check payment. If he checkout with "Western Union" I want to email him my Western Union information as an automated email. Another automated email should be send for Cash On Delivery. Usually in Woocommerce you have a single email sent to customer for all

Change COD default order status to “On Hold” instead of “Processing” in Woocommerce

蓝咒 提交于 2019-11-27 07:31:51
问题 I need help with a problem-related to plugin "WooCommerce Pay for Payment" which counting some extra fee in shipping. Problem is, that this plugin sets automatically "processing" status in order which causes thanking email for payment (in case of local payment) and don't send email notification about a new order, so customer is confused (I didn't send any money and I received email "thanks for your payment"). I tried this solution: Set WooCommerce order status when order is created from