- Ve a plugins/woocommerce-pdf-invoice/includes/woo-pdf-invoice.class.php
- Necesitamos hacer cambios en 8 lugares del archivo woo-pdf-invoice.class.php
- Encuentra la función total y cambia el código por el siguiente:
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;
}
}
- Obtendrás algo como esto:

- Luego encuentra la función row_total e inserta el siguiente código allí como en la pantalla:
if(class_exists('WOOCS')) {
$line_subtotal = WOOCS::normalize_order_data($this->orderData->id, $line_subtotal);
}
- Luego encuentra la función item_price y reemplaza el código por este como en la pantalla:
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;
}
}
- Luego encuentra la función get_totals y reemplaza el siguiente código como en la pantalla:
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,
);
}
- En la misma función encuentra la cadena //Display taxes below total only if subtotal is displayed including taxes e inserta el siguiente código:
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,
);
}
- Encuentra la función render_left_block y reemplaza el siguiente código:
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),
),
);
}
- Ve a la función amount_in_words y reemplaza el siguiente código:
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');
}
}
¡Eso es todo!