Developer Hooks
Add these to a child theme’s functions.php or a small custom plugin. Don’t edit ChatKart’s files: updates overwrite them.
// Change who may see the button for a product.
add_filter( 'ck_product_allowed', function ( $allowed, $product ) {
return $allowed;
}, 10, 2 );
// Edit the final order message before the WhatsApp link is built.
add_filter( 'ck_order_message', function ( $message, $items, $customer, $order ) {
return $message . "\nThank you!";
}, 10, 4 );
// Allow shop managers to edit the settings (default: administrators only).
add_filter( 'ck_capability', function () { return 'manage_woocommerce'; } );
// Plug in a CAPTCHA / anti-spam check for 'order', 'lead' and 'stock' forms. Return false to reject.
add_filter( 'ck_spam_check', function ( $ok, $form ) { return $ok; }, 10, 2 );
// Real visitor IP behind a trusted proxy (used for rate limits).
add_filter( 'ck_client_ip', function ( $ip ) { return $ip; } );
// Tune the safety caps.
add_filter( 'ck_max_orders_per_hour', function () { return 60; } );
add_filter( 'ck_cloud_hourly_cap', function () { return 300; } );
// Decide whether the floating button is visible on a page.
add_filter( 'ck_float_visible', function ( $visible ) { return $visible; } );
