\Barn2\Plugin\WC_Default_QuantityQuantity_Manager

Responsible for getting the default quantity for a product and modifying it in the shop.

Summary

Methods
Properties
Constants
register()
change_default_quantity()
get_default_quantity()
check_meta_value()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

register()

register()

change_default_quantity()

change_default_quantity(array  $args,\WC_Product  $product): mixed

Main function for filter WooCommerce qty field and add default qty

Parameters

array $args

The quantity input args.

\WC_Product $product

The product to set the quantity for.

Returns

mixed

get_default_quantity()

get_default_quantity(  $product_id): boolean|integer

Get default quantity for product depends on settings, category or product meta.

Parameters

$product_id

The product ID.

Returns

boolean|integer

check_meta_value()

check_meta_value(mixed  $value): boolean

Check if value contains default qty

Parameters

mixed $value

Returns

boolean