get_the_terms( $product->id, 'pa_color');
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
if ( is_user_logged_in() ) {
unset( $tabs['additional_information'] );
}
return $tabs;
}
<?php $names = array ('один атрибут', 'второй атрибут') //имена атрибутов, которые не будем показывать
foreach ( $attributes as $attribute ) :
if ( !is_user_logged_in() && in_array($attribute['name'], $names ) {
continue; //пропускаем атрибут
}
if ( empty( $attribute['is_visible'] ) || ( $attribute['is_taxonomy'] && ! taxonomy_exists( $attribute['name'] ) ) ) {
continue;
} else {
$has_row = true;
}
?>
<tr class="<?php if ( ( $alt = $alt * -1 ) == 1 ) echo 'alt'; ?>">
<th><?php echo wc_attribute_label( $attribute['name'] ); ?></th>
//далее остальной файл
$(document).ready(function(){
// SLIDER : begin
var $slider = $("#content-page.cobra");
var slider = $slider.bxSlider({
mode: 'vertical',
slideMargin: 0,
// video: true,
pager: false,
infiniteLoop: false,
controls: false,
adaptiveHeight: true
});
// scroll : begin
var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0;
// if OS === Mac OS X
if(isMac){
isMoving = false;
$slider.on('mousewheel', function(e) {
if (e.deltaY > 1) {
if (!isMoving) {
isMoving = true;
slider.goToPrevSlide();
}
}
else if (e.deltaY < -1) {
if (!isMoving) {
isMoving = true;
slider.goToNextSlide();
}
}
else { isMoving = false; }
event.stopPropagation();
event.preventDefault();
});
}
// other OS
else{
$slider.on("mousewheel", function(event, delta, deltaX, deltaY) {
//console.log(event, delta, deltaX, deltaY);
if (delta > 0) {
slider.goToPrevSlide();
}
if (deltaY < 0){
slider.goToNextSlide();
}
event.stopPropagation();
event.preventDefault();
});
}
// scroll : end
// SLIDER : end
});
background-*
:background: #F90
полностью эквивалентен background-color: #F90
background: #F90 url(fon.jpg) repeat-x
равен background-color: #F90;
background-image: url(fon.jpg);
background-repeat: repeat-x;
public function get_customer_total_order() {
$customer_orders = get_posts( array(
'numberposts' => - 1,
'meta_key' => '_customer_user',
'meta_value' => get_current_user_id(),
'post_type' => array( 'shop_order' ),
'post_status' => array( 'wc-completed' )
) );
$total = 0;
foreach ( $customer_orders as $customer_order ) {
$order = wc_get_order( $customer_order );
$total += $order->get_total();
}
return $total;
}
Сумма всех заказов: <?php echo get_customer_total_order(); ?>