Can’t get “shipping_state” custom field
-
Hello and thanks for the fantastic plugin. I’m using a custom invoice template and all is working fine except the “shipping_state”. I’m using a customized state list and it works fine throughout the site. However, when I want to display it as a custom field in the template with the following code, it shows up blank. I checked the order page and it shows up as a custom field with “shipping_state” just fine. I can succesfully call all other custom fields with the following code but only this won’t work. Any idea why that might be? Thanks in advance.
add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_delivery_date', 10, 2 ); function wpo_wcpdf_delivery_date ($template_type, $order) { if ($template_type == 'invoice') { $document = wcpdf_get_document( $template_type, $order ); ?> <tr class="delivery-date"> <th>Shipping State:</th> <td><?php $document->custom_field('shipping_state'); ?></td> </tr> <?php } }
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Can’t get “shipping_state” custom field’ is closed to new replies.