Skip to main content

cocart_is_rest_api_request

Filters the REST API requested.
ParameterTypeDescription
$is_rest_api_requestboolTrue if CoCart REST API is requested.
  • Since: 2.1.0 Introduced.
Defined in: includes/class-cocart.php

cocart_wp_accessible_page_ids

Filter controls which pages are accessible when WordPress is denied access. Both the cart and checkout pages are accessible by default.
  • Since: 5.0.0 Introduced.
  • Returns: array Page ID's that are accessible.
Defined in: includes/class-cocart.php

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() )
ParameterTypeDescription
$submenusarrayArray of submenu pages.
  • Since: 3.10.0 Introduced.
Defined in: includes/classes/admin/class-cocart-admin-menus.php

cocart_in_plugin_update_message

Filter allows you to change the upgrade notice.
  • Since: 4.3.0 Introduced.
Defined in: includes/classes/admin/plugin-updates/class-cocart-admin-plugin-screen-update.php

cocart_get_plugins_with_header

Filter allows you to get the plugins that have a valid value for a specific header.
ParameterTypeDescription
$matchesarrayArray of plugins matched with header.
$headerstringPlugin header to search for.
$pluginsarrayArray of plugins installed.
  • Since: 4.3.0 Introduced.
Defined in: includes/classes/admin/plugin-updates/class-cocart-admin-plugin-updates.php

cocart_get_plugins_for_cocart

Filter allows you to get plugins which “maybe” are for CoCart.
ParameterTypeDescription
$matchesarrayArray of plugins that “maybe” are for CoCart.
$pluginsarrayArray of plugins installed.
  • Since: 4.3.0 Introduced.
Defined in: includes/classes/admin/plugin-updates/class-cocart-admin-plugin-updates.php

cocart_prevent_wc_admin_note_created

Filter to prevent note from being created.
ParameterTypeDescription
$prevent_note_creationboolFalse by default
$argsarrayArguments to create the note.
  • Since: 3.2.0 Introduced
Defined in: includes/classes/admin/woocommerce/class-cocart-wc-admin-notices.php

cocart_install_capability

Filter the current users capabilities to install a CoCart plugin.
ParameterTypeDescription
$capabilitystringCapability level.
Defined in: includes/classes/class-cocart-helpers.php
Filter if CoCart Plugin Suggestions should be active.
ParameterTypeDescription
$show_suggestionsboolTrue if CoCart Plugin Suggestions is active.
Defined in: includes/classes/class-cocart-helpers.php

cocart_enable_setup_wizard

See if we need the setup wizard or not.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/class-cocart-install.php

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.
  • Since: 4.2.0 Introduced.
Defined in: includes/classes/class-cocart-session-handler.php

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
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/class-cocart-session-handler.php

cocart_cart_expiration

Filter allows you to change the amount of time before the cart has expired. Default is (DAY_IN_SECONDS * 7) = 7 Days
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/class-cocart-session-handler.php

cocart_cart_source

Filter source of cart.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/class-cocart-session-handler.php

cocart_disable_load_cart

Filter checks if “Load Cart from Session” feature is disabled.
  • Since: 3.0.0 Introduced.
  • Returns: bool
Defined in: includes/classes/class-cocart-session.php

cocart_load_cart_query_name

Filter allows developers to add more white labelling when loading the cart via web.
ParameterTypeDescription
$action_querystringDefault is ‘cocart-load-cart’
  • Since: 2.8.2 Introduced.
Defined in: includes/classes/class-cocart-session.php

cocart_load_cart_redirect_home

Filter allows you to change where to redirect should loading the cart fail.
  • Since: 5.0.0 Introduced.
Defined in: includes/classes/class-cocart-session.php

cocart_is_offline_mode

Filters CoCart’s offline mode.
ParameterTypeDescription
$offline_modebooleanIs CoCart’s offline mode active.
Defined in: includes/classes/class-cocart-status.php

cocart_is_local_site

Filters is_local_site check.
ParameterTypeDescription
$is_localbooleanIf the current site is a local site.
Defined in: includes/classes/class-cocart-status.php

cocart_known_staging

