Output a product custom field in WooCommerce Order Admin Page (ACF)Show ACF field value on edit order page WooCommerceHow to edit woocommerce admin order page?Add columns to admin orders list in WooCommerce backendAdd Advanced Custom Fields to WooCommerce Product VariationWooCommerce : Add custom Metabox to admin order pageWooCommerce - Hide shipping address when local pickup is chosen on thankyou pageCustomizing order completed email notification: Displaying product custom fieldHow to Add Advanced Custom Fields to a Product VariationUnable to edit ACF field on WooCommerce product categoryDisplay Products Shipping Classes in WooCommerce order edit pageWooCommerce: Custom Template for Grouped / Bundled Products
2.8 Why are collections grayed out? How can I open them?
New brakes for 90s road bike
Store Credit Card Information in Password Manager?
Lowest total scrabble score
How much character growth crosses the line into breaking the character
Why Shazam when there is already Superman?
Pre-mixing cryogenic fuels and using only one fuel tank
Not using 's' for he/she/it
Open a doc from terminal, but not by its name
Creepy dinosaur pc game identification
Symbol used to indicate indivisibility
Is it safe to use olive oil to clean the ear wax?
If infinitesimal transformations commute why dont the generators of the Lorentz group commute?
What does chmod -u do?
Is it possible to have a strip of cold climate in the middle of a planet?
Does Doodling or Improvising on the Piano Have Any Benefits?
How to explain what's wrong with this application of the chain rule?
Travelling outside the UK without a passport
Did arcade monitors have same pixel aspect ratio as TV sets?
What percentage of fillings performed today are done with mercury amalgam?
Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?
How did Rebekah know that Esau was planning to kill his brother in Genesis 27:42?
Is there a RAID 0 Equivalent for RAM?
Removing files under particular conditions (number of files, file age)
Output a product custom field in WooCommerce Order Admin Page (ACF)
Show ACF field value on edit order page WooCommerceHow to edit woocommerce admin order page?Add columns to admin orders list in WooCommerce backendAdd Advanced Custom Fields to WooCommerce Product VariationWooCommerce : Add custom Metabox to admin order pageWooCommerce - Hide shipping address when local pickup is chosen on thankyou pageCustomizing order completed email notification: Displaying product custom fieldHow to Add Advanced Custom Fields to a Product VariationUnable to edit ACF field on WooCommerce product categoryDisplay Products Shipping Classes in WooCommerce order edit pageWooCommerce: Custom Template for Grouped / Bundled Products
With WooCommerce, I'm using the Advanced Custom Fields plugin to keep a track of where I physically store each product.
When an order comes in, I want to be able to look at the admin edit order page and see where the items are stored. So I can grab it to ship.
Here's a picture of what I want to see:

Hopefully, it makes sense.
I just want to recall the individual product ACF variable (BinLocation) for each product on the Edit Order Admin Page for Wordpress. Any help on this?
Thanks.
php wordpress woocommerce advanced-custom-fields orders
add a comment |
With WooCommerce, I'm using the Advanced Custom Fields plugin to keep a track of where I physically store each product.
When an order comes in, I want to be able to look at the admin edit order page and see where the items are stored. So I can grab it to ship.
Here's a picture of what I want to see:

Hopefully, it makes sense.
I just want to recall the individual product ACF variable (BinLocation) for each product on the Edit Order Admin Page for Wordpress. Any help on this?
Thanks.
php wordpress woocommerce advanced-custom-fields orders
add a comment |
With WooCommerce, I'm using the Advanced Custom Fields plugin to keep a track of where I physically store each product.
When an order comes in, I want to be able to look at the admin edit order page and see where the items are stored. So I can grab it to ship.
Here's a picture of what I want to see:

Hopefully, it makes sense.
I just want to recall the individual product ACF variable (BinLocation) for each product on the Edit Order Admin Page for Wordpress. Any help on this?
Thanks.
php wordpress woocommerce advanced-custom-fields orders
With WooCommerce, I'm using the Advanced Custom Fields plugin to keep a track of where I physically store each product.
When an order comes in, I want to be able to look at the admin edit order page and see where the items are stored. So I can grab it to ship.
Here's a picture of what I want to see:

