Blog

Martes, 23 Noviembre 2021 08:40

Mover el bloque de información adicional al bloque de agregar al carrito en woocommerce

Written by 
Rate this item
(0 votes)

El siguiente código elimina el bloque de información adicional y lo agrega al bloque de agregar a carrito en woocommerce:

 // Remove additional information tab
add_filter( 'woocommerce_product_tabs', 'remove_additional_information_tab', 100, 1 );
function remove_additional_information_tab( $tabs ) {
    unset($tabs['additional_information']);

    return $tabs;
}

// Add "additional information" after add to cart
add_action( 'woocommerce_single_product_summary', 'additional_info_under_add_to_cart', 35 );
function additional_info_under_add_to_cart() {
    global $product;

    if ( $product && ( $product->has_attributes() || apply_filters( 'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() ) ) ) {
        wc_display_product_attributes( $product );
    }
}

Este fragmento de código hay que añadirlo en:
wp-content/plugins/woocommerce/includes/wc-template-hook.php
Read 20 times

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.