Filters the flags of known staging sites. An array of arrays that each are used to check if the current site is staging. }
ParameterTypeDescription
$known_stagingarray
An array of arrays that each are used to check if the current site is staging.
  • $urls (array): URLs of staging sites in regex to check against site_url.
  • $constants (array): PHP constants of known staging/development environments. |
Defined in: includes/classes/class-cocart-status.php

cocart_is_staging_site

Filters is_staging_site check.
ParameterTypeDescription
$is_stagingbooleanIf the current site is a staging site.
Defined in: includes/classes/class-cocart-status.php

cocart_update_cart_validation

Filter allows you to determine if the updated item in cart passed validation.
ParameterTypeDescription
$cart_validboolTrue by default.
$item_keystringItem key of the item updated.
$cart_itemarrayCart item after updated.
$quantityintNew quantity amount.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/callbacks/update-cart.php

cocart_auth_header

Filter allows you to change the authorization header.
ParameterTypeDescription
$auth_headerstringAuthorization header.
  • Since: 4.1.0 Introduced.
Defined in: includes/classes/rest-api/class-cocart-authentication.php

cocart_disable_all_cors

Modifies if the “Cross Origin Headers” are allowed. Set as false to enable support.
  • Since: 2.2.0 Introduced.
Defined in: includes/classes/rest-api/class-cocart-authentication.php

cocart_allow_origin

Filter allows you to change the allowed HTTP origin result.
ParameterTypeDescription
$originstringOrigin URL if allowed, empty string if not.
  • Since: 2.5.1 Introduced.
Defined in: includes/classes/rest-api/class-cocart-authentication.php

cocart_does_product_allow_price_change

Filter which products that can be allowed to override the price if not all.
ParameterTypeDescription
$allow_changeboolAllow price change.
$cart_itemarrayCart item.
$requestWP_REST_RequestThe request object.
  • Since: 4.1.0 Introduced.
Defined in: includes/classes/rest-api/class-cocart-cart-cache.php

cocart_cart_item_required_stock_is_not_enough

Allows filter if product have enough stock to get added to the cart.
ParameterTypeDescription
$has_stockboolIf have enough stock.
$productWC_ProductThe product object.
$cart_itemarrayCart item values.
Defined in: includes/classes/rest-api/class-cocart-cart-validation.php

cocart_cannot_add_product_type_to_cart_message

Filters message about product type that cannot be added to the cart.
ParameterTypeDescription
$messagestringMessage.
$product_dataWC_ProductThe product object.
Defined in: includes/classes/rest-api/class-cocart-product-validation.php

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.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/class-cocart-response.php

cocart_load_cart_from_session

Filter allows you to decide if the cart should load user meta when initialized. This means merge cart data from a registered customer with the requested cart.
ParameterTypeDescription
$user_idintUser ID when authenticated. Zero if not authenticated.
$customer_idstringCustomer ID requested when authenticated or a cart key for guests.
  • Since: 5.0.0 Introduced.
Defined in: includes/classes/rest-api/class-cocart-rest-api.php

cocart_set_customer_id

Filter allows to set the customer ID.
ParameterTypeDescription
$current_user_idintCurrent user ID.
  • Since: 4.1.0 Introduced.
Defined in: includes/classes/rest-api/class-cocart-rest-api.php

cocart_product_cannot_add_to_cart_message

Filters message about product cannot be added to cart.
ParameterTypeDescription
$messagestringMessage.
$product_dataWC_ProductThe product object.
  • Since: 2.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-add-item-controller.php

cocart_item_added

Filter allows additional data to be returned.
ParameterTypeDescription
$item_addedarrayItem added to cart.
$item_keystringItem key of the item added.
  • Since: 2.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-add-item-controller.php

cocart_totals_calculated_message

Filters message about cart totals have been calculated.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-calculate-controller.php

cocart_cart_cleared_message

Filters message about the cart being cleared.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-clear-cart-controller.php

cocart_clear_cart_failed_message

Filters message about the cart failing to clear.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-clear-cart-controller.php

cocart_return_empty_cart

Filter response for empty cart.
  • Since: 2.0.8 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_item_product

Filter allows you to alter the item product data returned.
ParameterTypeDescription
$productWC_ProductThe product object.
$cart_itemarrayThe cart item data.
$item_keystringThe item key currently looped.
  • Since: 2.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_cart_item_removed_message

Filter message about item removed from the cart.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_product_title

