WC_Cart::get_cart_item()
Returns a specific item in the cart.
Метод класса: WC_Cart{}
Хуков нет.
Возвращает
Массив
. Item data
Использование
$WC_Cart = new WC_Cart(); $WC_Cart->get_cart_item( $item_key );
- $item_key(строка) (обязательный)
- Cart item key.
Код WC_Cart::get_cart_item() WC Cart::get cart item WC 8.7.0
public function get_cart_item( $item_key ) { return isset( $this->cart_contents[ $item_key ] ) ? $this->cart_contents[ $item_key ] : array(); }