• Resolved migomarketing

    (@migomarketing)


    Is it possible to display 2 different badges, as follows:

    OUT OF STOCK – 1 Red badge that says “Special Order”

    BACK ORDER – 1 yellow badge that says “Limited Quantity”

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter migomarketing

    (@migomarketing)

    Checking in if anyone is available to reply?

    Plugin Author Charlie Etienne

    (@charlieetienne)

    Hi @migomarketing ,

    you could achieve this with some custom code:

    In the plugin settings, configure the badge for your first case:
    OUT OF STOCK – 1 Red badge that says “Special Order”

    Make sure you choose both options for the select named “behaviour” (Display on out of stock products AND Display on available on backorder products)

    Add this snippet to your child theme’s functions.php:

    add_filter('wcsob_soldout', function($badge_html, $post, $product) {
    	if($product->is_on_backorder()){
    		$badge_html = '<span class="wcsob_soldout wcsob_backorder">Limited Quantity</span>';
    		$badge_html .= '<style>.wcsob_soldout.wcsob_backorder{background:yellow;}</style>';
    	}
    	return $badge_html;
    }, 10, 3);

    Cheers,

    Charlie

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘2 Badges – Out of Stock & Back Order’ is closed to new replies.