Home Forums WoodMart support forum Sidecart title “Carrito” needs to not be a h2

Sidecart title “Carrito” needs to not be a h2

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #693025

    seo-0882
    Participant

    Hi, the cart title is an h2 and I need it to be an span or not a title. How can I get that?

    Also the texto is not alligned to the left,, how can it be fixed?

    Attachments:
    You must be logged in to view attached files.
    #693088

    Hello,

    Sorry to say, there are no direct options in theme settings available for that.

    You find it in the file woocommerce/cart/mini-cart.php

    You need to edit the theme files for this. All the customizations made in the theme files are at your own risk.

    Best Regards,

    #693103

    seo-0882
    Participant

    I don´t see where I can change the h2 to a span in the code… Can you help me?

    #693127

    seo-0882
    Participant

    Also the demo was with the text of the min cart not being an h2, and alligned at the left, it should be like that, cause i didnt change anything,,,,

    Attachments:
    You must be logged in to view attached files.
    #693139

    Hello,

    Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.

    Best Regards,

    #693144

    seo-0882
    Participant

    Attached. Thanks and tell me the steps you Will follow pls

    #693172

    Hello,

    Please try to deactivate the “Code Snippets” plugin on your site and check the issue after completely clearing the cache.

    Best Regards,

    #693187

    seo-0882
    Participant

    done, but the unique code i had there i put it on the child theme in functions and still not working: this is the code I have that i need for size guides part: // En functions.php del child theme o en Code Snippets
    add_action( ‘wp_enqueue_scripts’, ‘jc_replace_wd_heading_to_h2’ );
    function jc_replace_wd_heading_to_h2() {
    // Registramos un “handle” válido para añadir el inline script
    wp_register_script( ‘jc-wd-heading’, false, [], null, true );
    wp_enqueue_script( ‘jc-wd-heading’ );

    $js = <<<‘JS’
    (function(){
    function replaceHeading(el){
    if(!el) return;
    var title = el.querySelector(‘.title’);
    if(title && title.tagName.toLowerCase() !== ‘h2’){
    var h2 = document.createElement(‘h2’);
    h2.className = ‘wd-heading-title’;
    h2.innerHTML = title.innerHTML;

    // Reemplaza el span.title por el nuevo h2
    title.parentNode.replaceChild(h2, title);

    // Conserva el botón de cierre si existe (ya estará dentro del mismo .wd-heading)
    var closeBtn = el.querySelector(‘.close-side-hidden’);
    if(closeBtn) el.appendChild(closeBtn);

    // Añade una clase para posibles estilos específicos
    el.classList.add(‘wd-heading–h2’);
    }
    }

    document.addEventListener(‘DOMContentLoaded’, function(){
    document.querySelectorAll(‘.wd-heading’).forEach(replaceHeading);
    });
    })();
    JS;
    // Añadimos el script en línea al handle registrado
    wp_add_inline_script( ‘jc-wd-heading’, $js );
    }

    #693191

    seo-0882
    Participant

    sorry, i need this code to have the product labels titles as h2, like description etc…

    Is it a way to just aply it to them, and not the cart title?:

    // En functions.php del child theme o en Code Snippets
    add_action( ‘wp_enqueue_scripts’, ‘jc_replace_wd_heading_to_h2’ );
    function jc_replace_wd_heading_to_h2() {
    // Registramos un “handle” válido para añadir el inline script
    wp_register_script( ‘jc-wd-heading’, false, [], null, true );
    wp_enqueue_script( ‘jc-wd-heading’ );

    $js = <<<‘JS’
    (function(){
    function replaceHeading(el){
    if(!el) return;
    var title = el.querySelector(‘.title’);
    if(title && title.tagName.toLowerCase() !== ‘h2’){
    var h2 = document.createElement(‘h2’);
    h2.className = ‘wd-heading-title’;
    h2.innerHTML = title.innerHTML;

    // Reemplaza el span.title por el nuevo h2
    title.parentNode.replaceChild(h2, title);

    // Conserva el botón de cierre si existe (ya estará dentro del mismo .wd-heading)
    var closeBtn = el.querySelector(‘.close-side-hidden’);
    if(closeBtn) el.appendChild(closeBtn);

    // Añade una clase para posibles estilos específicos
    el.classList.add(‘wd-heading–h2’);
    }
    }

    document.addEventListener(‘DOMContentLoaded’, function(){
    document.querySelectorAll(‘.wd-heading’).forEach(replaceHeading);
    });
    })();
    JS;
    // Añadimos el script en línea al handle registrado
    wp_add_inline_script( ‘jc-wd-heading’, $js );
    }

    #693196

    Hello,

    Sorry to say, it requires customization and is beyond our support policy. Additional code customizations in theme files are out of our theme support scope.

    Hope you can understand!

    Best Regards,

Viewing 10 posts - 1 through 10 (of 10 total)