I found this manual page but I'm still not sure what to use. I have this array:
Array (
[unique_key] => 7439db65fe2856a636e3c6d9841b51ed
[thwepof_options] => Array (
[order_date] => Array (
[name] => order_date
[value] => 29-01-2018, monday
[label] => Order date [options] => ) )
So first I just foreach every [thwepof_options] => value
, sorted and made them unique (because I need that once):
<?php foreach (WC()->cart->get_cart() as $order_dates => $order_date): ?>
<?php $options = $order_date['thwepof_options']; ?>
<?php foreach($options as $option => $dates): ?>
<?php array_push($myarray, $dates['value']) ?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php sort($myarray); ?>
<?php $unique = array_unique($myarray); ?>
//later in that code
<?php foreach($unique as $dates => $date_value): ?>
<tr>
<h1><?php echo $date_value ?></h1></td>
</tr>
<?php endforeach; ?>
With WC()->cart->get_cart()
method I can get the whole array. I need some kind of filter which removes every value from that array where $date_value
isn't equal with the [thwepof_options] => [value]
(or show only those where is equal) to make an another foreach
loop.