関数
CartPage::filterCartRow( string $row, array $cart, array $args )
preg_replace
s cart number td in cart table with a checkbox for batch operations
説明 説明
Since WCEX Mobile does not specify class="num"
on the number td, we just assume that the first td in the row is the one we want to replace.
- $row
(文字列) (必須)
- $cart
(配列) (必須)
- $args
(配列) (必須)
ファイル: src/Views/CartPage/CartPage.php
public function filterCartRow($row, $cart, $args) { $pattern = '/(<td\s+class="num">).*(<\/td>)/'; if (self::isMobileTheme()) { $pattern = '/(<td.*>).*(<\/td>)/'; } $replacement = preg_replace( $pattern, '${1}' . self::getCartRowCheckbox($args['cart_row']['serial']) . '${2}', $row, 1 ); return $replacement === null ? $row : $replacement; }