WP Manifestindependent plugin directory
manifest / ecommerce / next-order-plus-upselling-wp-plugin

Next Order Plus

Enhanced WooCommerce promotion system with advanced upselling rules. Configure customizable conditions and discounts based on cart contents.

by Omar Hosam · github.com/omarhosamcodes/next-order-plus-upselling-wp-plugin

0stars
1forks

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/omarhosamcodes/next-order-plus-upselling-wp-plugin/archive/refs/heads/main.zip

A highly optimized WooCommerce plugin that automatically applies a "Next Order Plus Upselling Features" promotional discount.

Features

  • Automatic Discount Application: When a customer adds 4 or more items to their cart, the cheapest item becomes free.
  • Multiple Discounts: For every 4 items, an additional free item is applied (e.g., 8 items = 2 free items).
  • Full Compatibility: Works with both Classic and Block Cart/Checkout experiences.
  • Mini-Cart Support: Displays the discount in the mini cart dropdown.
  • Shipping Rule Integration: Optionally disables free shipping when discount is applied.
  • Coupon Restrictions: Prevents specific coupons from being used together with this promotion.
  • Admin Settings: Fully customizable through dedicated admin interface.
  • Order Statistics: Track the total number and amount of discounts applied.

Technical Architecture

Core Components

  1. Base Class System:

    • Abstract foundation class for all services
    • Type declarations and error handling
  2. Service Modules:

    • NOP_Discount_Service: Core discount calculation logic
    • NOP_Cart_Service: Cart interaction and discount application
    • NOP_Assets_Service: JS/CSS resource management
    • NOP_Coupon_Service: Coupon validation and error handling
    • NOP_Admin_Service: Admin interface and settings management
  3. Utility Classes:

    • NOP_Logger: Debug logging capabilities

Design Principles

  • Modular Architecture: Each service has a single responsibility
  • Performance Optimized: Debounced AJAX requests prevent API spam
  • Maintainable Code: Well-documented with full PHPDoc support
  • Extensible Design: Filterable settings and hooks for customization
  • Robust Error Handling: Graceful degradation on errors

Installation

  1. Upload the next-order-plus folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Ensure WooCommerce is installed and activated
  4. Configure settings via WooCommerce > Next Order Plus or SOM Plugins > Next Order Plus

Admin Settings

The plugin offers a comprehensive settings page with the following options:

  • Discount Label: Customize the text displayed in the cart/checkout
  • Minimum Items: Set the threshold for when the discount applies (default: 4)
  • Excluded Coupons: Specify coupon codes that cannot be used with this promotion
  • Disable Free Shipping: Option to disable free shipping when discount is applied
  • Debug Mode: Enable/disable detailed logging for troubleshooting

Customization

The plugin provides several filters for programmatic customization:

  • nop_excluded_coupons: Modify the list of disallowed coupons
  • nop_load_assets_globally: Control whether assets are loaded on all pages
  • nop_discount_label: Customize the discount label text
  • nop_min_items_for_discount: Override the minimum items required for discount

Compatibility

  • WordPress 5.6+
  • WooCommerce 6.0+
  • PHP 7.4+
  • Compatible with most WooCommerce themes and plugins

Support

For issues or feature requests, please contact the plugin author.

Credits

Originally based on the "Buy 4 Get Cheapest Free" promotion concept, rewritten and optimized for modern WordPress and WooCommerce.