WP Manifestindependent plugin directory
manifest / ecommerce / woo-rental-plugin-wordpress

WooCommerce Car Rental & Features Ecosystem

An all-in-one extensive plugin handling Car Rentals, Wallet Funds, Point & Reward, Invoices, and Affiliate management based on WooCommerce.

by Asyraf Digital · github.com/asyrafpauzi/woo-rental-plugin-wordpress

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/asyrafpauzi/woo-rental-plugin-wordpress/archive/refs/heads/main.zip

WooCommerce Car Rental & Features Ecosystem (WCRE)

WordPress plugin that extends WooCommerce with car rental bookings, customer wallet top-ups, loyalty points, PDF invoices, and a basic affiliate referral flow.

Text domain: wcre
Requires: WordPress 5.3+, WooCommerce (active)


Installation

  1. Copy the plugin folder into your site’s plugins directory, for example:
    • wp-content/plugins/woo-car-rental-ecosystem/
  2. Ensure the main file is:
    • woo-car-rental-ecosystem.php (at the root of that folder).
  3. In WordPress Admin → Plugins, activate WooCommerce Car Rental & Features Ecosystem.
  4. WooCommerce must be installed and active first. If it is missing, the plugin shows an admin notice and does not load its features.

After activation, visit Settings → Permalinks and click Save once (flushes rewrite rules for My Account endpoints).


What each module does

Module Purpose
Car rental Custom product type with pickup/return dates, locations, daily pricing, and inventory overlap checks.
Wallet “Wallet Top-up” product type; balance and checkout fee discount; My Account → Wallet.
Points & rewards Points on completed orders; redeem at checkout; WooCommerce → Settings → Rewards (WCRE); My Account → Reward points.
Invoice PDF PDF invoice for completed orders (email attachment + download on orders list) when Dompdf is available.
Affiliate ?ref={user_id} cookie; commission to wallet on completed orders; My Account → Affiliate (withdrawals).

Car rental products

1. Create a car rental product

  1. Products → Add New (or edit an existing product).

  2. In Product data, set Product type to Car Rental.

  3. Fill in:

    • Total vehicles in this group — used for availability. Overlapping bookings (same product) across orders are counted; if this number is 0 or empty, inventory checks are skipped (useful while testing).
    • Base daily price (RM) — also syncs to the product’s regular price for WooCommerce.
    • Available locations — comma-separated codes (e.g. JB, KL, PG). These appear as pickup/return dropdowns on the product page.
  4. Publish the product.

The plugin registers woocommerce_car_rental_add_to_cart and loads WooCommerce’s simple add-to-cart template so the booking fields (hooked to woocommerce_before_add_to_cart_button) and the Add to cart button both render. Without that, custom product types output no add-to-cart area by default.

2. Customer flow

  1. Open the product on the storefront.
  2. Choose pickup date, return date, pickup location, and return location, then add to cart.
  3. Rental total = daily rate × inclusive calendar days (same day pickup and return = 1 day).
  4. Checkout as usual. Booking details are stored on the order line item.

3. Inventory

The plugin counts existing orders (statuses such as pending, processing, on-hold, completed by default) whose line items use the same product and whose Pickup Date / Return Date ranges overlap the new request. If the count is greater than or equal to “Total vehicles in this group”, add to cart is blocked.

Developers can adjust which order statuses count with the filter wcre_inventory_order_statuses.


Wallet top-up

  1. Create a product and set Product type to Wallet Top-up.
  2. Set the price to the amount customers should receive per unit purchased (e.g. one quantity = RM 100 top-up).
  3. When an order containing that product is marked Completed, the customer’s wallet is credited (logged user only).
  4. Wallet balance can be applied at checkout (see the wallet module behaviour on your site). Customers see Wallet under My Account after the endpoint is registered (flush permalinks if the link 404s).

Points and rewards

  1. Go to WooCommerce → Settings → Rewards (WCRE).
  2. Configure:
    • Points per currency unit (on order total) — e.g. 1 means about one point per unit of order total when the order completes.
    • Points per 1 currency unit of discount — e.g. 100 means 100 points redeem for 1 unit of discount at checkout (currency depends on your store).
  3. On the checkout page, logged-in customers with enough points may use Redeem now (AJAX + session).
  4. My Account → Reward points shows balance and history.

If the menu item is missing, save Permalinks again.


PDF invoices

The plugin ships Dompdf via Composer (composer.json in the plugin root). The vendor/ folder must be present on the server (it is created when you run composer install --no-dev in the plugin directory). If you deploy only PHP files without vendor/, SSH into the server and run:

cd wp-content/plugins/woo-car-rental-ecosystem
composer install --no-dev

Requirements: PHP 7.4+, and the PHP extensions Dompdf needs (typically mbstring, dom, gd or imagick for some features).

