- Anexo
- Ocultar “#ParadaRecife” e incluir o novos palestrantes para “#ParadaBH”. Vamos enviar as mini bios + fotos amanhã tbm.
add_filter( 'wpseo_breadcrumb_single_link' ,'wpseo_remove_breadcrumb_link', 10 ,2); | |
function wpseo_remove_breadcrumb_link( $link_output , $link ){ | |
$text_to_remove = 'Produtos'; | |
if( $link['text'] == $text_to_remove ) { | |
$link_output = ''; | |
} | |
return $link_output; | |
} |
<?php | |
add_action( 'woocommerce_before_calculate_totals', 'add_custom_price', 20, 1); | |
function add_custom_price( $cart_obj ) { | |
// Necessário para WC 3.0+ | |
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) | |
return; | |
// Evita repetição de hook | |
if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) |
<?php | |
add_filter( 'woocommerce_before_cart', 'check_cart_product', 10, 1); | |
function check_cart_product($cart_item_data){ | |
global $woocommerce; | |
$restrict_products = array(42, 45); | |
$cart = WC()->cart; | |
$get_cart = WC()->cart->cart_contents; | |
$has_restrict_product = false; |
<?php | |
/** | |
* Adiciona desconto baseado nos produtos do carrinho | |
*/ | |
function add_cart_fee_based_on_products($cart_object) { | |
global $woocommerce; | |
$fee_products = array(63, 48); | |
$fee_percent = 10; | |
$cart_products = array(); |
/** | |
* Não permitir a troca de status de pedidos cancelados. | |
* Muda o pedido para apovação manual | |
*/ | |
add_filter( 'woocommerce_before_order_object_save', 'prevent_cancelled_order_status_change', 10, 2 ); | |
function prevent_cancelled_order_status_change( $order, $data_store ) { | |
$changes = $order->get_changes(); | |
if (isset($changes['status'])) { |
/** | |
* Breadcrumb na single de produto | |
*/ | |
add_action( 'woocommerce_single_product_summary', 'single_product_breadcrumb', 0 ); | |
function single_product_breadcrumb() { | |
global $post; | |
$out = '<div class="breadcrumbs">'; | |
$out .= '<div class="breadcrumbs__container container">'; | |
$out .= '<a href="' . get_site_url() . '">Home</a> » '; |