Last active
December 4, 2018 17:21
-
-
Save acanza/bc1c466fb26954dbc9155add9d90d9a5 to your computer and use it in GitHub Desktop.
[WooCommerce] Muestra algunos productos sin de stock aunque esté activada la opción de ocultarlos
This file contains hidden or 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
| // [WooCommerce] Muestra algunos productos sin de stock aunque esté activada la opción de ocultarlos | |
| add_filter( 'woocommerce_product_is_visible', 'keep_showing_specific_out_of_stock_product_list', 10, 2 ); | |
| function keep_showing_specific_out_of_stock_product_list( $visible, $product_ID ){ | |
| $product_list = array( 18013, 18050 ); // Escribe dentro de los paréntesis, el listado de IDs de productos que quieras seguir mostrando separados por coma | |
| return in_array( $product_ID, $product_list )? true : $visible; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment