Product Type – Sample Price strings are being added to all order emails
-
Hi,
The strings are being added to all products even if they’re not samples, please check the following example:
Can you please provide with a fix for this error?
I’m using the string replace snippet as you provided it:
/* This filter tells the plugin FREE SAMPLES you want to replace PRODUCT_TYPE and SAMPLE_PRICE with something else. */ add_filter( 'wfps_custom_order_meta', __return_true() ); /** * This action will actually output whatever you want in place of the * existing PRODUCT_TYPE and SAMPLE_PRICE lines. * In the example below, I've changed the following: * PRODUCT_TYPE -> Product type * SAMPLE_PRICE -> Sample price * To add your own custom information enter the following: * wc_add_order_item_meta( $itemID, 'Heading text', 'Value text shown after the colon' ); */ add_action( 'wfps_custom_order_meta_action', 'fps_custom_meta_action', 10, 2 ); function fps_custom_meta_action( $itemID, $values ) { $sample = __( 'Sample', 'woo-free-product-sample' ); wc_add_order_item_meta( $itemID, 'Product Type', $sample ); wc_add_order_item_meta( $itemID, 'Sample Price', (float)$values["sample_price"] ); }
Thank you!
Best regards,
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Product Type – Sample Price strings are being added to all order emails’ is closed to new replies.