• Resolved notion9

    (@notion9)


    I’m trying to define the values of a gift plugin i’m using on my client’s website in the order_handler.php file. These are the defined values. How do I print these values? Thanks for all your help in advance.

    $gift_amount = get_post_meta($order_id, ‘pw_gift_card_amount’, true);
    $gift_to = get_post_meta($order_id, ‘pw_gift_card_to’, true);
    $gift_from = get_post_meta($order_id, ‘pw_gift_card_from’, true);
    $gift_message = get_post_meta($order_id, ‘pw_gift_card_message’, true);

    Right now it’s printing like this:

    pw_gift_card_amount: $100
    pw_gift_card_to: [email protected]
    pw_gift_card_from: [email protected]
    pw_gift_card_message: Test Message

    This is how it shows up on the email confirmation:

    Gift Card – $100
    ?Amount: 100
    ?To: [email protected]
    ?From: [email protected]
    ?Message:test
    ?Gift Card: XXXX-XXXX-XXXX-XXXX

    • This topic was modified 4 years, 1 month ago by notion9.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @notion9

    The email is provided data in html format, which can not be printed directly. Therefore we have to write code to read the order metadata and re-render that with printer commands before it can be printed.
    You may want to try this version of the plugin, and check the modification instructions which allow you to choose which additional fields are printed, and also to reformat them: https://vault.star-emea.com/s/E8yTWJGWLBJck7q.

    Thread Starter notion9

    (@notion9)

    Hey @lawrenceowen,

    Quick question. I’m currently using the 1.2.0 Beta version of the plugin. The link you shared above is a newer version that that? Just curious.

    Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @notion9 It has some small updates, in particular to fix issues with the order time formatting and timezone. But really is was made specifically for a a customer with basically the same request as yours.

    Thread Starter notion9

    (@notion9)

    @lawrenceowen,

    I tried your updated plugin with the udpates:
    // List of meta data item keys to print and formatted output
    $fields = array(
    “pw_gift_card_amount” => “Amount: [value]”,
    “pw_gift_card_to” => “To: [value]”,
    “pw_gift_card_from” => “From: [value]”,
    “pw_gift_card_message” => “Message: [value]”
    );

    Turned on Print additional order meta-data, such as custom fields.

    Still prints as “pw_gift_card_amount” and not “Amount”

    Can you let me know what I can do?

    Thread Starter notion9

    (@notion9)

    This is a response I received from the other plugin developers.

    We use the following WooCommerce hook to translate the attribute keys to their corresponding values:

    woocommerce_attribute_label

    It sounds like you are using a plugin for your thermal printer that isn’t calling that hook.

    Contact the developer for that other plugin and see if they can either call that hook or provide you with the hook they are using. If possible, we will hook into that to get these labels to print correctly.

    Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @notion9 thanks. I’ll look into this.

    Thread Starter notion9

    (@notion9)

    @lawrenceowen,

    Any updates on this? I don’t think the list of meta data update works. I even purchased another printer to do more testing. I may get more clients and would like to push this more. however, i need to iron out some of the possible issues with the plugin. Can you please let me know how to display these items?

    Thanks!!

    Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @notion9 It is slow progress sorry. In the mean-time, please use this form to exchange email addresses with me directly. I’d like to offer an alternative integration method that I think will suit your needs better.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Custom Fields – Print’ is closed to new replies.