Код: Выделить всё
dangerous-goods
Пример:
Код: Выделить всё
// Add the handling fee with a link
$fee_label = 'Handling fee - dangerous goods ([url=https://example.com]Learn More[/url])';
$cart->add_fee( $fee_label, $handling_fee, true );
Альтернативное решение:
Альтернативное решение. woocommerce_cart_totals_fee_html , Filter Chook из этого решения, которое позволяет изменять или настраивать визуализированный HTML -вывод отображаемого платы.
Код: Выделить всё
add_filter( 'woocommerce_cart_totals_fee_html', 'custom_handling_fee_link', 10, 2 );
function custom_handling_fee_link( $fee_html, $fee ) {
// Check if the current page is the checkout page & fee name
if ( is_checkout() && $fee->name === 'Handling fee - dangerous goods' ) {
$fee_html .= ' [url=https://example.com](Learn More)[/url]';
}
return $fee_html;
}
Подробнее здесь: https://stackoverflow.com/questions/795 ... n-checkout