Filter to customize the HTML that gets rendered for each order line item in the receipt. $line_item_display_data will be passed (and must be returned) with the following keys: - inner_html: the HTML text that will go inside a <tr> element, note that wp_kses_post will be applied to this text before actual rendering. - tr_attributes: attributes (e.g. 'class', 'data', 'style') that will be applied to the <tr> element, as an associative array of attribute name => value. - row_index: a number that starts at 0 and increases by one for each processed line item. $line_item_data will contain the following keys: - type: One of 'product', 'subtotal', 'discount', 'fee', 'shipping_total', 'taxes_total', 'amount_paid' - title - amount (formatted with wc_price) - item (only when type is 'product'), and instance of WC_Order_Item - quantity (only when type is 'product')
$line_item_display_data, $line_item_data, $order
Sortie :
@param string $line_item_display_data Data to use to generate the HTML table row to be rendered for the line item. @param array $line_item_data The relevant data for the line item for which the HTML table row is being generated. @param WC_Abstract_Order $order The order for which the receipt is being generated. @return string The actual data to use to generate the HTML for the line item.
// Modifier la valeur avec le filtre 'woocommerce_printable_order_receipt_line_item_display_data'
add_filter('woocommerce_printable_order_receipt_line_item_display_data', 'ma_fonction_filtre', 10, 1);
function ma_fonction_filtre($line_item_display_data) {
// Modifier la valeur
return $line_item_display_data;
}
Chargement des actualités...