Skip to content

Commit 5eb4d93

Browse files
committed
Fix #457 The additional options created from the 'Extra Product Options & Add-Ons for WooCommerce' plugin is not showing on the Invoice/Delivery Notes/ Receipt templates.
Fix #457 The additional options created from the 'Extra Product Options & Add-Ons for WooCommerce' plugin is not showing on the Invoice/Delivery Notes/ Receipt templates.
1 parent 0ee3df0 commit 5eb4d93

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

includes/admin/views/Preview_template/default-preview-template.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@
209209
$product_addons = WC_Product_Addons_Helper::get_product_addons( $product_id );
210210
}
211211
}
212+
// Extra Product Options (ThemeComplete EPO) support.
213+
$epo_data = $item->get_meta( '_tmcartepo_data', true );
214+
if ( ! empty( $epo_data ) && is_array( $epo_data ) ) {
215+
foreach ( $epo_data as $epo ) {
216+
if ( ! empty( $epo['name'] ) && isset( $epo['value'] ) ) {
217+
echo '<br>' . wp_kses_post( '<strong>' . $epo['name'] . ' : </strong>' . $epo['value'] );
218+
}
219+
}
220+
}
212221
if ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) {
213222
if ( isset( $item['variation_id'] ) && 0 !== $item['variation_id'] ) {
214223
$variation = wc_get_product( $item['product_id'] );

templates/print-order/print-content.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@
166166
$product_addons = WC_Product_Addons_Helper::get_product_addons( $product_id );
167167
}
168168
}
169+
// Extra Product Options (ThemeComplete EPO) support.
170+
$epo_data = $item->get_meta( '_tmcartepo_data', true );
171+
if ( ! empty( $epo_data ) && is_array( $epo_data ) ) {
172+
foreach ( $epo_data as $epo ) {
173+
if ( ! empty( $epo['name'] ) && isset( $epo['value'] ) ) {
174+
echo '<br>' . wp_kses_post( '<strong>' . $epo['name'] . ' : </strong>' . $epo['value'] );
175+
}
176+
}
177+
}
169178
if ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) {
170179
if ( isset( $item['variation_id'] ) && 0 !== $item['variation_id'] ) {
171180
$variation = wc_get_product( $item['product_id'] );

0 commit comments

Comments
 (0)