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
add_action( 'woocommerce_single_product_summary', 'show_number_of_downloads' ); function show_number_of_downloads() { | |
global $wpdb, $product; | |
if ( empty( $product->id ) ) return; | |
if ( $product->product_type == 'variable' ) { | |
$product_ids = $product->get_children(); | |
} else { | |
$product_ids = array( $product->id ); | |
} | |
$query = "SELECT SUM( download_count ) AS count | |
FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions |
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
/*Añade taxonomía categoria a producto en Tienda sin enlace a categorias*/ | |
add_action('woocommerce_shop_loop_item_title', 'add_tags_and_category', 15); | |
function add_tags_and_category() { ?> | |
<div class="tags"> | |
<?php $product_terms = get_the_terms( get_the_ID(), 'product_cat'); | |
if( $product_terms && ! is_wp_error( $product_terms ) ) : | |
foreach( $product_terms as $term) : ?> | |
<span><?php echo $term->name; ?></span> | |
<?php endforeach; | |
endif; ?> |
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
/*Añade taxonomía categoría a producto en Tienda*/ | |
add_action('woocommerce_shop_loop_item_title', 'add_tags_and_category', 15); | |
function add_tags_and_category() { ?> | |
<div class="tags"> | |
<?php $product_terms = get_the_terms( get_the_ID(), 'product_cat'); | |
if( $product_terms && ! is_wp_error( $product_terms ) ) : | |
foreach( $product_terms as $term) : ?> | |
<a href="<?php echo get_term_link( $term->slug, 'product_cat'); ?>" rel="tag" class="btn btn-primary btn-sm mb-4"><?php echo $term->name; ?></a> | |
<?php endforeach; | |
endif; ?> |
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
/*Añade taxonomías etiqueta y categoria a producto en tienda*/ | |
add_action('woocommerce_shop_loop_item_title', 'add_tags_and_category', 15); | |
function add_tags_and_category() { ?> | |
<div class="tags"> | |
<?php $product_tags = get_the_terms( get_the_ID(), 'product_tag') ; | |
if( $product_tags && ! is_wp_error( $product_tags ) ) : | |
foreach( $product_tags as $tag) : ?> | |
<a href="<?php echo get_term_link( $tag->slug, 'product_tag'); ?>" rel="tag" class="btn btn-primary btn-sm mb-4"><?php echo $tag->name; ?></a> | |
<?php endforeach; | |
endif; |
NewerOlder