> For the complete documentation index, see [llms.txt](https://docs.stylemixthemes.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stylemixthemes.com/cost-calculator-builder/develeopers-guide/cost-calculator-hooks/confirmation-page.md).

# Confirmation Page

### **ccb\_confirmation\_add\_button**&#x20;

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:**

```php
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**&#x20;

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:**

```php
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:**

```php
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**&#x20;

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

**Parameters:**

* **$default\_class(String)**
* **$calc\_id(Integer)**

**Example:**

```php
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**&#x20;

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

**Parameters:**

* **$default\_class(String)**
* **$calc\_id(Integer)**

**Example:**

```php
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**&#x20;

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

**Parameters:**

* **none**

**Example:**

```php
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**&#x20;

This hook triggers when a custom button is clicked.&#x20;

**Parameters:**

* **none**

**Example:**

```php
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**&#x20;

This hook is triggered when the share pdf button is clicked.&#x20;

**Parameters:**

* **none**

**Example:**

```php
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**&#x20;

This hook is triggered when the button is clicked back.&#x20;

**Parameters:**

* **none**

**Example:**

```php
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**&#x20;

This hook is triggered when a custom button is clicked.&#x20;

**Parameters:**

* **none**

**Example:**

```php
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);
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stylemixthemes.com/cost-calculator-builder/develeopers-guide/cost-calculator-hooks/confirmation-page.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
