Created
October 13, 2023 06:08
-
-
Save marcusig/b99c7317a489af9a9ddb55529a4547c9 to your computer and use it in GitHub Desktop.
Add labels for normal backorder and in stock products
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'tmpl-pc-configurator-choice-item--after', 'hexatac_add_choice_out_of_stock_label' ); | |
function hexatac_add_choice_out_of_stock_label() { | |
echo ' <# if ( data.manage_stock && \'none\' !== data.manage_stock && 0 >= data.stock ) { #> | |
<# if ( data.wc_backorder && "yes" == data.wc_backorder ) { #> | |
<span class="out-of-stock backorder">Sur commande</span> | |
<# } #> | |
<# } else if ( data.manage_stock && \'none\' !== data.manage_stock && 0 < data.stock ) { #> | |
<span class="out-of-stock en-stock">En stock</span> | |
<# } #>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment