Placeholder in infoscreen
-
- Phoca Member
- Posts: 25
- Joined: 05 Apr 2020, 09:10
Placeholder in infoscreen
Hy,
is it possible to use placeholder values e.g. {iban} in the infoscreen at the end of a place order.
In the backend you can set a custom text in the payment options.
Thanks for any hint.
is it possible to use placeholder values e.g. {iban} in the infoscreen at the end of a place order.
In the backend you can set a custom text in the payment options.
Thanks for any hint.
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Placeholder in infoscreen
Hi, there is no option to translate the variables in info view, but there is option to run own plugin code which will get information about the data (order id, user id, etc).
The event which sends the data to plugin and get modified information is called: onPCVonInfoViewDisplayContent
Jan
The event which sends the data to plugin and get modified information is called: onPCVonInfoViewDisplayContent
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Member
- Posts: 25
- Joined: 05 Apr 2020, 09:10
Re: Placeholder in infoscreen
HY Jan,
thanks for the Info.
thanks for the Info.
-
- Phoca Member
- Posts: 25
- Joined: 05 Apr 2020, 09:10
Re: Placeholder in infoscreen
I did it now in a very simple way.
Created an override of view->info->default.php
NEar the the call of the paymentInfo
I added the following lines
After that lines the original code continues
Now you can use every placeholder like in the email contents.
For me it was very important to show some paymentinformations,
because sometimes my infomails got filtered by the SPAM-System and my customers don't always know where to find the SPAM-Folder
Maybe this helps somebody else, or maybe it find its way into the core files.
Created an override of view->info->default.php
NEar the the call of the paymentInfo
Code: Select all
$paymentDescription = PhocacartPayment::getInfoDescriptionById((int)$this->t['infodata']['payment_id']);
Code: Select all
$order = new PhocacartOrderView();
$common = $order->getItemCommon($this->t['infodata']['order_id']);
$orderNumber= PhocacartOrder::getOrderNumber($this->t['infodata']['order_id'], $common->date, $common->order_number);
$bas = $order->getItemBaS($this->t['infodata']['order_id'], 1);
//$totalBrutto= $order->getItemTotal($orderId, 0, 'brutto');
$r = PhocacartText::prepareReplaceText($order, $this->t['infodata']['order_id'], $common, $bas);
$paymentDescription = PhocacartText::completeText($paymentDescription,$r);
Code: Select all
if ($paymentDescription != '') {
echo '<div class="ph-info-payment-description">'.HTMLHelper::_('content.prepare', $paymentDescription).'</div>';
}
For me it was very important to show some paymentinformations,
because sometimes my infomails got filtered by the SPAM-System and my customers don't always know where to find the SPAM-Folder
Maybe this helps somebody else, or maybe it find its way into the core files.
- Jan
- Phoca Hero
- Posts: 48403
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Placeholder in infoscreen
Hi, thank you for this guide.
Jan
Jan
If you find Phoca extensions useful, please support the project
- Nidzo
- Phoca Professional
- Posts: 390
- Joined: 07 Nov 2018, 14:55
Re: Placeholder in infoscreen
Cliffdiver wrote: ↑15 Apr 2024, 20:57 I did it now in a very simple way.
Created an override of view->info->default.php
NEar the the call of the paymentInfoI added the following linesCode: Select all
$paymentDescription = PhocacartPayment::getInfoDescriptionById((int)$this->t['infodata']['payment_id']);
After that lines the original code continuesCode: Select all
$order = new PhocacartOrderView(); $common = $order->getItemCommon($this->t['infodata']['order_id']); $orderNumber= PhocacartOrder::getOrderNumber($this->t['infodata']['order_id'], $common->date, $common->order_number); $bas = $order->getItemBaS($this->t['infodata']['order_id'], 1); //$totalBrutto= $order->getItemTotal($orderId, 0, 'brutto'); $r = PhocacartText::prepareReplaceText($order, $this->t['infodata']['order_id'], $common, $bas); $paymentDescription = PhocacartText::completeText($paymentDescription,$r);
Now you can use every placeholder like in the email contents.Code: Select all
if ($paymentDescription != '') { echo '<div class="ph-info-payment-description">'.HTMLHelper::_('content.prepare', $paymentDescription).'</div>'; }
For me it was very important to show some paymentinformations,
because sometimes my infomails got filtered by the SPAM-System and my customers don't always know where to find the SPAM-Folder
Maybe this helps somebody else, or maybe it find its way into the core files.
I followed your instructions but could not reproduce result
-
- Phoca Member
- Posts: 25
- Joined: 05 Apr 2020, 09:10
Re: Placeholder in infoscreen
which phoca version do you use?I use phoca 4.0.10 with the customized child template of casiopeia which is called phoca food.
- Nidzo
- Phoca Professional
- Posts: 390
- Joined: 07 Nov 2018, 14:55
Re: Placeholder in infoscreen
I use Phoca 5.0.0.Beta52 and Joomla 5.1.0. That could be the reason for not working.Cliffdiver wrote: ↑18 May 2024, 18:35 which phoca version do you use?I use phoca 4.0.10 with the customized child template of casiopeia which is called phoca food.
-
- Phoca Member
- Posts: 25
- Joined: 05 Apr 2020, 09:10
Re: Placeholder in infoscreen
It took me some time, to get a clue, which classes i need and how it works.
I get some idea in the file administrator/libraries/phocacart/order/status.php
There I found the code for the replacement (search for PhocaCartText::prepareReplaceText) and checked, which variables have to be passed over to the class / method.
I get some idea in the file administrator/libraries/phocacart/order/status.php
There I found the code for the replacement (search for PhocaCartText::prepareReplaceText) and checked, which variables have to be passed over to the class / method.
-
- Phoca Member
- Posts: 25
- Joined: 05 Apr 2020, 09:10
Re: Placeholder in infoscreen
I just had a look at the code of Phoca 5 and downloaded the BEta 53 which is online since yesterday.
I found a code in the file components/phoca_cart/views/info/tmpl/default.php which looks like the replacement routine (around line 96).
This code is new
Maybe an update from BEta52 to 53 will solve the problem.
I found a code in the file components/phoca_cart/views/info/tmpl/default.php which looks like the replacement routine (around line 96).
This code is new
Code: Select all
if ($this->t['preparereplace']) {
$paymentDescription = PhocacartText::completeText($paymentDescription, $this->t['preparereplace'], 1);
}