Filters the product title in cart.
ParameterTypeDescription
$product_titlestringProduct title.
$productWC_ProductThe product object.
$cart_itemarrayCart item.
$item_keystringItem key.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_item_thumbnail

Filters the item thumbnail ID.
ParameterTypeDescription
$thumbnail_idintProduct thumbnail ID.
$cart_itemarrayCart item.
$item_keystringItem key.
  • Since: 2.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_cart_contents

Filter allows additional data to be returned for a specific item in cart.
ParameterTypeDescription
$cart_contentsarrayCart contents.
$item_keystringItem key.
$cart_itemarrayCart item.
$productWC_ProductThe product object.
  • Since: 2.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_return_cart_session_contents

Return cart content from session if set.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_return_cart_contents

Return cart content from session if set.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_invalid_variation_data_message

Filters message about invalid variation data.
ParameterTypeDescription
$messagestringMessage.
$attribute_labelstringAttribute Label.
$attributearrayAllowed values.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_missing_variation_data_message

Filters message about missing variation data.
ParameterTypeDescription
$messagestringMessage.
$missing_attributesintNumber of missing attributes.
$missing_attributesarrayList of missing attributes.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_product_does_not_exist_message

Filters message about product does not exist.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_product_failed_validation_message

Filters message about product failing validation.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_product_can_not_add_another_message

Filters message about product not being allowed to add another.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_product_cannot_be_purchased_message

Filters message about product unable to be purchased.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_product_is_out_of_stock_message

Filters message about product is out of stock.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-controller.php

cocart_no_items_in_cart_message

Filters message about no items in the cart.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-count-controller.php

cocart_no_items_message

Filters message about no items in cart.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_item_not_in_cart_message

Filters message about item not in cart.
ParameterTypeDescription
$messagestringMessage.
$methodstringMethod.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_can_not_remove_item_message

Filters message about can not remove item.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_cart_item_key_required_message

Filters message about cart item key required.
ParameterTypeDescription
$messagestringMessage.
$methodstringMethod.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_can_not_restore_item_message

Filters message about can not restore item.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_cart_item_key_required_message

Filters message about cart item key required.
ParameterTypeDescription
$messagestringMessage.
$methodstringMethod.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_item_not_in_cart_message

Filters message about cart item key required.
ParameterTypeDescription
$messagestringMessage.
$methodstringMethod.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_can_not_increase_quantity_message

Filters message about product not being allowed to increase quantity.
ParameterTypeDescription
$messagestringMessage.
$current_dataWC_ProductThe product object.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_can_not_update_item_message

Filters message about can not update item.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_update_item

Filter allows you to alter the returned response once item is updated.
ParameterTypeDescription
$responsearrayResponse returned.
$new_dataarrayItem data.
$quantityfloatRequested quantity to update for item.
$product_dataWC_ProductThe product object.
  • Since: 2.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_cart_item_key_required_message

Filters message about cart item key required.
ParameterTypeDescription
$messagestringMessage.
$methodstringMethod.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v1/cart/class-cocart-item-controller.php

cocart_prepare_product_attribute

Filter a attribute item returned from the API. Allows modification of the product attribute data right before it is returned.
ParameterTypeDescription
$responseWP_REST_ResponseThe response object.
$itemobjectThe original attribute object.
$requestWP_REST_RequestThe request object.
Defined in: includes/classes/rest-api/controllers/v1/products/class-cocart-product-attributes-controller.php

cocart_product_review_query

Filters arguments, before passing to WP_Comment_Query, when querying reviews via the REST API.
ParameterTypeDescription
$prepared_argsarrayArray of arguments for WP_Comment_Query.
$requestWP_REST_RequestThe request object.
Defined in: includes/classes/rest-api/controllers/v1/products/class-cocart-product-reviews-controller.php

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.
ParameterTypeDescription
$prepared_review`arrayWP_Error`The prepared review data for wp_insert_comment().
$requestWP_REST_RequestFull details about the request.
Defined in: includes/classes/rest-api/controllers/v1/products/class-cocart-product-reviews-controller.php

cocart_prepare_product_review

