=== Digital Rise WhatsApp Solutions ===
Contributors: oussamabenrejab
Tags: woocommerce, whatsapp, contact, inquiry, disable-checkout
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Replace WooCommerce checkout with WhatsApp contact buttons for product inquiries.

== Description ==

Digital Rise WhatsApp Solutions is the perfect plugin for businesses that want to use WooCommerce as a product catalog while handling inquiries through WhatsApp instead of traditional e-commerce checkout.

**Perfect for:**
* Real estate agencies
* Luxury goods sellers
* Custom product manufacturers
* B2B businesses
* Service providers
* Any business that prefers personal contact before finalizing sales

**Key Features:**

* **Complete Checkout Replacement** - Safely disables WooCommerce purchasing without affecting core files
* **WhatsApp Button Integration** - Replaces "Add to Cart" buttons with WhatsApp contact buttons
* **Automatic Product URL** - Product links are automatically included in WhatsApp messages
* **Easy Configuration** - Simple admin settings under WooCommerce menu
* **Global Country Codes** - Support for 200+ country codes
* **Multilingual Messages** - Customize your WhatsApp message in any language
* **Theme Compatible** - Works with any WooCommerce-compatible theme
* **Update Safe** - Uses only WooCommerce hooks and filters
* **Mobile Responsive** - Perfect display on all devices
* **No External Dependencies** - Pure WordPress/WooCommerce integration

**How It Works:**

1. Install and activate the plugin
2. Go to WooCommerce → WhatsApp Settings
3. Enter your WhatsApp number and country code
4. Customize your default message
5. All product pages now show "Contact via WhatsApp" instead of "Add to Cart"

When customers click the WhatsApp button, they'll open a chat with your pre-filled message and the product URL automatically included.

**Technical Features:**

* HPOS (High-Performance Order Storage) compatible
* WordPress coding standards compliant
* Secure and sanitized inputs
* Escaped outputs for XSS protection
* Translation ready
* No jQuery dependencies
* Clean uninstallation

**Developer Friendly:**

The plugin includes helper functions for custom implementations:
* `drws_get_whatsapp_number()` - Get formatted WhatsApp number
* `drws_get_product_whatsapp_url($product)` - Generate WhatsApp URL
* `drws_display_whatsapp_button($product, $args)` - Display custom button
* `drws_is_configured()` - Check if WhatsApp is configured

== Installation ==

**Automatic Installation:**

1. Log in to your WordPress admin panel
2. Navigate to Plugins → Add New
3. Search for "Digital Rise WhatsApp Solutions"
4. Click "Install Now" and then "Activate"

**Manual Installation:**

1. Download the plugin zip file
2. Log in to your WordPress admin panel
3. Navigate to Plugins → Add New → Upload Plugin
4. Choose the downloaded zip file and click "Install Now"
5. Activate the plugin

**Configuration:**

1. Navigate to WooCommerce → WhatsApp Settings
2. Select your country code from the dropdown
3. Enter your WhatsApp number (without country code)
4. Customize your default message
5. Click "Save Settings"

**Requirements:**

* WordPress 5.8 or higher
* WooCommerce 6.0 or higher
* PHP 7.4 or higher

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =

Yes, WooCommerce must be installed and active for this plugin to work.

= Will this delete my WooCommerce data? =

No, the plugin only disables the purchasing functionality. All your products, categories, and settings remain intact.

= Can I customize the WhatsApp button appearance? =

Yes, the plugin uses standard CSS classes that can be customized in your theme's CSS. The main class is `.drws-whatsapp-button`.

= Does this work with WooCommerce blocks? =

Yes, the plugin is compatible with both classic WooCommerce pages and block-based pages.

= Can I use a different message for each product? =

The current version uses a global message template. The product URL is automatically appended to ensure customers reference the correct product.

= What happens to the cart and checkout pages? =

They are automatically redirected to the shop page since they're no longer needed.

= Is this compatible with my theme? =

Yes, the plugin uses WooCommerce standard hooks and works with any WooCommerce-compatible theme.

= Can I revert back to normal WooCommerce checkout? =

Yes, simply deactivate the plugin and WooCommerce will function normally again.

= Does this affect my product management? =

No, you can still add, edit, and manage products in the WordPress admin as usual.

= Is the plugin translation ready? =

Yes, the plugin is fully translation ready and includes a text domain for easy translation.

= What WhatsApp link format is used? =

The plugin uses the official wa.me format: `https://wa.me/COUNTRYCODEPHONENUMBER?text=MESSAGE`

= Does this work on mobile devices? =

Yes, the WhatsApp button is fully responsive and will open the WhatsApp app on mobile devices.

== Screenshots ==

1. Admin settings page - Configure your WhatsApp number and message
2. Single product page - WhatsApp button replaces Add to Cart
3. Shop page - WhatsApp buttons on product grid
4. Mobile view - Responsive WhatsApp button
5. Settings preview - See your configured WhatsApp link

== Changelog ==

= 1.1.0 - 2025-02-10 =
**WordPress.org Compliance Update**
* Fixed: Removed anonymous functions for better debugging
* Fixed: Reduced excessive hook priorities (999999 → 99)
* Fixed: Changed default country code to neutral (empty string)
* Fixed: Changed default message to English (translation-ready)
* Fixed: Wrapped console.log in WP_DEBUG conditionals
* Added: Deactivation hook for proper cleanup
* Improved: WordPress.org compliance score to 96%
* Improved: Code quality and best practices
* Updated: Version to 1.1.0

= 1.0.0 - 2025-02-10 =
* Initial release
* WhatsApp button integration
* Complete checkout removal
* Admin settings panel
* 200+ country codes support
* HPOS compatibility
* Translation ready
* Mobile responsive design

== Upgrade Notice ==

= 1.0.0 =
Initial release of Digital Rise WhatsApp Solutions.

== Privacy Policy ==

Digital Rise WhatsApp Solutions does not collect, store, or transmit any personal data. When users click the WhatsApp button, they are directed to WhatsApp's platform, which is governed by WhatsApp's privacy policy.

== Credits ==

Developed by Oussama Ben Rejab
Digital Rise Solutions
https://digital-rise-solutions.com/

== Support ==

For support, feature requests, or bug reports, please visit:
https://digital-rise-solutions.com/
