File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
woocommerce-delivery-notes/templates/print-order Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 140140
141141 <?php
142142
143+ $ product_id = $ item ['product_id ' ];
144+ $ product_addons = WC_Product_Addons_Helper::get_product_addons ( $ product_id );
143145 if ( version_compare ( get_option ( 'woocommerce_version ' ), '3.0.0 ' , '>= ' ) ) {
144146 if ( isset ( $ item ['variation_id ' ] ) && 0 !== $ item ['variation_id ' ] ) {
145147 $ variation = wc_get_product ( $ item ['product_id ' ] );
150152 }
151153 $ term_wp = get_term_by ( 'slug ' , $ value , $ key );
152154 $ attribute_name = wc_attribute_label ( $ key , $ variation );
155+ foreach ( $ product_addons as $ addon ) {
156+ if ( 'file_upload ' === $ addon ['type ' ] ) {
157+ if ( $ key === $ addon ['name ' ] ) {
158+ $ value = wp_basename ( $ value );
159+ }
160+ }
161+ }
153162 if ( isset ( $ term_wp ->name ) ) {
154163 echo '<br> ' . wp_kses_post ( $ attribute_name . ': ' . $ term_wp ->name );
155164 } else {
163172 if ( is_array ( $ value ) ) {
164173 continue ;
165174 }
175+ foreach ( $ product_addons as $ addon ) {
176+ if ( 'file_upload ' === $ addon ['type ' ] ) {
177+ if ( $ key === $ addon ['name ' ] ) {
178+ $ value = wp_basename ( $ value );
179+ }
180+ }
181+ }
166182 echo '<br> ' . wp_kses_post ( $ key . ': ' . $ value );
167183 }
168184 }
You can’t perform that action at this time.
0 commit comments