# WooCommerce Deposits

Last updated: December 6, 2019 by Webtomizer

## Introduction

Thank you for purchasing our plugin. If this document doesn't answer your questions or if you have any customization requests please feel free to submit a private ticket in support forum.

### Description

WooCommerce Deposits is a premium WordPress and WooCommerce plugin for handling partial payments. Customers pay a fixed price or percentage up front. You can also force a deposit. WooCommerce Deposits is fully compatible with the WooCommerce Bookings plugin, allowing you to collect deposits on bookings as well as other products.

### Features List

- Accept or force deposits on products in your store.
- Checkout mode to make deposits cart based and deposit option button located in checkout
- Automatic email reminders to pay remaining amount after speific number of days
- Select deposit type: Fixed value or percentage.
- Customers can pay the remaining amount later by logging in.
- Disable or enable deposits site-wide with a single click.
- Disable specific payment gateways when there’s a deposit in cart.
- Display custom messages when the deposit option is chosen.
- Add new deposits from the order editor in the admin back-end.
- Built for WooCommerce: Designed from the ground up to work with WooCommerce.
- Compatible with WooCommerce Bookings: Multiply the deposit by persons on your bookings or collect a percentage of the total value.
- Deposit reports are available in the WooCommerce reports panel.
- Fully translatable: Compatible with WPML.
- Comes pre-translated in the following languages: Arabic, Dutch, English, French, German, and Spanish.

## Installation

### Requirements

- WordPress : WordPress is the most popular CMS in the world which makes it a great choice for your website
- WooCommerce : WooCommerce is a free eCommerce plugin that allows you to sell anything, beautifully. Built to integrate seamlessly with WordPress, WooCommerce is the world's favorite eCommerce solution that gives both store owners and developers complete control.
- PHP version : 5.6 and higher

Make sure your WordPress website and WooCommerce is set up properly and you will be able of starting using this plugin directly

### Package from CodeCanyon

After purchasing this plugin, the first step is to download te package from CodeCanyon. You can find the item in your Downloads page, click Download button next to plugin name All files & documentation

The downloaded file will include documentation, license and zipped installable file, unpack the entire package after download is completed

You can complete the installation in either of the following two ways:

1. WordPress Plugins Manager : Please go to Plugins >> Add New, click on Upload Plugin, select the zipped plugin folder called WooCommerce-deposits.zip and press Install Now

2. FTP Upload : unpack zipped WooCommerce-deposits file, then upload unpacked folder to /wp-content/plugins/ folder in the WordPress installation folder on your hosting

After that you need to activate installed plugin, by pressing Activate button,or by pressing Activate link next to plugin in WordPress Plugins Manager.

## Usage

### Adding a Deposit

Now that plugin is all set, we can proceed with adding deposits.

Plugin default configuration is to work as product-based, where deposit settings has to be set for each product and deposit selection button will be displaying on each single product page.

Plugin can also be switched toCheckout Mode and it will display product option as part of checkout form, deposit will be applied on cart total, we will explain Checkout Mode configuration in a later step.

To set a deposit options for a product , open products manager and select a product or create one if you do not have any

When product page is open, you will find a new tab in Product Data section, named Deposit

This is where you can set up deposit options for selected product, here's a description of what you'll see the following fields:

- Enable deposit : Enable this to require a deposit for this item.
- Force deposit : If you enable this, the customer will not be allowed to make a full payment.
- Amount type : Specify the amount type of deposit, You may choose either Fixed Value or Percentage of price ( cannot be more than 100%)
- Deposit amount : If Fixed value is specified above, you should enter the deposit value in your chosen currency (For example: Dollars). If Percentage of price is chosen, you should enter a percentage instead. (cannot be more than 100%)
- Multiply by Persons: : This is a special field that will only show up for the 'Bookable Product' type. Enabling this will multiply the fixed value by the number of persons in the booking. (Requires the WooCommerce Bookings plugin)

#### Important note

Please note that the final deposit amount will be affected by other factors such as Multiply by Persons fields, or global settings such as tax handling settings ( which will be explained later in this documentation ).

Once you set a deposit amount, check Enable deposit and save your product. You will now see a Deposit section in the product page:

If a deposit is set for a variable product, deposit amount will update dynamically when user changes variations.

### Cart Display

When a customer adds product to cart , this is how an item with deposit would look like in cart :

### Checkout Mode

If you do not prefer to calculate deposit based on products, you can switch plugin to Checkout Mode from plugin settings.

- Enable Checkout Mode : Check this to enable checkout mode, which makes deposits calculate based on total amount during checkout instead of per product
- Amount type : Specify the amount type of deposit, You may choose either Fixed Value or Percentage of Cart Total
- Deposit amount : Amount of deposit ( should not be more than 99 for percentage or more than cart total for fixed value)

