Cart Data - Filter Hook References

Cart Data - Filter Hook References

This is simply a list of cart data-related filter hooks included in the WooCommerce Catalog Mode - Pricing, Enquiry Forms & Promotions files. This list also includes the supported parameters and example codes.


wmodes/get-cart-item

  • Parameters:
  • $cart_item array()
  • $raw_cart_item array()
  • $contex string

Example Codes:

  1. function custom_get_cart_item( $cart_item, $raw_cart_item, $contex ) {
  2.    //add your custom code here
  3.    return $cart_item;
  4. }
  5. add_filter( 'wmodes/get-cart-item', 'custom_get_cart_item', 10, 3 );

wmodes/get-cart-totals

  • Parameters:
  • $totals array()
  • $raw_totals array()
  • $contex string

Example Codes:

  1. function custom_get_cart_totals( $totals, $raw_totals, $contex ) {
  2.    //add your custom code here
  3.    return $totals;
  4. }
  5. add_filter( 'wmodes/get-cart-totals', 'custom_get_cart_totals', 10, 3 );

wmodes/get-cart-applied-coupons

  • Parameters:
  • $applied_coupons array()
  • $raw_applied_coupons array()
  • $contex string

Example Codes:

  1. function custom_get_cart_applied_coupons( $applied_coupons, $raw_applied_coupons, $contex ) {
  2.    //add your custom code here
  3.    return $applied_coupons;
  4. }
  5. add_filter( 'wmodes/get-cart-applied-coupons', 'custom_get_cart_applied_coupons', 10, 3 );

wmodes/get-cart-shipping

  • Parameters:
  • $shipping array()
  • $raw_shipping array()
  • $contex string

Example Codes:

  1. function custom_get_cart_shipping( $shipping, $raw_shipping, $contex ) {
  2.    //add your custom code here
  3.    return $shipping;
  4. }
  5. add_filter( 'wmodes/get-cart-shipping', 'custom_get_cart_shipping', 10, 3 );

wmodes/get-cart-payment-method-id

  • Parameters:
  • $payment_method_id array()
  • $raw_payment_method_id array()
  • $contex string

Example Codes:

  1. function custom_get_cart_payment_method_id( $payment_method_id, $raw_payment_method_id, $contex ) {
  2.    //add your custom code here
  3.    return $payment_method_id;
  4. }
  5. add_filter( 'wmodes/get-cart-payment-method-id', 'custom_get_cart_payment_method_id', 10, 3 );

wmodes/get-cart-customer

  • Parameters:
  • $customer array()
  • $raw_customer array()

Example Codes:

  1. function custom_get_cart_customer( $customer, $raw_customer ) {
  2.    //add your custom code here
  3.    return $customer;
  4. }
  5. add_filter( 'wmodes/get-cart-customer', 'custom_get_cart_customer', 10, 2 );
    • Related Articles

    • Product Data - Filter Hook References

      This is simply a list of product data-related filter hooks included in the WooCommerce Catalog Mode - Pricing, Enquiry Forms & Promotions files. This list also includes the supported parameters and example codes. wmodes/get-product-properties ...
    • Conditions - Filter Hook References

      This is simply a list of condition-related filter hooks included in the WooCommerce Catalog Mode - Pricing, Enquiry Forms & Promotions files. This list also includes the supported parameters and example codes. wmodes-admin/get-condition-groups ...
    • Product Rules - Filter Hook References

      This is simply a list of product rule-related filter hooks included in the WooCommerce Catalog Mode - Pricing, Enquiry Forms & Promotions files. This list also includes the supported parameters and example codes. ...
    • Products Pricing - Filter Hook References

      This is simply a list of products pricing-related filter hooks included in the WooCommerce Catalog Mode - Pricing, Enquiry Forms & Promotions files. This list also includes the supported parameters and example codes. ...
    • Catalog Modes - Filter Hook References

      This is simply a list of catalog modes related filter hooks included in the WooCommerce Catalog Mode - Pricing, Enquiry Forms & Promotions files. This list also includes the supported parameters and example codes. ...