関数
Cart::getComboSetCartDetailsHtml( array $rows )
パラメータ パラメータ
- $rows
(配列) (必須) group items cart
ファイル: src/Components/Cart/Cart.php
public static function getComboSetCartDetailsHtml($rows) { $groupshtml = '<div class="wcexics combo-set-cart">'; foreach ($rows as $row) { $gitemhtml = ''; foreach ($row['groupItems'] as $item) { $hookargs = [ 'item' => $item, 'row' => $row, 'rows' => $rows, ]; $gitemhtml .= '<li>'; $gitemhtml .= apply_filters( 'wcexics_filter_cart_details_html_item_name', '<div>' . $item['name'] . '</div>', $hookargs ); $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 .= esc_html($key) . ' : '; foreach ($value as $v) { $optstr .= $c . nl2br(esc_html(urldecode($v))); $c = ', '; } $optstr .= "<br />\n"; } else { $optstr .= esc_html($key) . ' : ' . nl2br(esc_html(urldecode($value))) . "<br />\n"; } } } if (!empty($optstr)) { $gitemhtml .= '<div class="combo-set-cart-group-item-options">'; $gitemhtml .= '<div class="combo-set-cart-group-item-options__label">'; $gitemhtml .= '(' . __('options for items', 'usces') . ')'; $gitemhtml .= '</div>'; $gitemhtml .= '<div class="combo-set-cart-group-item-options__values">'; $gitemhtml .= $optstr; $gitemhtml .= '</div>'; $gitemhtml .= '</div>'; } } $gitemhtml .= '</li>'; } $groupshtml .= '<div class="combo-set-cart__group-label">' . $row['groupLabel'] . '</div>'; $groupshtml .= '<div class="combo-set-cart__group-item"><ul>' . $gitemhtml . '</ul></div>'; } $groupshtml .= '</div>'; return $groupshtml; }