Item_Data implements Registerable, Standard_Service

Handles adding and displaying the product options item data.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Registerable
Standard_Service

Table of Contents

add_cart_item_data()  : array<string|int, mixed>
Add product options data to item inside the cart.
add_order_item_data()  : void
Add product options data to order item.
display_cart_item_data()  : array<string|int, mixed>
Display product options data in the cart and checkout.
order_again_cart_item_data()  : array<string|int, mixed>
Add product options data to cart item when ordering again.
register()  : mixed
Register hooks and filters.
format_item_data()  : string
Format the item data for display in cart/checkout/order.

Methods

add_cart_item_data()

Add product options data to item inside the cart.

public add_cart_item_data(array<string|int, mixed> $cart_item_data, int $product_id, int $variation_id, int $quantity) : array<string|int, mixed>
Parameters
$cart_item_data : array<string|int, mixed>
$product_id : int
$variation_id : int
$quantity : int
Tags
Return values
array<string|int, mixed>

add_order_item_data()

Add product options data to order item.

public add_order_item_data(WC_Order_Item_Product $item, string $cart_item_key, array<string|int, mixed> $cart_item, WC_Order $order) : void
Parameters
$item : WC_Order_Item_Product
$cart_item_key : string
$cart_item : array<string|int, mixed>
$order : WC_Order
Tags
Return values
void

display_cart_item_data()

Display product options data in the cart and checkout.

public display_cart_item_data(array<string|int, mixed> $item_data, array<string|int, mixed> $cart_item) : array<string|int, mixed>
Parameters
$item_data : array<string|int, mixed>
$cart_item : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

order_again_cart_item_data()

Add product options data to cart item when ordering again.

public order_again_cart_item_data(array<string|int, mixed> $cart_item_data, WC_Order_Item_Product $item, WC_Order $order) : array<string|int, mixed>
Parameters
$cart_item_data : array<string|int, mixed>
$item : WC_Order_Item_Product
$order : WC_Order
Tags
Return values
array<string|int, mixed>

$cart_item_data

register()

Register hooks and filters.

public register() : mixed
Tags
Return values
mixed

format_item_data()

Format the item data for display in cart/checkout/order.

private format_item_data(array<string|int, mixed> $choice_data, WC_Product $product, int $quantity, array<string|int, mixed> $cart_item) : string
Parameters
$choice_data : array<string|int, mixed>
$product : WC_Product
$quantity : int
$cart_item : array<string|int, mixed>
Tags
Return values
string

Search results