関数
Cart::getComboSetCartDetailsNoHtml( array $rows, bool $add_dashes = true )
パラメータ パラメータ
- $rows
(配列) (必須)
- $add_dashes
(bool) (任意)
ファイル: src/Components/Cart/Cart.php
public static function getComboSetCartDetailsNoHtml($rows, $add_dashes = true) { $details = ''; foreach ($rows as $row) { $rowdetails = ''; foreach ($row['groupItems'] as $item) { $ddash = $add_dashes ? '--' : ''; $tdash = $add_dashes ? '---' : ''; $rowdetails .= "{$ddash}" . wp_strip_all_tags($item['name']); $options = $item['options']; if (is_array($options) && count($options) > 0) { $optstr = ''; foreach ($options as $key => $value) { if (!empty($key)) { $key = urldecode($key); if (is_array($value)) { $c = ''; $optstr .= "\r\n\t\t{$tdash} " . esc_html($key) . ' : '; foreach ($value as $v) { $optstr .= $c . nl2br(esc_html(urldecode($v))); $c = ', '; } } else { $optstr .= "\r\n\t\t{$tdash} " . esc_html($key) . ' : ' . nl2br(esc_html(urldecode($value))); } } } if (!empty($optstr)) { $rowdetails .= "\r\n\t\t{$tdash} (" . __('options for items', 'usces') . ')'; $rowdetails .= $optstr; } } } $details .= "\r\n" . $row['groupLabel']; $details .= ' : '; $details .= $rowdetails; } return $details; }