Functions priority backwards
-
I have set the following to childs functions file to show the sku and the availability in the archive page
/** Show SKU in product loop below product thumbnail */
function custom_after_title() {
global $product;
if ( $product->get_sku() ) {
echo '<div class="sku-archive">Smart Code:'.$product->get_sku().'</div>';
}
else
echo '<div class="sku-archive">Smart Code: N/A</div>';}
add_action( 'woocommerce_after_shop_loop_item_title', 'custom_after_title',10 );
//* Add stock status to archive pages
function envy_stock_catalog() {
global $product;
if ( $product->is_in_stock() ) {
echo '<div class="stock" >' . $product->get_stock_quantity() . __( ' in stock', 'envy' ) . '</div>';
} else {
echo '<div class="out-of-stock" >' . __( 'out of stock', 'envy' ) . '</div>';
}
}
add_action( 'woocommerce_after_shop_loop_item_title', 'envy_stock_catalog',11 );
It works fine except the priority.
Upon the code i have inserted in functions it is supposed to show sku first and availability afterwards.
In the live website it is shown the opposite (first show the availability and afterwards the sku!!!
Hello,
Please provide your site admin access to the private area.
Best Regards
Hello,
Please add this code to the Theme Settings > Custom CSS > Global:
.woodmart-hover-base .wrapp-product-price {
flex-direction: column;
}
Best Regards
Excellent.
That did the trick, indeed.
Thank you.
You are welcome! If you have any questions please feel free to contact us.
Best Regards
Thanks a lot… it helped me a lot…
The topic ‘Functions priority backwards’ is closed to new replies.