This file contains 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
RewriteEngine On | |
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L] |
This file contains 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 | |
function custom_woocommerce_correios_shipping_methods( $rate, $instance_id ) { | |
// Verifica se esta utilizando a instancia correta, se não estiver para o código. | |
if ( 99 !== $instance_id ) { | |
return $rate; | |
} | |
$rate['cost'] = 0; | |
return $rate; |
This file contains 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 | |
function custom_woocommerce_correios_shipping_methods( $rate ) { | |
if ( isset( WC()->cart->subtotal ) && 100 <= WC()->cart->subtotal ) { | |
$rate['cost'] = 0; | |
} | |
return $rate; | |
} | |
add_filter( 'woocommerce_correios_correios-pac_rate', 'custom_woocommerce_correios_shipping_methods' ); |
This file contains 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 | |
function custom_woocommerce_correios_shipping_methods( $rate ) { | |
$rate['cost'] = 0; | |
return $rate; | |
} | |
add_filter( 'woocommerce_correios_correios-pac_rate', 'custom_woocommerce_correios_shipping_methods' ); |
This file contains 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 | |
/** | |
* Display (Free) when shipping method does not charge any cost. | |
* | |
* @param String $label Shipping method label. | |
* @param WC_Shipping_Rate $method Shipping method data. | |
* @return string | |
*/ | |
function my_wc_custom_free_shipping_label( $label, $method ) { | |
// Only apply when is free and not using the free shipping method. |
This file contains 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 | |
/** | |
* Save the extra register fields. | |
* | |
* @param int $customer_id Current customer ID. | |
*/ | |
function wooc_save_extra_register_fields( $customer_id ) { | |
if ( isset( $_POST['billing_first_name'] ) ) { | |
// WordPress default first name field. | |
update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) ); |
This file contains 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 | |
/** | |
* Validate the extra register fields. | |
* | |
* @param WP_Error $validation_errors Errors. | |
* @param string $username Current username. | |
* @param string $email Current email. | |
* | |
* @return WP_Error | |
*/ |
This file contains 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
RewriteCond %{THE_REQUEST} \s(.*?)\&\;([^\s]*) [NC] | |
RewriteRule ^ /%1&%2 [L,NE,R] |
This file contains 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 | |
/** | |
* Add to cart redirect to checkout. | |
* | |
* @param string $url | |
* @return string | |
*/ | |
function my_wc_add_to_cart_redirect_to_checkout( $url ) { | |
return wc_get_checkout_url(); |
This file contains 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 | |
/** | |
* Custom WooCommerce tag cloud shortcode. | |
* | |
* Use the follow shortcode in your pages: [my_wc_tag_cloud] | |
*/ | |
function my_custom_wc_tag_cloud_shortcode() { | |
return wp_tag_cloud( array( 'taxonomy' => 'product_tag', 'echo' => false ) ); | |
} |