CAMBIAR IMAGEN DEL PRODUCTO

// Snippet para cambiar la imagen por defecto en WooCommerce
add_action( ‘init’, ‘custom_placeholder_image’ );

function custom_placeholder_image() {
add_filter(‘woocommerce_placeholder_img_src’, ‘custom_woocommerce_placeholder_img_src’);

function custom_woocommerce_placeholder_img_src( $src ) {
$upload_dir = wp_upload_dir();
$uploads = untrailingslashit( $upload_dir[‘baseurl’] );
$src = $uploads . ‘/2016/06/producto-no-disponible.png’;

return $src;
}
}

Entradas relacionadas