jboucher1
Forum Replies Created
-
The fix didn’t end up working. This is what we ended up doing to fix our issue.
File: table-customer-list.php
Line: 328Replace with this:
<?php
/* Code JF wrote to fix variation issue */
$item = $order->get_item($sale->order_item_id);
if($item) {
foreach($item->get_formatted_meta_data() as $itemvariation)
{
print($itemvariation->display_value.’ ‘);
}
} ?>
<?php//ORIGINAL CODE BELOW
/*if($variation) {
echo $variation->get_formatted_variation_attributes(true);} else {
_e(‘Variation no longer exists’, ‘wc-product-customer-list’);
}*/ ?>- This reply was modified 7 years, 6 months ago by jboucher1.
Our fix isn’t the most elegant. But the get_formatted_variation_attributes would always return an array with empty strings and we knew that the variations were valid since they were appearing in the orders.
So we decided to go straight to the order metadata and display the value from there instead.
I’m not sure whether this was just a “us” problem but I can send you the code we wrote and you can decide whether you want to change it or keep it working the way it currently works.
We found a fix, we needed to use get_formatted_meta_data() on the metadata of the order instead of using get_formatted_variation_attributes(true);
Saved you the trouble of installing a staging site ??
Other than that good plugin my friend!
@kokomo, If it is possible to solve the issue without sending over a zip file that would be ideal. I have some programming experience and might be able to debug the issue with some of your guidance. So far I am trying to see what is currently stored inside of $variation from the table-customer-list.php file. and I tried printing out the array of attributes but this is what I am getting as a result:
Array ( [attribute_pa_meatoptions] => )
When I use the function get_formatted_variation_atributes(true); it returns empty.
Any thoughts?