Find Jobs
Hire Freelancers

Unset payment gateway for specific categories (Woocommerce)

$10-30 USD

Fechado
Publicado há quase 3 anos

$10-30 USD

Pago na entrega
I have a code for unset some payments gateways when there are some products added to the cart. Its working fine when user make the purchase process from frontend.., but when the order is added from admin panel and payment link sent to customer from there, its not working. Here is the code used: add_filter( 'woocommerce_available_payment_gateways', 'bbloomer_unset_gateway_by_category' ); function bbloomer_unset_gateway_by_category( $available_gateways ) { if ( is_admin() ) return $available_gateways; if ( ! is_checkout() ) return $available_gateways; $unset = false; $category_ids = array( 61, 89, 58, 90, 93, 95, 91, 98, 106); foreach ( WC()->cart->get_cart_contents() as $key => $values ) { $terms = get_the_terms( $values['product_id'], 'product_cat' ); foreach ( $terms as $term ) { if ( in_array( $term->term_id, $category_ids ) ) { $unset = true; break; } } } if ( $unset == true ) unset( $available_gateways['bacs'] ); return $available_gateways; } Here is the payment link that is not working: [login to view URL]
ID do Projeto: 29730222

Sobre o projeto

8 propostas
Projeto remoto
Ativo há 3 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
8 freelancers estão ofertando em média $34 USD for esse trabalho
Avatar do Usuário
Hi Man! "Want a WordPress Website Or to modify it?" This is Amir Anwar in your service with the presence of gigantic skills in WordPress Development. I can give you a number of features in your WordPress Site (New Or Old). I can give you the service of a number of unique developments stated, *Custom Plugin Development *Portfolio sites *Listing Sites *Multi-vendor sites *Ecommerce Stores *Service Providing sites *Plugin modification *BuddyPress sites And more a number of features i can provide yolu with the quality and clean working. Regards, Amir Anwar
$10 USD em 2 dias
5,0 (7 avaliações)
4,5
4,5
Avatar do Usuário
Hello, I will help you with an issue you facing. Ready to start right now. With my best regards, Yaroslav
$20 USD em 1 dia
5,0 (1 avaliação)
0,6
0,6

Sobre o cliente

Bandeira do(a) CHILE
RUT 96.665.690-5, Chile
5,0
22
Método de pagamento verificado
Membro desde nov. 13, 2017

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.