- Anexo
- Ocultar “#ParadaRecife” e incluir o novos palestrantes para “#ParadaBH”. Vamos enviar as mini bios + fotos amanhã tbm.
<?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 | |
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 ) |
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; | |
} |
/** | |
* Ordena produtos fora de estoque no final do catálogo | |
* source: https://stackoverflow.com/a/44597448 | |
*/ | |
add_filter('posts_clauses', 'order_by_stock_status'); | |
function order_by_stock_status($posts_clauses) { | |
global $wpdb; | |
// only change query on WooCommerce loops | |
if (is_woocommerce() && (is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy())) { | |
$posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) "; |
<?php | |
/** | |
* Ordena produtos fora de estoque no final do catálogo | |
* source: https://stackoverflow.com/a/44597448 | |
*/ | |
add_filter('posts_clauses', 'order_by_stock_status'); | |
function order_by_stock_status($posts_clauses) { | |
global $wpdb; | |
// only change query on WooCommerce loops |
<?php | |
/** | |
* Remove produtos fora de estoque do cross sell | |
* @See https://github.com/woocommerce/woocommerce/blob/444dffdda27750b98ce1517d5f6f4d8153c53967/includes/class-wc-cart.php#L817 | |
*/ | |
add_filter('woocommerce_cart_crosssell_ids', 'remove_out_of_stock_from_crosssell', 10, 1 ); | |
function remove_out_of_stock_from_crosssell( $wp_parse_id_list ){ | |
if (!empty($wp_parse_id_list)) { | |
foreach ($wp_parse_id_list as $product_id) { |
import { firestore } from '../firebase/firebase.utils' | |
import moment from 'moment' | |
export function usePost() { | |
const createPost = async (post) => { | |
const { type, category, displayName, link, quote, sponsored, sponsoredclicks, target, title, userId } = post | |
let postAdd = { | |
type, | |
actionType: "Add", |
/** | |
* Cria os campos na taxonomia | |
*/ | |
function nerdstore_taxonomy_edit_custom_meta_field($term) { | |
$t_id = $term->term_id; | |
$term_meta = get_option( "taxonomy_$t_id" ); | |
$mobile_image = isset($term_meta['mobile_image_term_meta']) ? $term_meta['mobile_image_term_meta'] : false; | |
$desktop_image = isset($term_meta['desktop_image_term_meta']) ? $term_meta['desktop_image_term_meta'] : false; | |
?> |
<?php | |
/** | |
* Cria os campos na taxonomia | |
*/ | |
function nerdstore_taxonomy_edit_custom_meta_field($term) { | |
$t_id = $term->term_id; | |
$term_meta = get_option( "taxonomy_$t_id" ); | |
$mobile_image = isset($term_meta['mobile_image_term_meta']) ? $term_meta['mobile_image_term_meta'] : false; |