<a href="?add-to-cart=ваш_id" data-quantity="количество_единиц" class="product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="ваш_id" data-product_sku="" aria-label="Добавить в корзину" rel="nofollow" tabindex="0">
<span>Добавить в корзину</span>
</a>
<script src="/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=4.9.2" id="wc-add-to-cart-js"></script>
<!-- Он должен быть по стандарту там, но мало ли -->
<div class="add-to-cart ">
<a href="<?php echo $product->add_to_cart_url(); ?>" class="cart">
<span class="add-to-cart-content">Добавить в корзину</span>
</a>
</div>
<ul>
<?php
$catalog_orderby = apply_filters( 'woocommerce_catalog_orderby', array(
'menu_order' => __( 'Default sorting', 'woocommerce' ),
'price' => __( 'Sort by price: low to high', 'woocommerce' ),
'price-desc' => __( 'Sort by price: high to low', 'woocommerce' )
) );
if ( get_option( 'woocommerce_enable_review_rating' ) == 'no' )
unset( $catalog_orderby['rating'] );
foreach ( $catalog_orderby as $id => $name )
echo '<li><a href="' . get_permalink( woocommerce_get_page_id( 'shop' ) ) . '?orderby=' . $id . '" >' . esc_attr( $name ) . '</a></li>';
?>
</ul>