When Checkout Mode is enabled, Deposit selection slider will be displayed in checkout form

### Partial Payments Logic

Now that we have an order with deposit, i is important to understand the logic of partial payments added by plugin for smooth operations

Our plugin adds a custom post type ( slug : wcdp_payment ) which is similar to standard woocommerce orders, these posts are named "Partial Payments" Once order is created, if order has a deposit, Partial payments will be created as children posts of the main order, these partial payment posts only serve one purpose which is to be forwarded to checkout and gateways at the time of making payment, the amounts are automatically synced with any changes made to parent order.

### Order Editor

When a customer places an order which has a deposit, on successful payment order status will be partially-paid. You can view deposit information when you select that order from Admin Dashboard >> WooCommerce >> Orders

Deposit and second payment information will be displayed in Partial Payments metabox while totals should appear below order total

#### Important Information

- You can change deposit and second payment values If you change order status from "partially paid" to a status which allows editing orders ( such as pending or on-hold) then change status back to partially paid after adjusting amounts. Alternatively, you can enable the setting "Make partially paid orders editable" from plugin settings to edit partially paid orders (editing deposit amount will delete current partial payment posts and create new ones)

### Handling refunds

The right way to have refund recorded through woocommerce is to issue refund for the main order and then set status to refunded , this is to set numbers right in woocommerce but it does not actually refund any payment through gateway, to refund payment through gateway you need to navigate to partial payment post from "Partial payments" metabox and issue refund through the gateway for the total / partial amount. The partial payments post role is to make sure the amount forwarded and charged by gateway is correct at each payment and to make it easy to refund that payment fully / partially.

### Product based reminders

Second payment reminder emails can be set to trigger as product based , it's a useful feature for date based products such as tours etc

This setting can be found in product editor page ,If you would like to send out second payment reminder emails to all orders containing a specific product on a specific date in the future, set a date in date picker field.

### Settings

#### General Settings

In Admin Dashboard >> WooCommerce >> Settings, you will find a new tab named Deposits.

Click on this tab and you will see the plugin settings in 6 tabs :

#### 1- General Settings Tab

- Disable Deposits :If you check this, all deposits functionality will be disabled.
- Default Selection : Select the initial deposit option to be shown. This also affects the default behaviour for single add to cart buttons.
- Display Taxes : Check this to count taxes as part of deposits for purposes of display to the customer. (in product page & cart)
- Display Deposit-breakdown Tooltip in cart : Check this to display a tooltip next to deposit in cart totals, this tooltip explains deposit cost breakdown)
- Fees Collection Method : Choose how to handle fees available options are : collect wih deposit / split based on deposit % / collect with second payment).
- Taxes Collection Method : Choose how to handle ( available options are : collect wih deposit / split based on deposit % / collect with second payment).
- Shipping Handling Method : Choose how to handle shipping cost ( available options are : collect wih deposit / split based on deposit % / collect with second payment).
- Shipping Taxes Handling Method : Choose how to handle shipping taxes( available options are : collect wih deposit / split based on deposit % / collect with second payment).
- Reduce Stocks On : When to reduce the stock levels. ( on deposit payment or full payment)
- Make partially paid orders editable : By default, partially paid orders are not editable ( same as processing and completed) , when you check this option you override this behaviour.
- Show "has deposit" column in admin order list table : Check to show a column in admin order list indicating if order has deposit.
- Disable deposit for selected user roles : Disable deposit for selected user roles, users having at least one of these roles will not see any deposit related buttons, messages or functionality.
- Restrict deposits for logged-in users only : When this setting is checked, all deposit functionality will be disabled for guests.

#### 2- Display & Text Tab

All front-end strings displaying to user in website and emails can be overridden using this section.

- Override Payment form :allow overriding "form-pay.php" template to display Main order details during partial payment checkout.

###### Buttons

- Use Basic Deposit Buttons :Use basic radio buttons for deposits, Check this if you are facing issues with deposits slider buttons in product page.
- Deposit Buttons Primary Colour : Change Deposit buttons primary color.
- Deposit Buttons Secondary Colour : Change Deposit buttons secondary color.
- Deposit Buttons Highlight Colour : Text displayed in the 'Pay Deposit' button.
- Deposit Button Text : Text displayed in the 'Full Amount' button.

###### Messages

HTML tags allowed are: <A> <BR/> <EM> <STRONG> <p> <s> <strike> <del> <u>

- Deposit Message :Message to show when 'Pay Deposit' is selected on the product's page.
- Full Amount Message :Message to show when 'Full Amount' is selected on the product's page.

#### 3- Checkout Mode Tab

Checkout mode make deposit based on cart items subtotal instead of per-product basis by locating the deposit the button in checkout form directly

