Product_Cart extends Abstract_Product_Data

Gets data for the add to cart column.

Tags
author

Barn2 Plugins [email protected]

license

GPL-3.0

copyright

Barn2 Media Ltd

Table of Contents

MULTI_CART_FORM_ID  = 'multi-cart'
$links  : mixed
$parent_product  : mixed
$product  : mixed
$cart_button  : mixed
$default_quantity  : mixed
$multi_cart  : mixed
$quantities  : mixed
$variations  : mixed
__construct()  : mixed
get_data()  : mixed
get_filter_data()  : mixed
get_sort_data()  : mixed
ignore_posted_quantity()  : array<string|int, mixed>
WooCommerce sets the quantity input_value based on the posted quantity (@see woocommerce/templates/single-product/add-to-cart/simple.php), and if not set, uses get_min_purchase_quantity. When ajax_cart is disabled, we don't want to show the posted quantity as this means all products in the table show the quantity for the previous product added to the cart. This filter runs early so any quantity plugins running can update as needed.
store_product_default_quantity()  : array<string|int, mixed>
Store the default quantity for this product based on the input value set in woocommerce_quantity_input.
format_term_data()  : mixed
get_parent_product()  : mixed
get_parent_product_id()  : mixed
get_product_attribute()  : mixed
get_product_id()  : mixed
get_product_taxonomy_terms()  : mixed
get_separator()  : mixed
maybe_strip_shortcodes()  : mixed
add_multi_cart_hidden_fields()  : mixed
get_add_to_cart_class()  : mixed

Constants

MULTI_CART_FORM_ID

public mixed MULTI_CART_FORM_ID = 'multi-cart'

Properties

Methods

__construct()

public __construct(mixed $product[, mixed $variations = false ][, mixed $quantities = false ][, mixed $cart_button = 'button' ][, mixed $multi_cart = false ]) : mixed
Parameters
$product : mixed
$variations : mixed = false
$quantities : mixed = false
$cart_button : mixed = 'button'
$multi_cart : mixed = false
Return values
mixed

get_data()

public get_data() : mixed
Return values
mixed

ignore_posted_quantity()

WooCommerce sets the quantity input_value based on the posted quantity (@see woocommerce/templates/single-product/add-to-cart/simple.php), and if not set, uses get_min_purchase_quantity. When ajax_cart is disabled, we don't want to show the posted quantity as this means all products in the table show the quantity for the previous product added to the cart. This filter runs early so any quantity plugins running can update as needed.

public ignore_posted_quantity(array<string|int, mixed> $quantity_args, WC_Product $product) : array<string|int, mixed>
Parameters
$quantity_args : array<string|int, mixed>
$product : WC_Product
Return values
array<string|int, mixed>

store_product_default_quantity()

Store the default quantity for this product based on the input value set in woocommerce_quantity_input.

public store_product_default_quantity(array<string|int, mixed> $quantity_args, WC_Product $product) : array<string|int, mixed>
Parameters
$quantity_args : array<string|int, mixed>
$product : WC_Product
Return values
array<string|int, mixed>

format_term_data()

protected static format_term_data(WP_Term $term[, mixed $show_links = false ][, mixed $column = null ]) : mixed
Parameters
$term : WP_Term
$show_links : mixed = false
$column : mixed = null
Return values
mixed

get_product_attribute()

protected static get_product_attribute(mixed $attribute, mixed $attributes) : mixed
Parameters
$attribute : mixed
$attributes : mixed
Return values
mixed

get_product_taxonomy_terms()

protected get_product_taxonomy_terms(mixed $column) : mixed
Parameters
$column : mixed
Return values
mixed

get_separator()

protected static get_separator(mixed $item_type) : mixed
Parameters
$item_type : mixed
Return values
mixed

maybe_strip_shortcodes()

protected static maybe_strip_shortcodes(mixed $text[, mixed $process_shortcodes = false ]) : mixed
Parameters
$text : mixed
$process_shortcodes : mixed = false
Return values
mixed

add_multi_cart_hidden_fields()

private add_multi_cart_hidden_fields() : mixed
Return values
mixed

get_add_to_cart_class()

private get_add_to_cart_class([mixed $purchasable = true ]) : mixed
Parameters
$purchasable : mixed = true
Return values
mixed

Search results