Promjena teksta kartica
// Rename a product tab
add_filter( 'woocommerce_product_tabs', 'mx_rename_product_tab', 98);
function mx_rename_product_tab($tabs) {
$tabs['description']['title'] = 'Podaci o proizvodu'; // Default "Opis"
$tabs['additional_information']['title'] = 'Napomene'; //Default "Dodatne informacije"
$tabs['reviews']['title'] = 'Ocjene korisnika'; // Default "Recenzije"
return $tabs;
}
Uklanjanje jedne ili više kartica
// Remove a product tab
add_filter( 'woocommerce_product_tabs', 'mx_remove_product_tab', 98);
function mx_remove_product_tab($tabs) {
unset( $tabs['description'] ); // Ukloni karticu "Opis"
unset( $tabs['reviews'] ); // Ukloni karticu "Recenzije"
unset( $tabs['additional_information'] ); // Ukloni karticu "Dodatne informacije"
return $tabs;
}
Promjena pozicija kartica
// Reorder product tabs
add_filter( 'woocommerce_product_tabs', 'mx_reorder_product_tabs', 98 );
function mx_reorder_product_tabs( $tabs ) {
$tabs['reviews']['priority'] = 5; // Recenzije na prvom mjestu
$tabs['description']['priority'] = 10; // Opis na drugom mjestu
$tabs['additional_information']['priority'] = 15; // Dodatne informacije na zadnjem mjestu
return $tabs;
}
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.
Želite li dodati kontakt formu za upit o proizvodu pročitajte članak/skinite plugin WooCommerce – kreiranje kartice “Upit o proizvodu” a za totalnu kontrolu kartica proizvoda pročitajte/skinite plugin MX WooCommerce custom product tabs plugin.
