- Posts: 142
- Thank you received: 1
- Community Forum
- Appointment Booking Pro - Retired, no longer for sale or supported.
- ABPro 4.0.x
- How do I show valid extras in Messages
How do I show valid extras in Messages
- Ross
- Topic Author
- Offline
- Expert Boarder
Less
More
8 years 5 months ago #20765
by Ross
How do I show valid extras in Messages was created by Ross
Hi Rob,
How can I show valid (i.e extras with values greater than 0) extras ONLY in my messages using tokens?
I would like to, along with the resource and resource price, also list the extras and costs of each extra, in my messages to my client.
Is there a way to do this easily?
Thanks,
Ross.
How can I show valid (i.e extras with values greater than 0) extras ONLY in my messages using tokens?
I would like to, along with the resource and resource price, also list the extras and costs of each extra, in my messages to my client.
Is there a way to do this easily?
Thanks,
Ross.
Please Log in to join the conversation.
- Rob
- Offline
- Administrator
Less
More
- Posts: 4785
- Karma: 103
- Thank you received: 673
8 years 5 months ago - 8 years 5 months ago #20766
by Rob
Replied by Rob on topic How do I show valid extras in Messages
The token system replaces the token with the value stored in the booking.
As 0 is a valid indicator that the customer chose to not add that extra, it is shown.
A single line of code can be used to hide the token and not show a 0 however, as the token system can only deal with tokens, any label text you have placed in the message will stay in the message. The token system has no ability to remove text from your message.
To have ABPro remove the token and not show a 0 for an Extra, edit file:
\administrator\components\com_rsappt_pro3\sendmail_pro2.php
Around line 537 look for:
$msg_text = str_replace("[".$extra->extras_label."]", $extra_item_qty, $msg_text);
Add red code immediately before that line:
if($extra_item_qty == 0){$extra_item_qty = "";}
$msg_text = str_replace("[".$extra->extras_label."]", $extra_item_qty, $msg_text);
As 0 is a valid indicator that the customer chose to not add that extra, it is shown.
A single line of code can be used to hide the token and not show a 0 however, as the token system can only deal with tokens, any label text you have placed in the message will stay in the message. The token system has no ability to remove text from your message.
To have ABPro remove the token and not show a 0 for an Extra, edit file:
\administrator\components\com_rsappt_pro3\sendmail_pro2.php
Around line 537 look for:
$msg_text = str_replace("[".$extra->extras_label."]", $extra_item_qty, $msg_text);
Add red code immediately before that line:
if($extra_item_qty == 0){$extra_item_qty = "";}
$msg_text = str_replace("[".$extra->extras_label."]", $extra_item_qty, $msg_text);
Last edit: 8 years 5 months ago by Rob.
Please Log in to join the conversation.
- Ross
- Topic Author
- Offline
- Expert Boarder
Less
More
- Posts: 142
- Thank you received: 1
8 years 5 months ago #20767
by Ross
Replied by Ross on topic How do I show valid extras in Messages
Hi Rob,
Thanks for this code.
One question, if I have a list of all my extras coded in my message, each on a different line, under each other (see below), how can I change the code to delete a extra and it's line, in the message with a "0"?
For example:
...message...
Extra 1 (0)
Extra 2 (0)
Extra 3 (1)
Extra 4 (0)
I would like it to appear like this below, after the code is executed:-
...message...
Extra 3 (1)
Is this possible?
Thanks,
Ross.
Thanks for this code.
One question, if I have a list of all my extras coded in my message, each on a different line, under each other (see below), how can I change the code to delete a extra and it's line, in the message with a "0"?
For example:
...message...
Extra 1 (0)
Extra 2 (0)
Extra 3 (1)
Extra 4 (0)
I would like it to appear like this below, after the code is executed:-
...message...
Extra 3 (1)
Is this possible?
Thanks,
Ross.
Please Log in to join the conversation.
- Ross
- Topic Author
- Offline
- Expert Boarder
Less
More
- Posts: 142
- Thank you received: 1
8 years 5 months ago #20768
by Ross
Replied by Ross on topic How do I show valid extras in Messages
Hi Rob,
Sorry, I think you answered my question in your previous response. Is this correct?
Ross.
Sorry, I think you answered my question in your previous response. Is this correct?
Ross.
Please Log in to join the conversation.
- Rob
- Offline
- Administrator
Less
More
- Posts: 4785
- Karma: 103
- Thank you received: 673
8 years 5 months ago #20769
by Rob
Replied by Rob on topic How do I show valid extras in Messages
No, that is not possible, sorry.I would like it to appear like this below, after the code is executed:-
...message...
Extra 3 (1)
Is this possible?
Please Log in to join the conversation.
- Ross
- Topic Author
- Offline
- Expert Boarder
Less
More
- Posts: 142
- Thank you received: 1
8 years 5 months ago #20770
by Ross
Replied by Ross on topic How do I show valid extras in Messages
I had a look at the tokens at the bottom of the Global message.
Is there a [extras_price_total] token or any other tokens not listed that can be used with extras, apart from the actual extra label?
Thanks,
Ross.
Is there a [extras_price_total] token or any other tokens not listed that can be used with extras, apart from the actual extra label?
Thanks,
Ross.
Please Log in to join the conversation.
- Rob
- Offline
- Administrator
Less
More
- Posts: 4785
- Karma: 103
- Thank you received: 673
8 years 5 months ago #20771
by Rob
Replied by Rob on topic How do I show valid extras in Messages
The total sum or the extras costs are not stored in the booking directly, but the total is calculated in the token parsing, and can be displayed with the token [extras_total]
Please Log in to join the conversation.
- Community Forum
- Appointment Booking Pro - Retired, no longer for sale or supported.
- ABPro 4.0.x
- How do I show valid extras in Messages
Time to create page: 0.124 seconds