Eeco_WCO_cart
in package
Table of Contents
- $coupon : mixed
- $coupon_code : mixed
- __construct() : mixed
- add_assets() : void
- add assets for the cart
- add_cart_form() : void
- Add a contact form to cart page
- apply_coupon() : array<string|int, mixed>
- apply gift card discount if it exists
- apply_coupon_calculation() : array<string|int, mixed>
- re add gift card when calculating totals
- checkout_processed() : mixed
- Check if coupon used in cart, if used set offer inactive/used
- custom_price_to_cart_item() : mixed
- Custom price for cart item if needed
- is_valid_cart() : bool
- Validate cart contents
- removed_from_cart_title() : string
- Change notice after deletion failed
- wco_check_cart_items() : mixed
- Check if cart items correct
- wco_check_cart_items_remove() : mixed
- Cancel cart removal if item part of the cart offer
Properties
$coupon
private
mixed
$coupon
$coupon_code
private
mixed
$coupon_code
Methods
__construct()
public
__construct() : mixed
Return values
mixed —add_assets()
add assets for the cart
public
add_assets() : void
Return values
void —add_cart_form()
Add a contact form to cart page
public
add_cart_form() : void
Return values
void —apply_coupon()
apply gift card discount if it exists
public
apply_coupon(array<string|int, mixed> $coupon_data, string $coupon_code[, bool $calc_taxes = true ]) : array<string|int, mixed>
Parameters
- $coupon_data : array<string|int, mixed>
-
Coupon data
- $coupon_code : string
-
Code of the coupon
- $calc_taxes : bool = true
-
Whether to calculate taxes or not
Return values
array<string|int, mixed> —Coupon data
apply_coupon_calculation()
re add gift card when calculating totals
public
apply_coupon_calculation(array<string|int, mixed> $coupon, string $coupon_code) : array<string|int, mixed>
Parameters
- $coupon : array<string|int, mixed>
-
the coupon
- $coupon_code : string
-
the coupon code
Return values
array<string|int, mixed> —The coupon
checkout_processed()
Check if coupon used in cart, if used set offer inactive/used
public
checkout_processed(mixed $order_id, mixed $posted_data, mixed $order) : mixed
Parameters
- $order_id : mixed
- $posted_data : mixed
- $order : mixed
Return values
mixed —custom_price_to_cart_item()
Custom price for cart item if needed
public
custom_price_to_cart_item(object $cart_object) : mixed
Parameters
- $cart_object : object
-
WooCommerce cart object
Return values
mixed —is_valid_cart()
Validate cart contents
public
is_valid_cart() : bool
Return values
bool —Whether cart is valid
removed_from_cart_title()
Change notice after deletion failed
public
removed_from_cart_title() : string
Return values
string —Notice
wco_check_cart_items()
Check if cart items correct
public
wco_check_cart_items(int $cart_item_key, int $quantity, mixed $old_quantity, mixed $cart) : mixed
Parameters
- $cart_item_key : int
-
key of cart item
- $quantity : int
-
quantity of cart item in cart
- $old_quantity : mixed
- $cart : mixed
Return values
mixed —wco_check_cart_items_remove()
Cancel cart removal if item part of the cart offer
public
wco_check_cart_items_remove(int $cart_item_key, mixed $cart) : mixed
Parameters
- $cart_item_key : int
-
key of WooCommerce cart item
- $cart : mixed