payment-method

Hide payment methods based on selected shipping method in WooCommerce [duplicate]

怎甘沉沦 提交于 2020-08-20 07:06:48
问题 This question already has an answer here : Show hide payment methods based on selected shipping method in Woocommerce (1 answer) Closed last year . I was trying to hide two payment method if one shipping method selected by adding code below to theme function.php // Filter payment gatways for different shipping methods function my_custom_available_payment_gateways( $gateways ) { $chosen_shipping_rates = WC()->session->get( 'chosen_shipping_methods' ); if ( in_array( 'flat_rate:7', $chosen

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

假装没事ソ 提交于 2020-01-02 06:32:54
问题 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

I want to change Payment Method's default functionality, as payment method use to work on Total amount but i want to use SubTotal to perform its task

一个人想着一个人 提交于 2019-12-23 04:32:27
问题 Guy, I have a plugin for payment method installed in my Opencart (3.0.3.2). I want to change Payment Method's default functionality, as payment method use to work on Total amount but i want to use Sub-Total to perform its task. So where to find that code/condition that i can edit and how could i edit. YOU CAN SAY THAT I WANT TO HAVE FUNCTIONALITY OF BOTH PLUGINS, (Shipping Method AND Payment Method), ON SUB-TOTAL. NEITHER i could find the condition/code for this NOR i know how to call sub

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

依然范特西╮ 提交于 2019-12-23 02:04:33
问题 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. 回答1: 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

Exclude specific products on auto-complete orders process in Woocommerce

笑着哭i 提交于 2019-12-13 18:19:25
问题 I’m currently using the code from this answer thread to auto-complete orders so that new WooCommerce bookings are added to the calendar, (They only get added once marked as complete). This works great for bookings, however, I’d like to exclude some other products from auto-completing. Do you know if this is possible? 回答1: Iterating through order items is a heavier process , than making a much more lighter SQL query. Here is a custom conditional function that will check for products Ids in a

Automark ONLY Paid orders to “Completed” status in WooCommerce 3+

Deadly 提交于 2019-12-11 09:28:51
问题 I would like to automark just success paid orders to "Completed" status. I have searched a lot on Stack and Google, and found this answer code: WooCommerce: Auto complete paid Orders (depending on Payment methods) But problem is that the code mark all placed orders to "Completed" status not depending if order was success placed or not. What do I need to change in the code to automark ONLY Paid orders to "Completed" status? 回答1: New enhanced and simplified code version replacement (March 2019)

Save and display specific payment gateway additional field everywhere in Woocommerce

帅比萌擦擦* 提交于 2019-12-11 04:24:32
问题 I am using "Additional field on checkout for specific payment gateway in Woocommerce" answer code, that displays an additional dropdown field for specific payment gateway in checkout page. How to save and display the options on the orders and on email notifications? 回答1: Continuation of "Additional field on checkout for specific payment gateway in Woocommerce" Here is the complete way to: Add a dropdown with options to BACS payment Field validation (required option) Save chosen option as

Paypal: Unable to Reauthorize Authorized Payment Error : An internal service error occurred

╄→尐↘猪︶ㄣ 提交于 2019-12-08 13:39:28
问题 Paypal: Unable to Reauthorize Authorized Payment Below is my code $clientId = 'XXXXX'; $secret = 'XXXX'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/oauth2/token"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $clientId . ":" . $secret); $result = curl_exec($ch); if