Cost Calculator Builder
Item PageVideo TutorialsChangelogResources Get Started
  • Cost Calculator Builder Documentation
  • Getting Started
    • Free Version and Pro Version
    • System Requirements
    • Plugin Installation
    • License Activation
      • Upgrading the License
    • Update Billing Details and Access Invoices
    • License Utilization
    • Update The Plugin
    • Templates
    • Feature Request
  • Plugin Features
    • How to Create a Calculator
    • How to Manage Calculators
    • How to Add a Calculator to the Page
    • Calculator Appearance
    • Additional Classes
  • Cost Calculator Settings
    • Calculator Settings
      • Summary Block
      • Currency
      • Warning Texts
      • Confirmation Page
      • Order Form
      • Form Manager
      • Sticky Calculator
      • Woo Products
      • Woo Checkout
      • Payments
      • Webhooks
    • Global Settings
      • Currency (Global)
      • PDF Entries
      • Share Quote Form
      • Order Form (Global)
      • Email Template
      • Backup Settings
      • AI Formula
      • Captcha
      • Payments (Global)
      • Geolocation
  • Calculator Elements
    • General Overview
    • Text
    • Quantity
    • Validated form
    • Dropdown list
    • Image Dropdown (Pro feature)
    • Radio Select
    • Image Radio (Pro feature)
    • Switch Toggle
    • Checkbox
    • Image Checkbox (Pro feature)
    • Date Picker (Pro feature)
    • Time Picker (Pro feature)
    • Basic Slider
    • Multi Range (Pro feature)
    • File Upload (Pro feature)
      • How to Allow Additional File Types in WordPress
      • How to Increase Maximum File Upload Size in WordPress
    • HTML
    • Geolocation (Pro feature)
    • Line
    • Formula
      • AI Assistant (Pro feature)
    • Repeater (Pro feature)
    • Group Field (Pro feature)
    • Page Breaker (Pro feature)
  • Conditional System
    • Introduction
    • How to Create a Condition
    • Condition Options
    • Condition Actions
    • AND/OR Conditions
    • Condition Creating Example
  • Special Plugin Features
    • Orders
    • Discounts
    • Required Fields
    • Contact Form 7 Plugin
  • Payments
    • Settings
    • PayPal
    • Stripe
    • Razorpay
    • Cash Payment
  • Translating Cost Calculator Into a Different Language
    • Translation Basics
    • Translating Static Strings
    • Translating Calculator with WPML
    • FAQ
  • Develeoper's guide
    • Cost Calculator Hooks
      • Order Management
      • Contact Form
      • Confirmation Page
      • Email
  • Troubleshooting
    • Introduction
    • Plugin Conflicts
    • Theme Compatibility
    • Calculator is not loading
    • Cache Settings
    • Email not sending
    • Debug Logs
    • Submit a Support Ticket
  • Changelog
    • Release Notes
    • Changelog (Free Version)
    • Changelog (Pro Version)
  • Pre-built Calculators & Cases
    • Service Booking
    • Graphic Design
    • Loan Interest
    • Delivery Service
    • Renovation Company
    • Dental Services
    • Car Wash Company
    • Medical Services
    • Tuition Fees
    • Printing Services
    • Car Rental
    • Venue Rental Service
  • Advanced Topics
    • License Management
  • Stylemixthemes
    • Cost Calculator Builder WordPress Plugin
    • Themes
    • Plugins
Powered by GitBook
On this page
  • ccb_confirmation_add_button
  • ccb_customize_confirmation_page
  • ccb_confirmation_custom_button_styles
  • ccb_confirmation_back_button_styles
  • ccb_confirmation_pdf_button_styles
  • wp_ajax_ccb_confirmation_pdf_button_action
  • wp_ajax_ccb_confirmation_pdf_button_action
  • wp_ajax_ccb_confirmation_pdf_button_action
  • wp_ajax_ccb_confirmation_back_button_action
  • wp_ajax_ccb_confirmation_custom_button_action

Was this helpful?

  1. Develeoper's guide
  2. Cost Calculator Hooks

Confirmation Page

These hooks let developers customize Confirmation Page in the Cost Calculator.

ccb_confirmation_add_button

This hook allows you to add an additional button, customButtonFunction is specified here, which triggers the hook when the button is pressed - ccb_confirmation_custom_button_action

Parameters:

  • $calc_id(Integer)

Example:

add_action('ccb_confirmation_add_button', 'add_custom_button', 10, 1);

function add_custom_button($calc_id) {
if($calc_id == 257){ //change 257 to the ID of your calculator
echo '<div>
<button class="calc-secondary" @click.prevent="customButtonFunction">
<span>Custom button</span>
</button>
  </div>';
}
}

ccb_customize_confirmation_page

This hook allows you to customize the page - customize text, customize order details view, change the label of all existing buttons in the page, etc.