Hopefully, it makes sense.
I just want to recall the individual product ACF variable (BinLocation) for each product on the Edit Order Admin Page for Wordpress. Any help on this?
Thanks.
php wordpress woocommerce advanced-custom-fields orders
php wordpress woocommerce advanced-custom-fields orders
edited Aug 12 '17 at 18:36
LoicTheAztec
94.3k1368108
94.3k1368108
asked Jul 9 '17 at 21:52
ChristianChristian
84
84
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Updated: Using a custom function hoocked in woocommerce_before_order_itemmeta action hook, you will be able to achieve what you are looking for:
add_action( 'woocommerce_before_order_itemmeta', 'storage_location_of_order_items', 10, 3 );
function storage_location_of_order_items( $item_id, $item, $product )
// Only on backend order edit pages
if( ! ( is_admin() && $item->is_type('line_item') ) ) return;
// Get your ACF product value (replace the slug by yours below)
if( $acf_value = get_field( 'BinLocation', $product->get_id() ) )
$acf_label = __('Stored in: ');
// Outputing the value of the "location storage" for this product item
echo '<div class="wc-order-item-custom"><strong>' . $acf_value . $acf_label . '</strong></div>';
Code goes in any php file of your active child theme (or theme) or also in any plugin php file.
This code is tested and works in WooCommerce version 3 and up…
Exactly what I was looking for, thank you so much!
– Christian
Jul 11 '17 at 4:30
Hello , in wc 3.5 this doesnt seem to work , it displays the field but then stops rendering the rest of the order info , shipping and totals ? any ideas ?
– John Athanasiou
Jan 12 at 9:16
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45001375%2foutput-a-product-custom-field-in-woocommerce-order-admin-page-acf%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Updated: Using a custom function hoocked in woocommerce_before_order_itemmeta action hook, you will be able to achieve what you are looking for:
add_action( 'woocommerce_before_order_itemmeta', 'storage_location_of_order_items', 10, 3 );
function storage_location_of_order_items( $item_id, $item, $product )
// Only on backend order edit pages
if( ! ( is_admin() && $item->is_type('line_item') ) ) return;
// Get your ACF product value (replace the slug by yours below)
if( $acf_value = get_field( 'BinLocation', $product->get_id() ) )
$acf_label = __('Stored in: ');
// Outputing the value of the "location storage" for this product item
echo '<div class="wc-order-item-custom"><strong>' . $acf_value . $acf_label . '</strong></div>';
Code goes in any php file of your active child theme (or theme) or also in any plugin php file.
This code is tested and works in WooCommerce version 3 and up…
Exactly what I was looking for, thank you so much!
– Christian
Jul 11 '17 at 4:30
Hello , in wc 3.5 this doesnt seem to work , it displays the field but then stops rendering the rest of the order info , shipping and totals ? any ideas ?
– John Athanasiou
Jan 12 at 9:16
add a comment |
Updated: Using a custom function hoocked in woocommerce_before_order_itemmeta action hook, you will be able to achieve what you are looking for:
add_action( 'woocommerce_before_order_itemmeta', 'storage_location_of_order_items', 10, 3 );
function storage_location_of_order_items( $item_id, $item, $product )
// Only on backend order edit pages
if( ! ( is_admin() && $item->is_type('line_item') ) ) return;
// Get your ACF product value (replace the slug by yours below)
if( $acf_value = get_field( 'BinLocation', $product->get_id() ) )
$acf_label = __('Stored in: ');
// Outputing the value of the "location storage" for this product item
echo '<div class="wc-order-item-custom"><strong>' . $acf_value . $acf_label . '</strong></div>';
Code goes in any php file of your active child theme (or theme) or also in any plugin php file.
This code is tested and works in WooCommerce version 3 and up…
Exactly what I was looking for, thank you so much!
– Christian
Jul 11 '17 at 4:30
Hello , in wc 3.5 this doesnt seem to work , it displays the field but then stops rendering the rest of the order info , shipping and totals ? any ideas ?
– John Athanasiou
Jan 12 at 9:16
add a comment |
Updated: Using a custom function hoocked in woocommerce_before_order_itemmeta action hook, you will be able to achieve what you are looking for:
add_action( 'woocommerce_before_order_itemmeta', 'storage_location_of_order_items', 10, 3 );
function storage_location_of_order_items( $item_id, $item, $product )
// Only on backend order edit pages
if( ! ( is_admin() && $item->is_type('line_item') ) ) return;
// Get your ACF product value (replace the slug by yours below)
if( $acf_value = get_field( 'BinLocation', $product->get_id() ) )
$acf_label = __('Stored in: ');
// Outputing the value of the "location storage" for this product item
echo '<div class="wc-order-item-custom"><strong>' . $acf_value . $acf_label . '</strong></div>';
Code goes in any php file of your active child theme (or theme) or also in any plugin php file.
This code is tested and works in WooCommerce version 3 and up…
Updated: Using a custom function hoocked in woocommerce_before_order_itemmeta action hook, you will be able to achieve what you are looking for:
add_action( 'woocommerce_before_order_itemmeta', 'storage_location_of_order_items', 10, 3 );
function storage_location_of_order_items( $item_id, $item, $product )
// Only on backend order edit pages
if( ! ( is_admin() && $item->is_type('line_item') ) ) return;
// Get your ACF product value (replace the slug by yours below)
if( $acf_value = get_field( 'BinLocation', $product->get_id() ) )
$acf_label = __('Stored in: ');
// Outputing the value of the "location storage" for this product item
echo '<div class="wc-order-item-custom"><strong>' . $acf_value . $acf_label . '</strong></div>';
Code goes in any php file of your active child theme (or theme) or also in any plugin php file.
This code is tested and works in WooCommerce version 3 and up…
edited Jan 14 at 17:11
answered Jul 10 '17 at 2:49
LoicTheAztecLoicTheAztec
94.3k1368108
94.3k1368108
Exactly what I was looking for, thank you so much!
– Christian
Jul 11 '17 at 4:30
Hello , in wc 3.5 this doesnt seem to work , it displays the field but then stops rendering the rest of the order info , shipping and totals ? any ideas ?
– John Athanasiou
Jan 12 at 9:16
add a comment |
Exactly what I was looking for, thank you so much!
– Christian
Jul 11 '17 at 4:30
Hello , in wc 3.5 this doesnt seem to work , it displays the field but then stops rendering the rest of the order info , shipping and totals ? any ideas ?
– John Athanasiou
Jan 12 at 9:16
Exactly what I was looking for, thank you so much!
– Christian
Jul 11 '17 at 4:30
Exactly what I was looking for, thank you so much!
– Christian
Jul 11 '17 at 4:30
Hello , in wc 3.5 this doesnt seem to work , it displays the field but then stops rendering the rest of the order info , shipping and totals ? any ideas ?
– John Athanasiou
Jan 12 at 9:16
Hello , in wc 3.5 this doesnt seem to work , it displays the field but then stops rendering the rest of the order info , shipping and totals ? any ideas ?
– John Athanasiou
Jan 12 at 9:16
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45001375%2foutput-a-product-custom-field-in-woocommerce-order-admin-page-acf%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown