Last active
May 2, 2023 04:46
-
-
Save dimaspante/8f72f2c874d1504573903f6d4cefe634 to your computer and use it in GitHub Desktop.
Edições gerais para o Woocommerce no arquivo de funções do Wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Altera detalhes nos forms de checkout | |
* | |
* Lista de campos disponível em: | |
* https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ | |
*/ | |
function my_shipping_fields($fields){ | |
$fields['shipping']['shipping_address_2']['label_class'] = "visible"; //form de entrega | |
$fields['billing']['billing_address_2']['label_class'] = "visible"; //form de cobrança | |
return $fields; | |
} | |
add_filter( 'woocommerce_checkout_fields' , 'my_shipping_fields' ); | |
/** | |
* Altera a ordem dos campos desejados (priority) | |
* | |
* Lista de campos disponível em: | |
* https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ | |
*/ | |
function my_fields_priority( $checkout_fields ) { | |
$checkout_fields['billing']['billing_neighborhood']['priority'] = 9; | |
$checkout_fields['billing']['billing_number']['priority'] = 10; | |
return $checkout_fields; | |
} | |
add_filter( 'woocommerce_checkout_fields', 'my_fields_priority' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment