El costo de envío de coordinará según indique la apicación de envío
';
}
}
/*******************************************************************************************/
//20240423 : FZSM - Add custom field for color to product
add_action('woocommerce_product_options_general_product_data', 'add_color_custom_field');
function add_color_custom_field() {
// Text field for color
woocommerce_wp_text_input(
array(
'id' => 'color_custom_field',
'label' => __('Color', 'woocommerce'),
'placeholder' => __('Color del producto?', 'woocommerce'),
'desc_tip' => 'true',
'description' => __('Ingrese el color del producto.', 'woocommerce')
)
);
}
// Save custom field value
add_action('woocommerce_process_product_meta', 'save_color_custom_field');
function save_color_custom_field($post_id) {
$color = $_POST['color_custom_field'];
if (!empty($color)) {
update_post_meta($post_id, 'color_custom_field', esc_attr($color));
}
}
/***************************************************************************************************/
// Display custom field (color) on the product page
add_action('woocommerce_single_product_summary', 'display_color_custom_field', 25);
function display_color_custom_field() {
global $product;
// Get the color custom field value
$color = get_post_meta($product->get_id(), 'color_custom_field', true);
// Display the color if available
if (!empty($color)) {
echo '
Por favor, introduce tu nombre de usuario o dirección de correo electrónico. Recibirás un mensaje de correo electrónico con instrucciones sobre cómo restablecer tu contraseña.