Filter product reviews object returned from the REST API.
ParameterTypeDescription
$responseWP_REST_ResponseThe response object.
$reviewWP_CommentProduct review object used to create response.
$requestWP_REST_RequestThe request object.
Defined in: includes/classes/rest-api/controllers/v1/products/class-cocart-product-reviews-controller.php

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.
ParameterTypeDescription
$prepared_reviewarrayThe prepared review data for wp_insert_comment.
$requestWP_REST_RequestThe request object.
Defined in: includes/classes/rest-api/controllers/v1/products/class-cocart-product-reviews-controller.php

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.
ParameterTypeDescription
$paramsarrayJSON Schema-formatted collection parameters.
Defined in: includes/classes/rest-api/controllers/v1/products/class-cocart-product-reviews-controller.php

cocart_prepare_product_object

Filter the data for a response.
ParameterTypeDescription
$responseWP_REST_ResponseThe response object.
$productWC_ProductThe product object.
$requestWP_REST_RequestThe request object.
Defined in: includes/classes/rest-api/controllers/v1/products/class-cocart-products-controller.php

cocart_cart_item_name

Filter allows the product name of the item to change.
ParameterTypeDescription
$product_namestringProduct name.
$productWC_ProductThe product object.
$cart_itemarrayThe cart item data.
$item_keystringThe item key generated based on the details of the item.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/admin/class-cocart-session-controller.php

cocart_cart_item_title

Filter allows the product title of the item to change.
ParameterTypeDescription
$product_titlestringProduct title.
$productWC_ProductThe product object.
$cart_itemarrayThe cart item data.
$item_keystringThe item key generated based on the details of the item.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/admin/class-cocart-session-controller.php

cocart_cart_item_data

Filter allows you to alter the remaining cart item data.
ParameterTypeDescription
$cart_itemarrayThe cart item data.
$item_keystringGenerated ID based on the product information when added to the cart.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/admin/class-cocart-session-controller.php

cocart_skip_woocommerce_item_validation

Filter the item to skip product validation as it is added to cart.
ParameterTypeDescription
$validate_productboolWhether to validate the product or not.
$product_dataarrayContains the product data of the product to add to cart.
$product_idintThe product ID.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-add-item-controller.php

cocart_product_cannot_add_to_cart_message

Filters message about product cannot be added to cart.
ParameterTypeDescription
$messagestringMessage.
$product_dataWC_ProductThe product object.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-add-item-controller.php

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.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-add-item-controller.php

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.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-add-items-controller.php

cocart_get_cart_item

Filters the cart item before it is returned.
ParameterTypeDescription
$itemarrayDetails of the item in the cart if it exists.
$conditionstringCondition of item. Default: “add”, Option: “add”, “remove”, “restore”, “update”.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_empty_cart

Filter response for empty cart.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_product_failed_validation_message

Filters message about product failing validation.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
  • Since: 1.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_product_can_not_add_another_message

Filters message about product not being allowed to add another.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_product_is_out_of_stock_message

Filters message about product is out of stock.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_product_not_enough_stock_message

Filters message about product not having enough stock.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
$stock_quantityintQuantity remaining.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_cart_item_name

Filter allows the product name of the item to change.
ParameterTypeDescription
$product_namestringProduct name.
$productWC_ProductThe product object.
$cart_itemarrayThe cart item data.
$item_keystringThe item key generated based on the details of the item.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_cart_item_title

Filter allows the product title of the item to change.
ParameterTypeDescription
$product_titlestringProduct title.
$productWC_ProductThe product object.
$cart_itemarrayThe cart item data.
$item_keystringThe item key generated based on the details of the item.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_cart_item_data

Filter allows you to alter the remaining cart item data.
ParameterTypeDescription
$cart_itemarrayThe cart item data.
$item_keystringGenerated ID based on the product information when added to the cart.
$productWC_ProductThe product object.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_item_product

Filter allows you to alter the item product data returned.
ParameterTypeDescription
$productWC_ProductThe product object.
$cart_itemarrayThe cart item data.
$item_keystringThe item key currently looped.
  • Since: 2.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_cart_items

Filter allows additional data to be returned for a specific item in cart.
ParameterTypeDescription
$itemsarrayArray of items in the cart.
$item_keystringThe item key currently looped.
$cart_itemarrayThe cart item data.
$productWC_ProductThe product object.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_cross_sells

Filters the cross sell items.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_cart_items_schema

