The following is a list of all hooks and filters present in the plugin. Hooks and Filters allow developers to modify or extend the functionality of the Deposits For WooCommerce plugin without directly editing core files.
How can I modify the subject line of the reminder invoice?
Hook:
dfw_reminder_invoice_subject:
Usage:
add_filter( 'dfw_reminder_invoice_subject', 'update_reminder_invoice_subject', 10, 3 );
Parameters: 3
Example:
add_filter( 'dfw_reminder_invoice_subject', 'update_reminder_invoice_subject', 10, 3 ); function update_reminder_invoice_subject( $subject_title, $payment_no, $original_order_no ) { $subject_title = sprintf( __( 'Reminder: Final Payment of Order #%1$s is Due Today.', 'deposits-for-woocommerce' ), $original_order_no ); return $subject_title; }
How can I modify the HTML for the “Payable Today” and “Future Payment” prices?
Hook:
dfw_payable_today_price_figure_html, woocommerce_cart_totals_order_total_html, dfw_future_amount_price_figure_html:
Usage:
add_filter( 'dfw_payable_today_price_figure_html', 'update_payable_today_price_figure' );
Parameters: 1
add_filter( 'woocommerce_cart_totals_order_total_html', 'update_payable_today_price_by_builin_filter' );
Parameters: 1
add_filter( 'dfw_future_amount_price_figure_html', 'update_future_amount_price_figure' );
Parameters: 1
Example:
add_filter( 'dfw_payable_today_price_figure_html', 'update_payable_today_price_figure' ); add_filter( 'woocommerce_cart_totals_order_total_html', 'update_payable_today_price_by_builin_filter' ); function update_payable_today_price_figure( $payable_today ) { return '<strong class="test-class">'. $payable_today .'</strong>'; } function update_payable_today_price_by_builin_filter( $value ) { $value .= '' . sprintf( __( '(incl. VAT & delivery)', 'woocommerce' )). ''; return $value; } add_filter( 'dfw_future_amount_price_figure_html', 'update_future_amount_price_figure' ); function update_future_amount_price_figure( $future_amount ) { if( is_array( $future_amount ) ) { $future_amount = implode( " ", $future_amount ); } return '<strong class="test-class" >'. $future_amount .'</strong>'; }
How can I hide the payment plan based on the dates selected in the WC Booking plugin?
Hook:
dfw_hide_plans_based_on_days_count_from_today:
Usage:
add_filter( 'dfw_hide_plans_based_on_days_count_from_today', '__return_true' );
Parameters: None
Example:
add_filter( 'dfw_hide_plans_based_on_days_count_from_today', '__return_true' );
How can I change the text “Payable Today”?
Hook:
dfw_payable_today_label:
Usage:
add_filter( 'dfw_payable_today_label', 'dfw_payable_today_label_callback' );
Parameters: None
Example:
add_filter( 'dfw_payable_today_label', 'dfw_payable_today_label_callback' ); function dfw_payable_today_label_callback() { return 'Deposit Payable Today'; }
How can I change the text “Future Payments”?
Hook:
dfw_future_amount_label:
Usage:
add_filter( 'dfw_future_amount_label', 'dfw_future_amount_label_callback' );
Parameters: None
Example:
add_filter( 'dfw_future_amount_label', 'dfw_future_amount_label_callback' ); function dfw_future_amount_label_callback() { return 'Remaining Future Payments'; }
How can I change the text “Total Cart Amount”?
Hook:
dfw_total_amount_label:
Usage:
add_filter( 'dfw_total_amount_label', 'dfw_total_amount_label_callback' );
Parameters: None
Example:
add_filter( 'dfw_total_amount_label', 'dfw_total_amount_label_callback' ); function dfw_total_amount_label_callback() { return 'Whole Cart Total'; }
How can I change the text “Pay Deposit”?
Hook:
dfw_pay_deposit_button_label:
Usage:
add_filter( 'dfw_pay_deposit_button_label', 'dfw_pay_deposit_button_label_callback' );
Parameters: None
Example:
add_filter( 'dfw_pay_deposit_button_label', 'dfw_pay_deposit_button_label_callback' ); function dfw_pay_deposit_button_label_callback() { return 'Pay Advance'; }
How can I change the text “Pay Full Amount”?
Hook:
dfw_full_amount_button_label:
Usage:
add_filter( 'dfw_full_amount_button_label', 'dfw_full_amount_button_label_callback' );
Parameters: None
Example:
add_filter( 'dfw_full_amount_button_label', 'dfw_full_amount_button_label_callback' ); function dfw_full_amount_button_label_callback() { return 'Pay Full'; }