Parameters:

  • $page_settings(Array)

  • $calc_id(Integer)

Example:

add_filter('ccb_customize_confirmation_page', 'customize_thankyou_page', 10, 2);
function customize_thankyou_page($page_settings, $calc_id){
$page_settings['description'] = "This is a demo description";
$page_settings['title'] = "This is a demo title";
$page_settings['back_button_text'] = "Back button label";
$page_settings['download_button_text'] = "Download button label";
$page_settings['share_button_text'] = "Share button label";
$page_settings['custom_button_text'] = "Custom button label";
$page_settings['download_button'] = true;
return $page_settings;
} 

ccb_confirmation_custom_button_styles

This hook allows you to add your own class to a custom button

Parameters:

  • $default_class(String)

  • $calc_id(Integer)

Example:

add_filter('ccb_confirmation_custom_button_styles', 'customize_class_custom_button', 10, 2);
function customize_class_custom_button($default_class, $calc_id){
if($calc_id == 267){
$default_class .= ' custom_class';
}

return $default_class;
}

ccb_confirmation_back_button_styles

This hook allows you to add your own class to the back button

Parameters:

  • $default_class(String)

  • $calc_id(Integer)

Example:

add_filter('ccb_confirmation_back_button_styles', 'customize_class_back_button', 10, 2);
function customize_class_back_button($default_class, $calc_id){
if($calc_id == 267){
$default_class .= ' custom_class';
}

return $default_class;
}

ccb_confirmation_pdf_button_styles

This hook allows you to add your class to the download pdf button.

Parameters:

  • $default_class(String)

  • $calc_id(Integer)

Example:

add_filter('ccb_confirmation_pdf_button_styles', 'customize_class_pdf_button', 10, 2);
function customize_class_pdf_button($default_class, $calc_id){
if($calc_id == 267){
$default_class .= ' custom_class';
}

return $default_class;
}

wp_ajax_ccb_confirmation_pdf_button_action

This hook is triggered when the download pdf button is clicked.

Parameters:

  • none

Example:

use cBuilder\Classes\CCBCalculators;
add_action('wp_ajax_ccb_confirmation_pdf_button_action', 'invoice_button_pressed');

function invoice_button_pressed(){
check_ajax_referer('ccb_wp_hook_nonce', 'nonce');
$calc_list= CCBCalculators::get_calculator_list();
$result = array(
'success' => true,
'calc_list' => $calc_list,
'message' => 'Calculator list has been successfully retrieved.',
);

wp_send_json($result);
}

wp_ajax_ccb_confirmation_pdf_button_action

This hook triggers when a custom button is clicked.

Parameters:

  • none

Example:

add_action('wp_ajax_ccb_confirmation_custom_button_action', 'custom_button_pressed');

function custom_button_pressed(){
check_ajax_referer('ccb_wp_hook_nonce', 'nonce');
$calc_list= CCBCalculators::get_calculator_list();
$result = array(
'success' => true,
'calc_list' => $calc_list,
'message' => 'Calculator list has been successfully retrieved.',
);

wp_send_json($result);
}

wp_ajax_ccb_confirmation_pdf_button_action

This hook is triggered when the share pdf button is clicked.

Parameters:

  • none

Example:

add_action('wp_ajax_ccb_confirmation_share_pdf_button_action', 'share_pdf_button_pressed');

function share_pdf_button_pressed(){
check_ajax_referer('ccb_wp_hook_nonce', 'nonce');
$calc_list= CCBCalculators::get_calculator_list();
$result = array(
'success' => true,
'calc_list' => $calc_list,
'message' => 'Calculator list has been successfully retrieved.',
);

wp_send_json($result);
}

wp_ajax_ccb_confirmation_back_button_action

This hook is triggered when the button is clicked back.

Parameters:

  • none

Example:

add_action('wp_ajax_ccb_confirmation_back_button_action', 'back_button_pressed');

function back_button_pressed(){
check_ajax_referer('ccb_wp_hook_nonce', 'nonce');
$calc_list= CCBCalculators::get_calculator_list();
$result = array(
'success' => true,
'calc_list' => $calc_list,
'message' => 'Calculator list has been successfully retrieved.',
);

wp_send_json($result);
}

wp_ajax_ccb_confirmation_custom_button_action

This hook is triggered when a custom button is clicked.

Parameters:

  • none

Example:

add_action('wp_ajax_ccb_confirmation_custom_button_action', 'custom_button_pressed');

function back_button_pressed(){
check_ajax_referer('ccb_wp_hook_nonce', 'nonce');
$calc_list= CCBCalculators::get_calculator_list();
$result = array(
'success' => true,
'calc_list' => $calc_list,
'message' => 'Calculator list has been successfully retrieved.',
);

wp_send_json($result);
}
PreviousContact FormNextEmail

Last updated 1 year ago

Was this helpful?