Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/drizy/wc-partial-payment/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
WooCommerce Partial Payment Plugin
This plugin adds a partial payment option to the WooCommerce checkout page. Customers can choose to pay a percentage of the total order amount upfront, with the remaining balance to be paid later. The plugin also applies a discount to the total when the partial payment option is selected.
Features
- Partial Payment Option: Add a checkbox to the checkout page for customers to choose partial payment.
- Dynamic Calculations: Calculate the partial payment amount and balance dynamically using AJAX.
- Discounts: Apply a discount to the total when the partial payment option is selected.
- Admin Settings: Configure the partial payment percentage, discount percentage, and enable/disable the feature from the WooCommerce settings page.
- Order Summary Update: Dynamically update the order summary to display the "Amount to be paid" and "Balance" when the partial payment option is selected.
Installation
-
Download the Plugin:
- Download the plugin ZIP file from the repository.
-
Install the Plugin:
- Go to your WordPress admin dashboard.
- Navigate to Plugins > Add New > Upload Plugin.
- Upload the ZIP file and click Install Now.
-
Activate the Plugin:
- After installation, click Activate Plugin.
-
Configure Settings:
- Go to WooCommerce > Settings > General.
- Scroll down to the Partial Payment section.
- Configure the following settings:
- Enable Partial Payment: Enable or disable the feature.
- Partial Payment Percentage: Set the percentage of the total to be paid upfront.
- Partial Payment Discount Percentage: Set the discount percentage applied when partial payment is selected.
Usage
-
Checkout Page:
- On the checkout page, customers will see a "Pay Partially?" checkbox.
- If the checkbox is checked:
- A discount is applied to the total.
- The "Amount to be paid" and "Balance" are displayed below the order total.
- If the checkbox is unchecked, the total resets to the original amount.
-
Order Summary:
- The "Amount to be paid" and "Balance" are dynamically updated without reloading the page.
Code Structure
PHP Files
- Main Plugin File:
woocommerce-partial-payment.php- Contains the plugin header, settings, and hooks for partial payment functionality.
JavaScript Files
- partial-payment.js:
- Handles AJAX requests and DOM manipulation to update the order summary dynamically.
Customization
Modify Partial Payment Percentage
To change the default partial payment percentage, update the following line in the add_partial_payment_settings function:
'default' => '30', // Change this value