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
function wc_get_variable_product_stock_quantity( $output = 'raw', $product_id = 0 ){ | |
global $wpdb, $product; | |
// Get the product ID (can be defined) | |
$product_id = $product_id > 0 ? $product_id : get_the_id(); | |
// Check and get the instance of the WC_Product Object | |
$product = is_a( $product, 'WC_Product' ) ? $product : wc_get_product($product_id); | |
// Only for variable product type |
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
/** | |
* Change the checkout city field to a dropdown field. | |
*/ | |
function jeroen_sormani_change_city_to_dropdown( $fields ) { | |
$city_args = wp_parse_args( array( | |
'type' => 'select', | |
'options' => array( | |