Extend cart schema properties for items. Filter allows you to extend the cart schema properties for items without removing any default properties.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_cart_items_extensions_schema

Extend cart schema properties for extensions. Filter allows you to extend the cart schema properties for extensions.
  • Since: 5.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

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.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-cart-controller.php

cocart_cart_cleared_message

Filters message about the cart being cleared.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-clear-cart-controller.php

cocart_clear_cart_failed_message

Filters message about the cart failing to clear.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-clear-cart-controller.php

cocart_no_items_in_cart_message

Filters message about no items in the cart.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-count-controller.php

cocart_item_not_in_cart_message

Filters message about cart item key required.
ParameterTypeDescription
$messagestringMessage.
$methodstringMethod.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-item-controller.php

cocart_no_items_in_cart_message

Filters message about no items in the cart.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-items-controller.php

cocart_no_items_message

Filters message about no items in cart.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-remove-item-controller.php

cocart_item_removed_message

Filters message about item removed from cart.
ParameterTypeDescription
$messagestringMessage.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-remove-item-controller.php

cocart_can_not_remove_item_message

Filters message about can not remove item.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-remove-item-controller.php

cocart_item_restored_message

Filters message about item already restored to cart.
ParameterTypeDescription
$messagestringMessage.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-restore-item-controller.php

cocart_cart_item_restored_title

Re-calculate totals now an item has been restored.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-restore-item-controller.php

cocart_cart_item_restored_message

Filters message about item restored.
ParameterTypeDescription
$restored_messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-restore-item-controller.php

cocart_can_not_restore_item_message

Filters message about can not restore item.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-restore-item-controller.php

cocart_item_not_in_cart_message

Filters message about cart item key required.
ParameterTypeDescription
$messagestringMessage.
$methodstringMethod.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-update-item-controller.php

cocart_update_cart_validation

Filter allows you to determine if the updated item in cart passed validation.
ParameterTypeDescription
$cart_validboolTrue by default.
$item_keystringItem key.
$current_dataarrayProduct data of the item in cart.
$quantityfloatThe requested quantity to change to.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-update-item-controller.php

cocart_can_not_increase_quantity_message

Filters message about product not being allowed to increase quantity.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
  • Since: 1.0.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-update-item-controller.php

cocart_can_not_update_item_message

Filters message about can not update item.
ParameterTypeDescription
$messagestringMessage.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-update-item-controller.php

cocart_update_item

Filters the update status.
ParameterTypeDescription
$responsearrayStatus response.
$new_dataarrayCart item.
$quantityintQuantity.
$productWC_ProductThe product object.
  • Since: 2.0.1 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/cart/class-cocart-update-item-controller.php

cocart_login_extras

Filter allows you to add extra information based on the current user.
ParameterTypeDescription
$extra_informationarrayThe extra information.
$current_userobjectThe current user.
  • Since: 3.8.1 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/others/class-cocart-login-controller.php

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.
ParameterTypeDescription
$responseWP_REST_ResponseResponse data.
Defined in: includes/classes/rest-api/controllers/v2/others/class-cocart-store-controller.php

cocart_products_add_to_cart_rest_url

Filters the REST URL shortcut for adding the product to cart.
ParameterTypeDescription
$rest_urlstringREST URL for adding product to the cart.
$productWC_ProductThe product object.
$typestringProduct type.
$idintProduct ID.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/rest-api/controllers/v2/products/class-cocart-products-controller.php

cocart_get_customer_

We go through each field and check that we can return it’s data as set by default. If we can’t get the data we rely on getting customer data via a filter for that field. Any fields that can not return information will be empty. Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_shipping_package_details_array

Filter allows you to change the package details.
ParameterTypeDescription
$product_namesarrayProduct names.
$packagearrayPackage details.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_item_thumbnail_size

Filters the thumbnail size of the product image.
ParameterTypeDescription
$thumbnail_sizestringThumbnail size.
$removed_itemboolDetermines if the item in the cart is removed.
  • Since: 2.0.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_cart_item_name

Filter allows the product name of the item to change.
ParameterTypeDescription
$product_namestringProduct name.
$productWC_ProductThe product object.
$cart_itemarrayThe cart item data.
$item_keystringThe item key generated based on the details of the item.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_cart_item_data

