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 order again button in my orders actions. | |
* | |
* @param array $actions | |
* @param WC_Order $order | |
* @return array | |
*/ | |
function cs_add_order_again_to_my_orders_actions( $actions, $order ) { | |
if ( $order->has_status( 'completed' ) ) { |
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 | |
/** | |
* Hide the "In stock" message on product page. | |
* | |
* @param string $html | |
* @param string $text | |
* @param WC_Product $product | |
* @return string | |
*/ | |
function my_wc_hide_in_stock_message( $html, $text, $product ) { |
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 | |
/** | |
* Hide shipping rates when free shipping is available. | |
* Updated to support WooCommerce 2.6 Shipping Zones. | |
* | |
* @param array $rates Array of rates found for the package. | |
* @return array | |
*/ | |
function my_hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); |
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 | |
// Colar no functions.php | |
// Para remover os hooks | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta' ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing' ); |
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 | |
/** | |
* Single Product Price, including microdata for SEO | |
* | |
* @author WooThemes | |
* @package WooCommerce/Templates | |
* @version 1.6.4 | |
*/ | |
global $post, $product; |
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 | |
/** | |
* Related Posts. | |
* | |
* Usage: | |
* To show related by categories: | |
* Add in single.php <?php dfw_related_posts(); ?>. | |
* To show related by tags: | |
* Add in single.php <?php dfw_related_posts('tag'); ?>. |
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 new register fields for WooCommerce registration. | |
* | |
* @return string Register fields HTML. | |
*/ | |
function cs_wc_extra_register_fields() { | |
?> | |
<p class="form-row form-row-first"> | |
<label for="reg_billing_first_name"><?php _e( 'Nome', 'textdomain' ); ?> <span class="required">*</span></label> |
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_loop_add_to_cart_link( $html, $product ) { | |
return '<a href="' . get_permalink( $product->id ) . '" class="button">' . __( 'Texto do botão' ) . '</a>'; | |
} | |
add_filter( 'woocommerce_loop_add_to_cart_link', 'custom_woocommerce_loop_add_to_cart_link', 10, 2 ); |
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 | |
*/ |