Sale! versus Sold Out!
-
I am using this code snippet to mark products as “sold out” (or “vendido”):
// colocar etiqueta de “vendido”
add_action ( ‘woocommerce_before_shop_loop_item_title’, ‘vendido’);
function vendido() {
global $product;
$estatus = get_post_meta ($product->get_id(), ‘estatus_del_negocio’, true);
if ( $estatus == ‘vendido’ ) { echo ‘<span class=”onsale”>Vendido</span>’; }
}It works fine, except that if that same product happen to be also “On Sale”, that tag takes precedence, and “Sold Out” is not shown. I need to reverse that precedence: if a product is both “On Sale” and “Sold out”, only the last tag should be shown.
Thanks: René.
The page I need help with: [log in to see the link]
- The topic ‘Sale! versus Sold Out!’ is closed to new replies.