Filter allows you to alter the remaining cart item data.
ParameterTypeDescription
$cart_itemarrayThe cart item data.
$item_keystringGenerated ID based on the product information when added to the cart.
$productWC_ProductThe product object.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_product_cannot_be_added_message

Filters message about product that cannot be added to cart.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
  • Since: 3.0.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_quantity_maximum_allowed

Filter allows control over the maximum quantity a customer is able to add said item to the cart.
ParameterTypeDescription
$quantity`intfloat`Maximum quantity to validate with.
$productWC_ProductThe product object.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_invalid_variation_data_message

Filters message about invalid variation data.
ParameterTypeDescription
$messagestringMessage.
$attribute_labelstringAttribute Label.
$attributearrayAllowed values.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_missing_variation_data_message

Filters message about missing variation data.
ParameterTypeDescription
$messagestringMessage.
$countintNumber of missing attributes.
$attributesstringComma separate a list of missing attributes.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_product_cannot_be_purchased_message

Filters message about product unable to be purchased.
ParameterTypeDescription
$messagestringMessage.
$productWC_ProductThe product object.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_cart_item_key_required_message

Filters message about cart item key required.
ParameterTypeDescription
$messagestringMessage.
$statusstringStatus of which we are checking the item key.
  • Since: 2.1.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-cart-helpers.php

cocart_quantity_minimum_requirement

Filters the minimum quantity requirement the product allows to be purchased.
ParameterTypeDescription
$minimum_quantityintMinimum purchase quantity requirement.
$productWC_ProductThe product object.
  • Since: 3.0.17 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-product-helpers.php

cocart_quantity_maximum_allowed

Filters the products maximum quantity allowed to be purchased.
ParameterTypeDescription
$maximum_quantityintMaximum purchase quantity allowed.
$productWC_ProductThe product object.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-product-helpers.php

cocart_products_variable_empty_price

Filter the variable products empty prices.
ParameterTypeDescription
$empty_pricesarrayEmpty array.
$productWC_ProductThe project object.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-product-helpers.php

cocart_products_get_price_range

Filters the products price range.
ParameterTypeDescription
$pricearrayThe current product price range.
$productWC_ProductThe product object.
  • Since: 3.1.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-product-helpers.php

cocart_products_allowed_meta_keys

Filter allows you to specify the allowed meta keys for the product. When filtering, only list the meta keys you want to include!
ParameterTypeDescription
$allowed_meta_keysarrayAllowed meta keys.
$productWC_ProductThe product object.
  • Since: 5.0.0 Updated to whitelist allowed meta keys.
Defined in: includes/classes/utilities/class-cocart-utilities-product-helpers.php

cocart_products_get_safe_meta_data

Filter allows you to control what remaining product meta data is safe to return.
ParameterTypeDescription
$safe_metaarraySafe meta.
$productWC_ProductThe product object.
  • Since: 3.11.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-product-helpers.php

cocart_get_product_slug

Filter allows you to change the product slug returned.
ParameterTypeDescription
$productWC_ProductThe product object.
  • Since: 5.0.0 Introduced.
Defined in: includes/classes/utilities/class-cocart-utilities-product-helpers.php

cocart_prepare_money_disable_decimals

Filter allows you to disable the decimals. If set to “True” the decimals will be forced to “Zero”.
ParameterTypeDescription
$disable_decimalsboolFalse by default.
  • Since: 3.1.0 Introduced.
Defined in: includes/cocart-formatting-functions.php

cocart_price_no_html

Filters the string of price markup.
ParameterTypeDescription
$returnstringPrice HTML markup.
$pricestringFormatted price.
$argsarrayPass on the args.
$unformatted_pricefloatPrice as float to allow plugins custom formatting. Since 3.2.0.
$original_price`floatstring`Original price as float, or empty string. Since 5.0.0.
Defined in: includes/cocart-rest-functions.php

cocart_wp_frontend_url

Filters the frontend URL that users will be redirected to if WordPress access is disabled.
  • Since: 5.0.0 Introduced.
Defined in: includes/cocart-rest-functions.php

cocart_wp_disable_access

Filters access to WordPress. Default is ‘no’.
  • Since: 5.0.0 Introduced.
Defined in: includes/cocart-rest-functions.php