wpovernight / woocommerce-pdf-invoices-packing-slips

Create, print & automatically email PDF invoices & packing slips for WooCommerce orders.
https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/
Other
100 stars 46 forks source link

Tweak: improved Bulk document `get_html` method #832

Closed alexmigf closed 1 month ago

alexmigf commented 1 month ago

This PR aims to improve the Bulk document get_html method by placing the required hooks inside the orders loop. This is important because we detect and reset languages, in multilingual setups, using this hooks in each document here: https://github.com/wpovernight/woocommerce-pdf-ips-pro/pull/397/files#diff-f5fe2ecddcf1afabc5e611c28a555e0d99f5f1745d4f2dac8af70dda17dadf86R27-R29

MohamadNateqi commented 1 month ago

May I ask why you removed these codes:

// temporarily apply filters that need to be removed again after the html is generated
$html_filters = apply_filters( 'wpo_wcpdf_html_filters', array(), $document );
$this->add_filters( $html_filters );

do_action( 'wpo_wcpdf_before_html', $document->get_type(), $document );
alexmigf commented 1 month ago

@MohamadNateqi because $document->get_html() already call them.