foreach ($items as $item) {
$product = $item->get_product();
$qty = $item->get_quantity() ? $item->get_quantity() : 1;
$price = wc_format_localized_price($item->get_total() / $qty);
$text2 .= 'Товар :' . $product->get_name() . ' Кол-во :' . $qty . ' Цена :' . $price;
}
foreach ( $order->get_items() as $item_id => $item ) {
$product_id = $item->get_product_id();
$variation_id = $item->get_variation_id();
$product = $item->get_product();
$name = $item->get_name();
$quantity = $item->get_quantity();
$subtotal = $item->get_subtotal();
$total = $item->get_total();
$tax = $item->get_subtotal_tax();
$taxclass = $item->get_tax_class();
$taxstat = $item->get_tax_status();
$allmeta = $item->get_meta_data();
$custom_meta = $item->get_meta( 'custom_meta_key', true );
$type = $item->get_type();
}
get_post_meta($post_ID, 'meta_key',true);
function init_actions() {
$object = get_queried_object();
if ( ! empty( (int) $object->parent ) && is_tax( [
'product_cat',
'product_tag'
] ) && 0 === get_query_var( 'paged' ) ) {
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
add_action( 'woocommerce_after_main_content', 'woocommerce_taxonomy_archive_description', 100 );
add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 100 );
}
}
add_action( 'init', 'init_actions' );
function woocommerce_taxonomy_archive_description() {
$description = wpautop( do_shortcode( term_description() ) );
if ( ! empty( $description ) ) {
printf( '<div class="term-description">%s</div>', $description );
}
}