Skip to content

Commit a1495f8

Browse files
authored
Merge pull request #462 from TycheSoftwares/fix-457
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.
2 parents 4544f74 + 9fdbce4 commit a1495f8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
$product_addons = WC_Product_Addons_Helper::get_product_addons( $product_id );
210210
}
211211
}
212+
212213
// --- handle YITH add-ons: print labels and remove raw ywapo-* meta to avoid duplicates ---
213214
$yith_addon_meta_map = array();
214215
if ( isset( $item_meta_fields['_ywapo_meta_data'] ) && is_array( $item_meta_fields['_ywapo_meta_data'] ) ) {
@@ -245,6 +246,16 @@
245246
}
246247
}
247248
} // --- end handle YITH add-ons ---
249+
// Extra Product Options (ThemeComplete EPO) support.
250+
$epo_data = $item->get_meta( '_tmcartepo_data', true );
251+
if ( ! empty( $epo_data ) && is_array( $epo_data ) ) {
252+
foreach ( $epo_data as $epo ) {
253+
if ( ! empty( $epo['name'] ) && isset( $epo['value'] ) ) {
254+
echo '<br>' . wp_kses_post( '<strong>' . $epo['name'] . ' : </strong>' . $epo['value'] );
255+
}
256+
}
257+
}
258+
248259
if ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) {
249260
if ( isset( $item['variation_id'] ) && 0 !== $item['variation_id'] ) {
250261
$variation = wc_get_product( $item['product_id'] );

templates/print-order/print-content.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
$product_addons = WC_Product_Addons_Helper::get_product_addons( $product_id );
167167
}
168168
}
169-
// --- handle YITH add-ons: print labels and remove raw ywapo-* meta to avoid duplicates ---
169+
// --- handle YITH add-ons: print labels and remove raw ywapo-* meta to avoid duplicates ---
170170
$yith_addon_meta_map = array();
171171
if ( isset( $item_meta_fields['_ywapo_meta_data'] ) && is_array( $item_meta_fields['_ywapo_meta_data'] ) ) {
172172
foreach ( $item_meta_fields['_ywapo_meta_data'] as $group ) {
@@ -202,6 +202,16 @@
202202
}
203203
}
204204
} // --- end handle YITH add-ons ---
205+
// Extra Product Options (ThemeComplete EPO) support.
206+
$epo_data = $item->get_meta( '_tmcartepo_data', true );
207+
if ( ! empty( $epo_data ) && is_array( $epo_data ) ) {
208+
foreach ( $epo_data as $epo ) {
209+
if ( ! empty( $epo['name'] ) && isset( $epo['value'] ) ) {
210+
echo '<br>' . wp_kses_post( '<strong>' . $epo['name'] . ' : </strong>' . $epo['value'] );
211+
}
212+
}
213+
}
214+
205215
if ( version_compare( get_option( 'woocommerce_version' ), '3.0.0', '>=' ) ) {
206216
if ( isset( $item['variation_id'] ) && 0 !== $item['variation_id'] ) {
207217
$variation = wc_get_product( $item['product_id'] );

0 commit comments

Comments
 (0)