Adding class to the product archive
-
Hi, I’m using custom code for product archive. I want to add a class to the product li, when the product is pre order. Something like below
$out_of_stock_class = $product->is_in_stock() ? ” : ‘out-of-stock’;
‘out_of_stock_class’ => $out_of_stock_class,
echo ‘<li class=”‘ . $product[‘out_of_stock_class’] . ‘”>’;
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding class to the product archive’ is closed to new replies.