- Allez dans plugins/woocommerce-pdf-invoice/includes/woo-pdf-invoice.class.php
- Nous devons apporter des modifications à 8 endroits dans le fichier woo-pdf-invoice.class.php
- Trouvez la fonction total et remplacez le code par le suivant :
public function total() {
if(class_exists('WOOCS')) {
return (double) WOOCS::normalize_order_data($this->orderData->id, $this->orderData->order_total);
} else {
return (double) $this->orderData->order_total;
}
}
- Vous obtiendrez quelque chose comme ceci :

- Ensuite, trouvez la fonction row_total et insérez le code suivant comme sur l'écran :
if(class_exists('WOOCS')) {
$line_subtotal = WOOCS::normalize_order_data($this->orderData->id, $line_subtotal);
}
- Ensuite, trouvez la fonction item_price et remplacez le code par celui-ci comme sur l'écran :
if((((double) $price) * (int) $item['qty']) == (double) $this->row_total($item, $this->orderData)) {
if(class_exists('WOOCS')) {
return WOOCS::normalize_order_data($this->orderData->id, $price);
} else {
return $price;
}
} else {
if(class_exists('WOOCS')) {
return WOOCS::normalize_order_data($this->orderData->id, $price);
} else {
return $price;
}
}
- Ensuite, trouvez la fonction get_totals et remplacez le code suivant comme sur l'écran :
if(class_exists('WOOCS')) {
$totals['subtotal'] = array(
'name'=>$this->invoiceOptions['woo_pdf_title_subtotal'],
'value'=>(double) WOOCS::normalize_order_data($this->orderData->id, $subtotal),
);
} else {
$totals['subtotal'] = array(
'name'=>$this->invoiceOptions['woo_pdf_title_subtotal'],
'value'=>(double) $subtotal,
);
}
- Dans la même fonction, trouvez la chaîne //Display taxes below total only if subtotal is displayed including taxes et insérez le code suivant :
if(class_exists('WOOCS')) {
$totals['total'] = array(
'name'=>$this->invoiceOptions['woo_pdf_title_total'],
'value'=>(double) WOOCS::normalize_order_data($this->orderData->id, $this->orderData->order_total),
);
} else {
$totals['total'] = array(
'name'=>$this->invoiceOptions['woo_pdf_title_total'],
'value'=>(double) $this->orderData->order_total,
);
}
- Trouvez la fonction render_left_block et remplacez le code suivant :
if(class_exists('WOOCS')) {
$blocks = array(
'amount_in_words'=>array(
'title'=>$this->invoiceOptions['woo_pdf_title_amount_in_words'],
'text'=>$this->get_amount_in_words((double)WOOCS::normalize_order_data($this->orderData->id, $this->orderData->order_total), $this->invoiceOptions),
),
);
} else {
$blocks = array(
'amount_in_words'=>array(
'title'=>$this->invoiceOptions['woo_pdf_title_amount_in_words'],
'text'=>$this->get_amount_in_words((double) $this->orderData->order_total, $this->invoiceOptions),
),
);
}
- Allez dans la fonction amount_in_words et remplacez le code suivant :
if(class_exists('WOOCS')) {
$currency = get_post_meta($this->orderData->id, '_woocs_order_currency', TRUE);
if(!$self) {
$string .= ' ';
$string .= $currency;
}
}else{
if(!$self) {
$string .= ' ';
$string .= _n('dollar', 'dollars', $number, 'woo_pdf');
}
}
C'est tout !