Authentication & Security
This category contains filters for managing authentication, security headers, CORS settings, and access permissions.cocart_allow_origin
Filter allows you to change the allowed HTTP origin result.
Made available since v2.5.1
Origin URL if allowed, empty string if not.
cocart_allow_origin
in repository
cocart_auth_header
Filter allows you to change the authorization header.
Made available since v4.1.0
Authorization header.
cocart_auth_header
in repository
cocart_disable_all_cors
Modifies if the “Cross Origin Headers” are allowed. Set as false to enable support.
Made available since v2.2.0
cocart_disable_all_cors
in repository
cocart_install_capability
Filter the current users capabilities to install a CoCart plugin.
Made available since v4.1.0
Capability level.
cocart_install_capability
in repository
cocart_login_extras
Filter allows you to add extra information based on the current user.
Made available since v3.8.1
The extra information.
The current user.
cocart_login_extras
in repository
cocart_send_nocache_headers
Send nocache headers on authenticated requests.
Made available since v4.2.0
Deprecated: 4.3.11 No longer used. See
cocart_send_cache_control_patterns
filter instead to control which routes are not cached.Whether to send no-cache headers.
cocart_send_nocache_headers
in repository
Cart Management & State
This category contains filters for managing cart state, expiration, merging, and overall cart behavior.cocart_cart_cleared_message
Filters message about the cart being cleared.
Made available since v2.1.0
Message.
cocart_cart_cleared_message
in repository
cocart_cart_contents
Filter allows additional data to be returned for a specific item in cart.
Made available since v2.0.0
Cart contents.
Item key.
Cart item.
The product object.
cocart_cart_contents
in repository
cocart_cart_expiration
Filter allows you to change the amount of time before the cart has expired. Default is (DAY_IN_SECONDS * 2)
= 2 Days - Previously 7 days.
Made available since v2.1.0
Expiration.
If user is logged in. @since v4.4.0
cocart_cart_expiration
in repository
cocart_cart_expiring
Filter allows you to change the amount of time before the cart starts to expire. Default is ```(DAY_IN_SECONDS * 6)“ = 6 Days
Made available since v2.1.0
cocart_cart_expiring
in repository
cocart_cart_items
Filter allows additional data to be returned for a specific item in cart.
Made available since v2.1.0
Array of items in the cart.
The item key currently looped.
The cart item data.
The product object.
cocart_cart_items
in repository
cocart_cart_source
Filter source of cart.
Made available since v3.0.0
cocart_cart_source
in repository
cocart_clear_cart_failed_message
Filters message about the cart failing to clear.
Made available since v2.1.0
Message.
cocart_clear_cart_failed_message
in repository
cocart_cross_sells
Filters the cross sell items.
Made available since v3.0.0
The request object.
cocart_cross_sells
in repository
cocart_empty_cart
Filter response for empty cart.
Made available since v3.0.0
cocart_empty_cart
in repository
cocart_filter_request_data
Filters additional requested data.
Made available since v3.0.0
cocart_filter_request_data
in repository
cocart_get_cart_item
Filters the cart item before it is returned.
Made available since v3.0.0
Details of the item in the cart if it exists.
Condition of item. Default: “add”, Option: “add”, “remove”, “restore”, “update”.
cocart_get_cart_item
in repository
cocart_merge_cart_content
Filter allows you to adjust the merged cart contents.
Made available since v2.1.0
cocart_merge_cart_content
in repository
cocart_return_cart_contents
Return cart content from session if set.
Made available since v2.1.0
cocart_return_cart_contents
in repository
cocart_return_cart_session_contents
Return cart content from session if set.
Made available since v2.1.0
cocart_return_cart_session_contents
in repository
cocart_return_empty_cart
Filter response for empty cart.
Made available since v2.0.8
cocart_return_empty_cart
in repository
Cart Items & Operations
This category contains filters for cart item data, operations like adding/removing items, and item-specific messages.cocart_can_not_remove_item_message
Filters message about can not remove item.
Made available since v2.1.0
Message.
cocart_can_not_remove_item_message
in repository
cocart_can_not_restore_item_message
Filters message about can not restore item.
Made available since v2.1.0
Message.
cocart_can_not_restore_item_message
in repository
cocart_cart_item_data
Filter allows you to alter the remaining cart item data.
Made available since v3.0.0
The cart item data.
Generated ID based on the product information when added to the cart.
cocart_cart_item_data
in repository
cocart_cart_item_key_required_message
Filters message about cart item key required.
Made available since v2.1.0
Message.
Status of which we are checking the item key.
cocart_cart_item_key_required_message
in repository
cocart_cart_item_name
Filter allows the product name of the item to change.
Made available since v3.0.0
Product name.
The product object.
The cart item data.
The item key generated based on the details of the item.
cocart_cart_item_name
in repository
cocart_cart_item_removed_message
Filter message about item removed from the cart.
Made available since v2.1.0
Message.
The product object.
cocart_cart_item_removed_message
in repository
cocart_cart_item_restored_message
Filters message about item restored.
Made available since v2.1.0
Message.
cocart_cart_item_restored_message
in repository
cocart_cart_item_restored_title
Re-calculate totals now an item has been restored.
Made available since v2.1.0
cocart_cart_item_restored_title
in repository
cocart_cart_item_title
Filter allows the product title of the item to change.
Made available since v3.0.0
Product title.
The product object.
The cart item data.
The item key generated based on the details of the item.
cocart_cart_item_title
in repository
cocart_item_added
Filter allows additional data to be returned.
Made available since v2.0.0
Item added to cart.
Item key of the item added.
cocart_item_added
in repository
cocart_item_product
Filter allows you to alter the item product data returned.
Made available since v2.0.0
The product object.
The cart item data.
The item key currently looped.
cocart_item_product
in repository
cocart_item_removed_message
Filters message about item removed from cart.
Made available since v2.1.0
Message.
cocart_item_removed_message
in repository
cocart_item_restored_message
Filters message about item already restored to cart.
Made available since v2.1.0
Message.
cocart_item_restored_message
in repository
cocart_item_thumbnail
Filters the item thumbnail ID.
Made available since v2.0.0
Product thumbnail ID.
Cart item.
Item key.
cocart_item_thumbnail
in repository
cocart_item_thumbnail_size
Filters the thumbnail size of the product image.
Made available since v2.0.0
Determines if the item in the cart is removed.
cocart_item_thumbnail_size
in repository
cocart_item_thumbnail_src
Filters the source of the product thumbnail.
Made available since v2.1.0
URL of the product thumbnail.
Cart item.
Item key.
cocart_item_thumbnail_src
in repository
cocart_update_cart_validation
Filter allows you to determine if the updated item in cart passed validation.
Made available since v2.1.0
True by default.
Item key.
Product data of the item in cart.
The requested quantity to change to.
cocart_update_cart_validation
in repository
cocart_update_item
Filters the update status.
Made available since v2.0.1
Status response.
Cart item.
Quantity.
The product object.
cocart_update_item
in repository
Product Validation & Messages
This category contains filters for product validation, stock checking, quantity limits, and related error messages.cocart_add_to_cart_quantity
Filters the quantity for specified products.
Made available since v2.1.0
The original quantity of the item.
The product ID.
The variation ID.
The variation data.
The cart item data.
cocart_add_to_cart_quantity
in repository
cocart_add_to_cart_sold_individually_found_in_cart
Quantity for sold individual products can be filtered.
Made available since v2.0.13
cocart_add_to_cart_sold_individually_found_in_cart
in repository
cocart_add_to_cart_sold_individually_quantity
Quantity for sold individual products can be filtered.
Made available since v2.0.13
cocart_add_to_cart_sold_individually_quantity
in repository
cocart_can_not_increase_quantity_message
Filters message about product not being allowed to increase quantity.
Made available since v1.0.0
Message.
The product object.
cocart_can_not_increase_quantity_message
in repository
cocart_can_not_update_item_message
Filters message about can not update item.
Made available since v2.1.0
Message.
cocart_can_not_update_item_message
in repository
cocart_cannot_add_product_type_to_cart_message
Filters message about product type that cannot be added to the cart.
Made available since v2.1.0
Message.
The product object.
cocart_cannot_add_product_type_to_cart_message
in repository
cocart_cart_item_required_stock_is_not_enough
Allows filter if product have enough stock to get added to the cart.
Made available since v2.1.0
If have enough stock.
The product object.
Cart item values.
cocart_cart_item_required_stock_is_not_enough
in repository
cocart_invalid_variation_data_message
Filters message about invalid variation data.
Made available since v2.1.0
Message.
Attribute Label.
Allowed values.
cocart_invalid_variation_data_message
in repository
cocart_missing_variation_data_message
Filters message about missing variation data.
Made available since v2.1.0
Message.
Number of missing attributes.
List of missing attributes.
cocart_missing_variation_data_message
in repository
cocart_product_can_not_add_another_message
Filters message about product not being allowed to add another.
Made available since v3.0.0
Message.
The product object.
cocart_product_can_not_add_another_message
in repository
cocart_product_cannot_add_to_cart_message
Filters message about product cannot be added to cart.
Made available since v2.1.0
Message.
The product object.
cocart_product_cannot_add_to_cart_message
in repository
cocart_product_cannot_be_added_message
Filters message about product that cannot be added to cart.
Made available since v3.0.0
Message.
The product object.
cocart_product_cannot_be_added_message
in repository
cocart_product_cannot_be_purchased_message
Filters message about product unable to be purchased.
Made available since v2.1.0
Message.
The product object.
cocart_product_cannot_be_purchased_message
in repository
cocart_product_does_not_exist_message
Filters message about product does not exist.
Made available since v2.1.0
Message.
The product object.
cocart_product_does_not_exist_message
in repository
cocart_product_failed_validation_message
Filters message about product failing validation.
Made available since v1.0.0
Message.
The product object.
cocart_product_failed_validation_message
in repository
cocart_product_is_out_of_stock_message
Filters message about product is out of stock.
Made available since v2.1.0
Message.
The product object.
cocart_product_is_out_of_stock_message
in repository
cocart_product_not_enough_stock_message
Filters message about product not having enough stock.
Made available since v3.1.0
Message.
The product object.
Quantity remaining.
cocart_product_not_enough_stock_message
in repository
cocart_quantity_maximum_allowed
Filters the products maximum quantity allowed to be purchased.
Made available since v3.1.0
cocart_quantity_maximum_allowed
in repository
cocart_quantity_minimum_requirement
Filters the minimum quantity requirement the product allows to be purchased.
Made available since v3.1.0
cocart_quantity_minimum_requirement
in repository
cocart_skip_woocommerce_item_validation
Filter the item to skip product validation as it is added to cart.
Made available since v3.0.0
Whether to validate the product or not.
Contains the product data of the product to add to cart.
The product ID.
cocart_skip_woocommerce_item_validation
in repository
Session & Customer Management
This category contains filters for session handling, customer data, and cart loading behavior.cocart_disable_load_cart
Filter checks if feature is disabled.
Made available since v3.0.0
bool
Usage
cocart_disable_load_cart
in repository
cocart_load_cart_query_name
Filter allows developers to add more white labelling when loading the cart via web.
Made available since v2.8.2
Default is ‘cocart-load-cart’.
cocart_load_cart_query_name
in repository
cocart_requested_cart_key
Filter allows the cart key to be overridden. Developer Note: Really only here so I don’t have to create a new session handler to inject a customer ID with the POS Support Add-on.
Made available since v4.2.0
cocart_requested_cart_key
in repository
cocart_set_customer_id
Filter allows to set the customer ID.
Made available since v4.1.0
Current user ID.
cocart_set_customer_id
in repository
Product Data & Display
This category contains filters for product information display, pricing, metadata, and attributes.cocart_prepare_money_disable_decimals
This filter allows you to disable the decimals. If set to “True” the decimals will be set to “Zero”.
Made available since v2.1.0
cocart_prepare_money_disable_decimals
in repository
cocart_prepare_product_attribute
Filter a attribute item returned from the API. Allows modification of the product attribute data right before it is returned.
Made available since v2.1.0
The response object.
The original attribute object.
The request object.
cocart_prepare_product_attribute
in repository
cocart_prepare_product_object
Filter the data for a response.
Made available since v2.1.0
The response object.
The product object.
The request object.
cocart_prepare_product_object
in repository
cocart_price_no_html
Filters the string of price markup.
Made available since v2.1.0
Price HTML markup.
Formatted price.
Pass on the args.
Price as float to allow plugins custom formatting. Since 3.2.0.
Original price as float, or empty string. Since 5.0.0.
cocart_price_no_html
in repository
cocart_product_title
Filters the product title in cart.
Made available since v2.1.0
Product title.
The product object.
Cart item.
Item key.
cocart_product_title
in repository
cocart_products_add_to_cart_rest_url
Filters the REST URL shortcut for adding the product to cart.
Made available since v3.1.0
REST URL for adding product to the cart.
The product object.
Product type.
Product ID.
cocart_products_add_to_cart_rest_url
in repository
cocart_products_get_price_range
Filters the products price range.
Made available since v3.1.0
The current product price range.
The product object.
cocart_products_get_price_range
in repository
cocart_products_get_safe_meta_data
Filter allows you to control what remaining product meta data is safe to return.
Made available since v3.11.0
Safe meta.
The product object.
cocart_products_get_safe_meta_data
in repository
cocart_products_ignore_private_meta_keys
Filter allows you to ignore private meta data for the product to return. When filtering, only list the meta key!
Made available since v3.11.0
Ignored meta keys.
The product object.
cocart_products_ignore_private_meta_keys
in repository
cocart_products_variable_empty_price
Filter the variable products empty prices.
Made available since v3.1.0
Empty array.
The project object.
cocart_products_variable_empty_price
in repository
System Environment & Status
This category contains filters for system environment detection, staging sites, and general status information.cocart_does_product_allow_price_change
Filter which products that can be allowed to override the price if not all.
Made available since v4.1.0
Allow price change.
Cart item.
The request object.
cocart_does_product_allow_price_change
in repository
cocart_is_rest_api_request
Filters the REST API requested.
Made available since v2.1.0
True if CoCart REST API is requested.
cocart_is_rest_api_request
in repository
cocart_return_default_response
See Also:
cocart_{$endpoint}_response
Filter decides if the responses return as default or use the modified response which is filtered by the rest base.
Made available since v3.0.0
cocart_return_default_response
in repository
cocart_totals_calculated_message
Filters message about cart totals have been calculated.
Made available since v2.1.0
Message.
cocart_totals_calculated_message
in repository
Admin & Plugin Management
This category contains filters for plugin administration, updates, submenus, and overall plugin configuration.cocart_enable_setup_wizard
See if we need the setup wizard or not.
Made available since v3.1.0
cocart_enable_setup_wizard
in repository
cocart_get_plugins_for_cocart
Filter allows you to get plugins which “maybe” are for CoCart.
Made available since v4.3.0
Array of plugins that “maybe” are for CoCart.
Array of plugins installed.
cocart_get_plugins_for_cocart
in repository
cocart_get_plugins_with_header
Filter allows you to get the plugins that have a valid value for a specific header.
Made available since v4.3.0
Array of plugins matched with header.
Plugin header to search for.
Array of plugins installed.
cocart_get_plugins_with_header
in repository
cocart_in_plugin_update_message
Filter allows you to change the upgrade notice.
Made available since v4.3.0
cocart_in_plugin_update_message
in repository
cocart_register_submenu_page
Hook to register submenu_pages class handlers The array element should be ‘submenu_page_slug’ => array( ‘class_name’ => array(), ‘data’ => array() )
Made available since v3.10.0
Array of submenu pages.
cocart_register_submenu_page
in repository
cocart_show_plugin_search
Filter if should be active.
Made available since v4.1.0
True if CoCart Plugin Suggestions is active.
cocart_show_plugin_search
in repository
API Schema & Parameters
This category contains filters that control API schema definitions, query parameters, and how data is structured in API responses.cocart_add_item_query_parameters
Filters the query parameters for adding item to cart. This filter allows you to extend the query parameters without removing any default parameters.
Made available since v3.1.0
cocart_add_item_query_parameters
in repository
cocart_add_items_query_parameters
Extends the query parameters. Dev Note: Nothing needs to pass so your safe if you think you will remove any default parameters.
Made available since v3.1.0
cocart_add_items_query_parameters
in repository
cocart_cart_items_schema
Extend the cart schema properties for items. This filter allows you to extend the cart schema properties for items without removing any default properties.
Made available since v3.1.0
cocart_cart_items_schema
in repository
cocart_cart_query_parameters
Extend the query parameters for the cart. This filter allows you to extend the query parameters without removing any default parameters.
Made available since v3.1.0
cocart_cart_query_parameters
in repository
cocart_prevent_wc_admin_note_created
Filter to prevent note from being created.
Made available since v3.2.0
False by default.
Arguments to create the note.
cocart_prevent_wc_admin_note_created
in repository
cocart_store_index
Filters the API store index data. This contains the data describing the API. This includes information about the store, routes available on the API, and a small amount of data about the site.
Made available since v2.1.0
Response data.
cocart_store_index
in repository
Product Reviews
This category contains filters for managing product reviews, their processing, and related queries.cocart_pre_insert_product_review
Filters a review before it is inserted via the REST API. Allows modification of the review right before it is inserted via wp_insert_comment()
. Returning a WP_Error value from the filter will short circuit insertion and allow skipping further processing.
Made available since v2.1.0
The prepared review data for
wp_insert_comment()
.Full details about the request.
cocart_pre_insert_product_review
in repository
cocart_prepare_product_review
Filter product reviews object returned from the REST API.
Made available since v2.1.0
The response object.
Product review object used to create response.
The request object.
cocart_prepare_product_review
in repository
cocart_preprocess_product_review
Filters a review after it is prepared for the database. Allows modification of the review right after it is prepared for the database.
Made available since v2.1.0
The prepared review data for
wp_insert_comment
.The request object.
cocart_preprocess_product_review
in repository
cocart_product_review_collection_params
Filter collection parameters for the reviews controller. This filter registers the collection parameter, but does not map the collection parameter to an internal WP_Comment_Query parameter. Use the cocart_product_review_query
filter to set WP_Comment_Query parameters.
Made available since v2.1.0
JSON Schema-formatted collection parameters.
cocart_product_review_collection_params
in repository
cocart_product_review_query
Filters arguments, before passing to WP_Comment_Query, when querying reviews via the REST API.
Made available since v2.1.0
Array of arguments for WP_Comment_Query.
The request object.
cocart_product_review_query
in repository
Shipping & Packages
This category contains filters for shipping packages, methods, and shipping-related calculations.cocart_available_shipping_packages
Filter allows you to alter the shipping packages returned.
Made available since v4.1.0
Available shipping packages.
Chosen shipping method.
cocart_available_shipping_packages
in repository
cocart_shipping_package_details_array
Filter allows you to change the package details.
Made available since v3.0.0
Product names.
Package details.
cocart_shipping_package_details_array
in repository
cocart_shipping_package_name
Filters the package name for the shipping method.
Made available since v3.0.0
Shipping name.
cocart_shipping_package_name
in repository
Error Messages & Notifications
This category contains filters for various error messages and user notifications throughout the cart system.cocart_can_not_remove_item_message
Filters message about can not remove item.
Made available since v2.1.0
Message.
cocart_can_not_remove_item_message
in repository
cocart_can_not_restore_item_message
Filters message about can not restore item.
Made available since v2.1.0
Message.
cocart_can_not_restore_item_message
in repository
cocart_cart_item_key_required_message
Filters message about cart item key required.
Made available since v2.1.0
Message.
Status of which we are checking the item key.
cocart_cart_item_key_required_message
in repository
cocart_item_not_in_cart_message
Filters message about cart item key required.
Made available since v2.1.0
Message.
Method.
cocart_item_not_in_cart_message
in repository
cocart_no_items_in_cart_message
Filters message about no items in the cart.
Made available since v2.1.0
Message.
cocart_no_items_in_cart_message
in repository
cocart_no_items_message
Filters message about no items in cart.
Made available since v2.1.0
Message.
cocart_no_items_message
in repository