WP Manifestindependent plugin directory
manifest / ecommerce / wc-partial-payment

WC Partial Payment

Custom WordPress plugin to add partial payment option to WooCommerce checkout and order table.

by Tabi Idris · github.com/drizy/wc-partial-payment

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/drizy/wc-partial-payment/archive/refs/heads/main.zip

Readme

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

  1. Download the Plugin:

    • Download the plugin ZIP file from the repository.
  2. Install the Plugin:

    • Go to your WordPress admin dashboard.
    • Navigate to Plugins > Add New > Upload Plugin.
    • Upload the ZIP file and click Install Now.
  3. Activate the Plugin:

    • After installation, click Activate Plugin.
  4. 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

  1. 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.
  2. 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

Read the full README on GitHub →