• Resolved franklnx

    (@franklnx)


    Hello,
    let’s talk about headings order and accessibility.
    In the block style options (block headings) we can only choose between various H’s (H1, H2, H3, H4, ….) but this can lead to problems in the headings structure of the entire product page in certain scenarios.
    It might be useful not to force the choice and leave the option of not indicating a specific heading.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there,

    I hope you’re well. It’s not possible to use the HTML Heading add-on without selecting a heading type.

    In that case, you could instead use the HTML Text add-on to add the title and customize the style for that add-on using CSS.

    Let us know if you need more help.

    Thread Starter franklnx

    (@franklnx)

    Hello @aranofacundo ,
    thanks for the quick response.
    Regardless of whether I enter a title for the options block or not, the plugin inserts it anyway so, in the code, we find a heading.

    <div class="addon-header">
    <h2 class="wapo-addon-title toggle-closed">
    <span></span>
    </h2>
    </div>

    If I enter no title but the option block provides a mandatory selection, an asterisk is inserted as the title.

    <div class="addon-header">
    <h2 class="wapo-addon-title toggle-closed">
    <span></span>
    <span class="required">*</span>
    </h2>
    </div>

    Anyway then, I find an heading before the add to cart button.
    Consider that, for example, any “product variations” are shown with a simple HTML “label” tag. There is no reason to insert a heading between the “variations” and the “add to cart” button.

    I hope I have explained myself better and that you can suggest a simple solution.
    Thanks for the support!

    Hi,

    About your request, unfortunately if you want to achieve it, you will need to customize the templates of the plugin by copying the block.php file in wp-content/plugins/yith-woocommerce-product-add-ons/templates/front/ to the woocommerce/front folder in your current theme.

    Alternatively, if you want to change the default heading element of the block with a div element, you could try adding the following code in the functions.php file of your current theme:

    if ( ! function_exists( 'yith_wapo_custom_element_for_headers' ) ) {
    function yith_wapo_custom_element_for_headers( $options ) {
    $options['style']['style-addon-titles']['options']['div'] = 'DIV';
    return $options;
    }
    add_filter( 'yith_wapo_panel_style_options', 'yith_wapo_custom_element_for_headers', 99, 1 );
    }

    Do keep in mind that it is recommended you set both titles and labels for the add-ons and options to prevent issue when they are added to the cart.

    We’ll remain at your disposal.

    Thread Starter franklnx

    (@franklnx)

    Hi,
    I added the snippet and now it is possible to select DIV thus solving the headings order problem and getting a correct structure. Thank you very much for the support!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Block titles’ is closed to new replies.