Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Adding invoice ID from German market plugin to WooCommerce-POS Pro #218

Open
atxcowboy opened this issue Aug 28, 2019 · 1 comment
Open

Comments

@atxcowboy
Copy link

atxcowboy commented Aug 28, 2019

I'm required to fetch the invoice number metadata from the German marketplace plugin (based on the order_number value and add it to the template temple-receipt.php

In the template I see:

<tr>
    <th><?php /* translators: woocommerce */ _e( 'Order Number', 'woocommerce' ); ?></th>
    <td>{{order_number}}</td>
  </tr>

How can I get the {{order_number}} in the template into a php variable?
I can get my desired result with this php code:

$order_number = 281; 
get_metadata( 'post', $order_number, '_wp_wc_running_invoice_number', true );

How can I store the {order_number}} as a php variable to be used in the template or better yet, is there a more elegant way to show this data?

@kilbot
Copy link
Owner

kilbot commented Sep 11, 2019

Hi @atxcowboy, sorry for the late reply.

Please see the following Gist for an example of how you can customise the order_number: https://gist.github.com/kilbot/c9851f24b94c86c24d5ba7f26876a52c

Note: you will have to adjust the function to suit your needs but it should get you started. Also note that orders are cached locally so you should clear the local data if you make changes to the order data.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants