How to Hide Woocommerce Payment Gateways Conditionally? (12+ hacks)

  Рет қаралды 4,179

WP Simple Hacks - Wordpress tips and tricks

WP Simple Hacks - Wordpress tips and tricks

Күн бұрын

Пікірлер: 80
@wilsonwirba2013
@wilsonwirba2013 2 жыл бұрын
All my worries solved in 19minutes. Thank you sir 🙏🏻🙏🏻🙏🏻
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
You’re welcome 😊
@Lukass85
@Lukass85 Ай бұрын
Wow. This is AWESOME in all possible senses. Best wishes from Webhipsters Team from Romania.
@wpsimplehacks
@wpsimplehacks Ай бұрын
Thnak you for watching :)
@SmartHomeIntegrations
@SmartHomeIntegrations Жыл бұрын
Thank you for showing these hacks, they make WP much more usable. Love your videos
@wpsimplehacks
@wpsimplehacks Жыл бұрын
More to come! 🙂
@Hassan_Omer
@Hassan_Omer 2 жыл бұрын
Thank you very much for sharing this. I was looking for how to hide payment gateways for certain product categories.
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
You're welcome ☺️
@Hassan_Omer
@Hassan_Omer 2 жыл бұрын
@@wpsimplehacks hmmm strangely i did exactly what you have shown in the video but it's not working for me, i even tried pasting the code in the functions.php file of the child theme. I have basically 2 custom payment gateways and 1 bank transfer, so i wanted to hid the bank transfer option for category "music" but it didn't work for me. whether i am logged in or not and I also use Blocksy Pro.
@Hassan_Omer
@Hassan_Omer 2 жыл бұрын
I think i need to change something in this code " 'wpsh_disable_payment_for_categories' " where WPSH is your own website and if i am not wrong , i have to replace it with my websites code here.
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
No, this is just a function name and changing the name will not solve your problem. Verify whethter payment gateway id-s and category slugs are correct.
@CaterStudios
@CaterStudios 2 ай бұрын
Thank you sooo much, I really appreciate this. I’d you world be more kind Sir to take my one question: can the handling fee have an option to still work by % charges but have a price cap when % exceeds a certain price? Thank you
@wpsimplehacks
@wpsimplehacks Ай бұрын
Sorry. Unfortunately I can’t help you with this.
@AtefehTabasi
@AtefehTabasi 6 ай бұрын
Thank for your great video,, Is it possible to hide a Woocommerce payment gateway based on the presence of specific string? For example if the content of the order contains this sentence: “I don’t need invoice”, then our gateway won’t be displayed. Could you please provide me the snippet. Regards
@wpsimplehacks
@wpsimplehacks 6 ай бұрын
Sorry, can’t help you with that.
@pixelgap
@pixelgap 2 жыл бұрын
Thank you for the video. I have a question please. I could not find an answer anywhere. I used one of your codes : Disable payment gateways (my case cash on delivery) if products are on backorder. The code works just fine. The problem is that the cash on delivery shows on pay order page when I manually create the invoice in the backend and send it to the customer to pay. Could you please help me with that. How can I hide cod on pay order page. Thank you
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Sorry, can't help with that
@pixelgap
@pixelgap 2 жыл бұрын
You are the best. Your videos are incredible. Thank you a lot.
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Thank you too!
@enmemoriamedia4957
@enmemoriamedia4957 2 жыл бұрын
Hey man. I love your channel. you earned a suscriber. Question: How can i make my Woocommerce Orders panel refresh every 5 seconds?
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Sorry, can’t help with that.
@wovenheritagebaskets
@wovenheritagebaskets 2 жыл бұрын
Thank you for your helpful videos. Can you please make a video on how to add payment badges below the add to cart button on the woocommerce product page. Thank you
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
What do you mean by payment badges? Do you mean paykent gateway logos (VISA, Mastercard etc)?
@wovenheritagebaskets
@wovenheritagebaskets 2 жыл бұрын
@@wpsimplehacks yes please
@HaifengZhu-pn3uq
@HaifengZhu-pn3uq Жыл бұрын
hi, I want payment not to be made for the entire site, do I need to first add payment gateways first before I use the code snippet you showed to display all payment? Thanks!
@wpsimplehacks
@wpsimplehacks Жыл бұрын
Sorry, but I don't understand the question
@Gecata1
@Gecata1 2 жыл бұрын
Your videos are incredible. Thank you for all these hacks, I have a question, how to hide payment gateways for backorder products?
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
See this wpsimplehacks.com/display-woocommerce-payment-methods-conditionally/#how-to-disable-woocommerce-payment-gateways-for-bacordered-products
@Gecata1
@Gecata1 2 жыл бұрын
@@wpsimplehacks Thank you!
@earnwithomar
@earnwithomar Жыл бұрын
Sir please tell me how to hide cod from specific products or specific products categories please tell me
@wpsimplehacks
@wpsimplehacks Жыл бұрын
Sorry, can't help you with this
@teaologynorway3284
@teaologynorway3284 2 жыл бұрын
Hi, how do i disable billing details on checkout for customers that are already logged on?
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Sorry, can’t help with that.
@janardhanreddy9769
@janardhanreddy9769 Жыл бұрын
Hi , how do we hide spefici payment gateway in mobile version only
@wpsimplehacks
@wpsimplehacks Жыл бұрын
Sorry,can't help you with that
@azmistarzz1812
@azmistarzz1812 2 жыл бұрын
How to hide direct transfer for all products? I don't want to disable from the woocommerce. Because I'm using terawallet which is only direct transfer allowed to buy it.
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Sorry, can’t help you with that
@adelantevox
@adelantevox Жыл бұрын
hi, thanks a lot for your videos. Amazing content. I am trying to hide products based on categories, but the code on the video is different that the code on your website. Am I missing something? Thanks a lot!
@wpsimplehacks
@wpsimplehacks Жыл бұрын
If it’s different on the website, then something needed to be changed because of the Woo updates or smth. Code on the website is tested and works on my site.
@adelantevox
@adelantevox Жыл бұрын
@@wpsimplehacks thanks for your prompt reply. Unfortunately, the code on the website is not working for me. It works the code for a single product ID, but not the one for categories;
@heieckshundeschule3682
@heieckshundeschule3682 2 жыл бұрын
You do such great work man. Thanks a lot. I do have a problem & I think you may have a answer. If I use this deposit plugin & want a percentage payment gateway fee it calcutes in case of a deposit order always the percentage of the full amount (because it craps the variable $subtotal to calculate the fee) and not just deposit wise variable. that means customer would pay 2x times the full percentage. I guess the $subtotal variable needs to be changed for the 'Due Today' value (plugin Deposits & Partial Payments for WooCommerce) in Checkout but I dont know how to put that into your snippet hack 11. I hope you can help me and again thanks a lot mate.
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Hi, Unfortunately I can’t help you with that. It would be wise to ask support from the Deposits and partial payments plugin team.
@ervinpap184
@ervinpap184 2 жыл бұрын
this is a very usefull video unfortunetly the snippet with restrict payment acordung to category is not working. Do you know what can be the issue. thnaks a lot and keep goining.
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Take a look at this one here: wpsimplehacks.com/display-woocommerce-payment-methods-conditionally/#how-to-disable-woocommerce-payment-methods-for-specific-category I revised the code and now add category ID-s instead of slugs. Tested and works.
@ervinpap184
@ervinpap184 2 жыл бұрын
Thanks a lot , it works perfectly now. One more thing the update cart on quantity change not working to. I saw you have a difrent code snippet on your website then the one from video! Have a lovely day.
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Which one is the one that’s not working? This one here is working as promised wpsimplehacks.com/improve-woocommerce-store/#how-to-update-woocommerce-cart-on-quantity-change
@ervinpap184
@ervinpap184 2 жыл бұрын
@@wpsimplehacks yes, this one. The update cart button disappears but on quantity change nothing happens. Used it with bricks builder
@ervinpap184
@ervinpap184 2 жыл бұрын
@@wpsimplehacksr Hi, just a quick update for the category payment restrictions part, I have just realised that it works only with the main categories, for example if I have Clothing (main) - gloves - Tshirt - trousers (subcategories') if I want to disable cash on delivery only for gloves I have to disable for the whole Clothing section to work. It's not picking up the subcategories id number. Can you please find a solution for this. Thanks for your videos they are really helpful.
@pixelnthings
@pixelnthings 2 жыл бұрын
Great video as always....do u have any paid courses for woocommerce development?
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Not yet! Hopefully later this year... if I’m too too lazy during the summer :)
@ΣάββαςΑθαναηλίδης
@ΣάββαςΑθαναηλίδης Жыл бұрын
Hello, when disabling payment gateways for shipping methods I get a "Request failed with status code 403" message. Any help would apprecieated.
@wpsimplehacks
@wpsimplehacks Жыл бұрын
Sorry, can't help you with this
@londoncityshopfitter
@londoncityshopfitter Ай бұрын
Could you help me hide COD for a specific user, not a specific role users, I want to hide COD for the customer I choose, not all Customers.
@wpsimplehacks
@wpsimplehacks Ай бұрын
How about this? wpsimplehacks.com/display-woocommerce-payment-methods-conditionally/#how-to-disable-woocommerce-payment-gateways-for-specific-users
@abcsai2575
@abcsai2575 11 ай бұрын
Hello sir, Thank you for the video. But it would be great if you can help me with something else but similar like this. So for my website i have 3 kind of participant/customer type 1(customers), type2(ngo) and type3 . they all can login as customer role. but i have 3 payment method for them depend on their type they need to pay. now all payment method showing on my page but i need to show only related to their type(like ngo,self, or type3) payment method so other 2 payment method they cant see after selecting their type from drop down list while they fill billing info. please if you can help me.
@wpsimplehacks
@wpsimplehacks 11 ай бұрын
Create distinct user roles on your website and assign roles to users accordingly. Then, you can utilize the following code snippet: wpsimplehacks.com/display-woocommerce-payment-methods-conditionally/#how-to-disable-woocommerce-payment-gateways-for-specific-user-roles
@xavimf4315
@xavimf4315 2 жыл бұрын
Great explanation!!!! I would like to be able to configure 2 different banks through the "REDSYS" payment gateway and that depending on the country of the invoice, one or another gateway is chosen. Do you know if it would be possible?
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Unfortunately, I don’t know what Redsys is, and therefore can’t help with that.
@xavimf4315
@xavimf4315 2 жыл бұрын
@@wpsimplehacks It is a payment gateway that many banks in Spain work with, a virtual POS. It is configured as one more gateway in woocommerce with different plugins. So I imagine that the code would be like choosing paypal or stripe for example, according to the "COUNTRY" of customer billing. If you could show an example code like this, I would already look at adapting it to REDSYS. The key is that the operation must be conditional on the country.
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
In my video I showed how to hide payment gateways based on country. You can use this snippet to hide it.
@xavimf4315
@xavimf4315 2 жыл бұрын
@@wpsimplehacks OK, I'll try it ;)
@Itswaill
@Itswaill 2 жыл бұрын
Hi, how can I have a click to view the coupon section, like your website
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
It's Kadence Shop Kit plugin which makes it work like that. See here stellarwp.pxf.io/shopkit (10% discount coupon is SIMPLEHACKS)
@gourtech492
@gourtech492 2 жыл бұрын
In my WordPress Website , I user woo-commerce currency converter , I need to hide Paytm payment getway when currency set on USD, can any one help me out on this problem..
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
It would be wise to ask this directly from your currency converter plugin support team and maybe they can help.
@brandenburgottoferdinand5419
@brandenburgottoferdinand5419 2 жыл бұрын
God sent you to me after 3 days of searching the internet.
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
My letter to God: "Dear God! Could you next time show a correct search result to Brandenburg Ottó Ferdinánd and other web-pilgrims a bit faster? Thank you in advance, WP Simple Hacks" :)
@ervinpap184
@ervinpap184 2 жыл бұрын
If you would kind can you please and a code for a paymenet restriction for a certain ammount, for exanple when a product worth 100euro pay only with card when a product is under 100euro pay with cash on delivery Thanks a lot. Great job with jour videos.
@wpsimplehacks
@wpsimplehacks Жыл бұрын
It’s already in the video. See the part about hiding gatewayse based on cart total. Code is here wpsimplehacks.com/display-woocommerce-payment-methods-conditionally/#how-to-disable-woocommerce-payment-methods-based-on-cart-total
@miguelappsaplicacionesyjue9224
@miguelappsaplicacionesyjue9224 2 жыл бұрын
Thank you for sharing your skills with everyone and I'm sorry to bother you, I apologize. I want to add this function to eliminate payment methods according to the user role, but I receive errors on the page to make the payment: Warning: Undefined array key 0 in . The error refers to this line: if ($role[0] == 'customer') { Can you give me any idea how I can correct this ? Thank you I would also like to use the function to hide different payment methods to a different role, but if I duplicate the function I will get an error. Can you tell me an idea to achieve this ? Thank you
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
If you duplicate a function then you need to change the name of a function. If there are functions withthe same name then there'll be errors. So, if function name is wpsh_hide_by_role thenchange the name for duplicated role (wpsh_hide_for_customer for example)
@miguelappsaplicacionesyjue9224
@miguelappsaplicacionesyjue9224 2 жыл бұрын
@@wpsimplehacks Thanks for your quick response. But why do I get the following error? Warning: Undefined array key 0 in . The error refers to this line: if ($role[0] == 'customer') { I show you the whole function: add_filter('woocommerce_available_payment_gateways', 'wpsh_hide_payment_roles', 1); function wpsh_hide_payment_roles($gateways) { $current_user = wp_get_current_user(); $role = $current_user->roles; global $woocommerce; if ($role[0] == 'customer') { //unset($gateways['cheque']); // Cheque unset($gateways['cod']); // contra reembolso unset($gateways['paypal']); // Paypal unset($gateways['bacs']); // Direct bank transfer (BACS) } return $gateways; }
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
​@@miguelappsaplicacionesyjue9224 I just tested your code on my site and it works as promised. See the screenshot cln.sh/QWfwM9TK Also, it hides COD, BACS and Paypal on the frontend. Screenshot cln.sh/Lr2t4V4L
@SuperMadmax4
@SuperMadmax4 2 жыл бұрын
hey Hi How you Doing ? Is Wp codebox Mandatory Hope it would work with code snippets & 2nd thing It should be run on Front end or everywhere pls comment. & Last but not least would it will create any conflict with OTP Plugins..Thats all..Thankyou for making this usefull video
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
1) As you see in my video, I'm using Code snippets, not WpCodebox 2) In the video I show which ones are only from frontend and which ones are for everywhere 3) What is OTP plugin? 🙂
@SuperMadmax4
@SuperMadmax4 2 жыл бұрын
@@wpsimplehacks My question was If already Installed OTP Plugin will Create a Conflict in Php scripts after applying Snippets..Thankyou
@wpsimplehacks
@wpsimplehacks 2 жыл бұрын
Sorry, but I don't know what OTP plugin is.
@SuperMadmax4
@SuperMadmax4 2 жыл бұрын
@@wpsimplehacks No Problem will try some snippets if error acoours will Post.Thankyou For Making this Great Video..
7 Must-Have WooCommerce Extensions You Haven't Discovered Yet
15:13
WP Simple Hacks - Wordpress tips and tricks
Рет қаралды 772
How to add Woocommerce My Account tabs (and remove, rename, reorder them)?
8:19
WP Simple Hacks - Wordpress tips and tricks
Рет қаралды 17 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
This AI Teaches WordPress in Real Time - You Won’t Believe It!
6:03
WP Simple Hacks - Wordpress tips and tricks
Рет қаралды 1 М.
Quick Hack #23: Add Custom Product Tabs in WooCommerce in Just 3 Minutes!
5:21
WP Simple Hacks - Wordpress tips and tricks
Рет қаралды 452
The 8 WooCommerce Hacks No One Talks About!
28:06
WP Simple Hacks - Wordpress tips and tricks
Рет қаралды 781
12 ESSENTIAL Steps to Take After Installing WordPress
18:46
WP Simple Hacks - Wordpress tips and tricks
Рет қаралды 781
Top 9 NEW Blocksy Theme Features Released This Year!
20:51
WP Simple Hacks - Wordpress tips and tricks
Рет қаралды 1,4 М.
6 Things I Wish I Knew Before Using WordPress
10:00
WP Simple Hacks - Wordpress tips and tricks
Рет қаралды 1 М.
8 Secret WordPress Plugins You’ll Wish You Knew Before
13:59
WP Simple Hacks - Wordpress tips and tricks
Рет қаралды 1,6 М.