- Enable Checkout Mode : Check this to enable checkout mode, which makes deposits calculate based on total amount during checkout instead of per product
- Amount type : Specify the amount type of deposit, You may choose either Fixed Value or Percentage of Cart Total
- Deposit amount : Amount of deposit ( should not be more than 99 for percentage or more than cart total for fixed value)

#### 4- Second Payment & Reminders Tab

- Enable Second Payment : Uncheck this to prevent the customer from making the second payment. (You'll have to manually mark the order as completed)
- Next Custom Reminder Date : If you would like to send out all partial payment reminders on a specific date in the future, set a date in this field (this does not suppress any other automated reminders set).
- Enable Second Payment Reminder after "X" Days : Check this to enable sending second payment reminder email automatically after X number of days of deposit payment. (You can always send a reminder manually from order actions )
- Days before Second Payment is due : Number of days before second payment is due ( leave field empty for unlimited days ) currently this setting is used to determine a date for second payment
- Days before Second Payment reminder : Duration between partial payment and second payment reminder (in days)

#### 5- Gateways Tab

- Disallowed For Deposits : Disallow specific gateways when there is a deposit in the cart.

#### 6- Automatic Updates Tab

- Purchase code : Insert and verify your purchase code to receive automatic updates.

## Hooks Reference

Below is a full list of actions & filters in our plugin

- Actions
  - wc_deposits_enqueue_product_scripts : this action is triggered when deposit buttons template is loaded on single product page
  - wc_deposits_enqueue_deposit_button_scripts : this action is triggered when deposit buttons template is loaded on checkout page when checkout mode is enabled
  - wc_deposits_after_settings_tabs_content : this action could be used to output the html for an extra tab body in plugin settings
  - wc_deposits_settings_tabs_general_tab : this action could be used to output any extra fields in general tab, plugin settings
  - wc_deposits_settings_tabs_display_text_tab : this action could be used to output any extra fields in display & text tab, plugin settings
  - wc_deposits_settings_tabs_checkout_mode_tab : this action could be used to output any extra fields in checkout-mode tab, plugin settings
  - wc_deposits_settings_tabs_second_payment_tab : this action could be used to output any extra fields in second payment tab, plugin settings
  - wc_deposits_settings_tabs_gateways_tab : this action could be used to output any extra fields in gateways tab, plugin settings
- Filters
  - wc_deposits_cart_item_deposit_data : this filter controls the total deposit amount for cart item,or it can be set to disable deposit for cart item if value returned is 0 . variable passed through this filter are $deposit_data , $cart_item
  - woocommerce_deposits_cart_deposit_amount : this filter controls the total deposit amount for cart contents ,or it can be set to disable deposit for cart if value returned is 0. variables passed through this filter are $deposit_amount , $cart_total
  - wc_deposits_deposit_breakdown_tooltip_labels : Labels included in deposit breakdown tooltip (if enabled ) variable passed through this filter is $labels ( array)
  - woocommerce_deposits_tooltip_html : html of deposit breakdown tooltip (if enabled ) variable passed through this filter is $tooltip_html ( string)
  - woocommerce_deposits_tooltip_html : html of deposit breakdown tooltip (if enabled ) variable passed through this filter is $tooltip_html ( string)
  - wc_deposits_product_enable_deposit : controls whether deposit is enabled disabled for a product. variables passed through this filter are $enabled ( boolean) and $product_id
  - wc_deposits_product_force_deposit : controls whether deposit is forced for a product. variables passed through this filter are $forced ( boolean) and $product_id
  - wc_deposits_product_deposit_amount : controls deposit amount for a product. variables passed through this filter are $amount ( float) and $product_id
  - wc_deposits_product_deposit_amount_type : controls deposit amount type for a product. variables passed through this filter are $amount_type ( string , valid values are "fixed" and "percent" ) and $product_id
  - wc_deposits_partial_payment_name : when an order is created with partial payments, during checkout the name of item is 'Partial Payment for order %s' (%s being the parent order ) , this filter allows changing the default value variables passed through this filter are $name (string) , $payment (array) and $order_id (integer)
  - wc_deposits_admin_partial_payment_actions : controls the actions for a single payment in partial payments meta box, order editor. variables passed through this filter are $actions (array) , $payment (array) and $order_id (integer)
  - wc_deposits_settings_tabs : controls the navigation tabs in plugin settings variable passed through this filter is $tabs (array)

## Changelog

Full changelog can be viewed here

## Thank you

Once again, thank you so much for purchasing this plugin. As we have said in the beginning, we'd be glad to help you if you have any questions related to this plugin. We will do our best to provide assistance. If you have more general questions regarding this plugin, you may also consider visiting CodeCanyon's Item page and check comments section

### Need Custom WooCommerce Development?

#### I am available for Freelance hire!

You can contact me through My Website's contact form

Or send me an email to tell me about your project goals and needs. I will be in touch within 24 hours.

Mohamed Ali