php - WooCommerce Loop through product's custom post_meta
Get the solution ↓↓↓So basically I am trying to loop through custom post meta, that I added to the CSV Import Excel File via Custom Header Reference ( e.g meta:Temperatur ). When I output all of the post_meta I see that my added custom meta is added successfully:
$postMeta = get_post_meta($productID);
var_dump( $postMeta);
This outputs the post meta like this:
As you see, in line 6 there is my key 'temperatur' that I added.
I tried different variations (see in loop) , and I output the product ID so that I see if i have the right product selected. Still I can't loop through it with the following code:
global $product;
$productID = $product->get_id();
echo '<h2>' . $tab['title'] . '</h2>';
echo $productID;
$attributes = array('Temperatur' , 'Kaeltemittel' , 'Innenfarbe');
foreach ($attributes as $key){
echo get_post_meta( $product->get_id() , 'Temperatur' , true);
echo get_post_meta( $productID , $key , true);
}
How can I get my custom post_meta that I added via CSV Importer Excel
Any help is appreciated!
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: fastcgi sent in stderr: "primary script unknown" while reading response header from upstream
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.