• priolino

    (@priolino)


    Buongiorno,
    ho usato lo snippet ufficiale per woocommerce che dovrebbe farmi rinominare i tab.
    Il fatto è che purtroppo funziona solo sui primi due, mentre additional information rimane tale.

    Questo è il codice che ho messo nel theme child, function.php, ripeto, rinomina tutti i tab tranne quello:

    http://codepad.org/dhgoUcjd

Stai visualizzando 2 risposte - dal 1 al 2 (di 2 totali)
  • Moderator Cristiano Zanca

    (@cristianozanca)

    Salve @priolino ,

    quel tab appare solo se sono attivi weight, dimensions or attributes del prodotto, è necessario quindi aggiungere una condizione nel codice.

    The Additional Information tab
    Please note that the “Additional Information” tab will only show if the product has weight, dimensions or attributes (not used for variation for variable products). If you try to apply a change to that tab and if the product does not have weight, dimensions or attribute, you will get an error message similar to :

    Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /mysite/wp-content/plugins/woocommerce/templates/single-product/tabs/tabs.php on line 35

    In that case you have to use WooCommerce conditional tags:

    has_attributes()
    has_dimensions()
    has_weight()

    tratto da https://docs.woocommerce.com/document/editing-product-data-tabs/

    Chi ha creato la discussione priolino

    (@priolino)

    in questo caso era il template un po balordo. ora per fortuna con gli snippet funziona alla grande ed ha scritto ciò che ho indicato

Stai visualizzando 2 risposte - dal 1 al 2 (di 2 totali)
  • Il topic ‘Snippet Cambio nome tab woocommerce non funziona del tutto’ è chiuso a nuove risposte.