When generation fails, completed-order emails may not attach a PDF; the download action will show an error until vendor/autoload.php exists.


Affiliates (basic)

  • Share links with query parameter: https://yoursite.com/?ref=123 where 123 is the WordPress user ID of the affiliate.
  • A cookie stores the referral (default 30 days). When a referred order is completed, commission (see plugin code / default rate) can be credited to the affiliate’s wallet.
  • Affiliates use My Account → Affiliate for dashboard / withdrawal requests (per plugin implementation).

Styling and assets

The plugin enqueues Outfit (Google Fonts) and assets/css/wcre-style.css on product, cart, checkout, and account pages by default. Other themes can override with CSS.

To force assets on more pages, use the filter:

add_filter( 'wcre_enqueue_frontend_assets', '__return_true' );

Troubleshooting

Issue What to try
404 on Wallet / Reward points / Affiliate Settings → Permalinks → Save.
Car rental scripts not loading Confirm product type is Car Rental and you are on the single product URL.
No pickup fields / no Add to cart 1) Product type Car Rental. 2) Inventory tab: set Stock status to In stock (or manage stock with quantity > 0). 3) Site Editor / block single product: use plugin 1.0.1+, which replaces WooCommerce add-to-cart blocks with the classic PHP form for car_rental. 4) If it still fails, under WooCommerce → Status → Tools, run Clear template cache and clear any page cache.
PDF invoice missing Ensure vendor/ exists (composer install --no-dev in the plugin folder). Check PHP error logs if it still fails.
Points values look wrong Check WooCommerce → Settings → Rewards (WCRE) ratios.

Test data (seeder)

For staging/playground only, you can load dummy users, wallet rows, points, a completed referral order (affiliate commission → wallet), and a wallet top-up order.

Option A — WordPress admin (no SSH)

  1. Log in as an Administrator.
  2. Go to Tools → WCRE Test Seeder.
  3. Set Car rental product ID (default 16923) and click Run seeder.
  4. Read the Last run output box on the same screen.

Example for a site in a subfolder:

https://yiboncreative.com/playground/wp-admin/tools.php?page=wcre-test-seeder

Option B — Secret URL (no SSH, no wp-admin)

  1. In wp-config.php (above /* That's all, stop editing! */), add a long random string:
define( 'WCRE_SEED_SECRET', 'paste-a-long-random-string-here-change-me' );
  1. Visit (replace the secret with the same string):

https://yiboncreative.com/playground/?wcre_run_seeder=1&key=paste-a-long-random-string-here-change-me&product_id=16923

  1. You should see plain text log output. Remove the define( 'WCRE_SEED_SECRET', ... ) line from wp-config.php when you are done testing.

If the constant is not set, the URL returns a short error (this prevents strangers from running the seeder).

Option C — WP-CLI

Requirements: WP-CLI installed on the server, SSH access, and this plugin active.

From the WordPress root (where wp-config.php lives):

wp wcre seed
wp wcre seed --product-id=16923

Default product id is 16923. The seeder sets _car_inventory_count = 5 on that product (your “5 cars in one product” case) and ensures base price meta exists.

What gets created

Item Purpose
Users wcre_seeder_affiliate, wcre_seeder_customer, wcre_seeder_buyer Log in to test Affiliate Hub, Wallet, Reward points (password printed in CLI output; filter wcre_seeder_user_password to override).
Wallet credits/debits Customer: +120 / −20 seeder lines; affiliate: +50 starter; commission from completed order adds 5% of order total to the affiliate wallet.
Points +750 earned for the customer (history under Reward points).
Completed order Buyer purchases your car rental product; order meta _wcre_affiliate_id = affiliate user → triggers the same hooks as a real referral checkout.
Product WCRE Test Wallet Top-up (SKU wcre-seed-wallet-topup) Optional Wallet Top-up product + completed order to test wallet credit from top-up.

How to verify

  1. Wallet: Log in as wcre_seeder_customerMy Account → My Wallet Fund — see transactions and balance.
  2. Affiliate: Log in as wcre_seeder_affiliateAffiliate Hub — referral link is yoursite.com/?ref={USER_ID}; wallet should show commission + starter credit.
  3. Points: Log in as wcre_seeder_customerReward points.
  4. Rental inventory: Product 16923 is set to 5 vehicles; overlapping bookings are counted from completed/processing orders that have Pickup Date / Return Date on line items.

Do not run the seeder on a live shop with real customers (creates users and orders). Do not leave WCRE_SEED_SECRET defined on production.


For developers

  • Inventory statuses: wcre_enqueue_frontend_assets, wcre_inventory_order_statuses.
  • Custom tables: wp_wcre_wallet_transactions, wp_wcre_points_transactions, wp_wcre_withdrawals (prefix matches your $wpdb->prefix).

License / support

This README describes usage only. Refer to your project or vendor for license terms and support channels.