Placeholder in infoscreen

Phoca Cart - complex e-commerce extension
Cliffdiver
Phoca Member
Phoca Member
Posts: 21
Joined: 05 Apr 2020, 09:10

Placeholder in infoscreen

Post by Cliffdiver »

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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47891
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Placeholder in infoscreen

Post by Jan »

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
If you find Phoca extensions useful, please support the project
Cliffdiver
Phoca Member
Phoca Member
Posts: 21
Joined: 05 Apr 2020, 09:10

Re: Placeholder in infoscreen

Post by Cliffdiver »

HY Jan,
thanks for the Info.
Cliffdiver
Phoca Member
Phoca Member
Posts: 21
Joined: 05 Apr 2020, 09:10

Re: Placeholder in infoscreen

Post by Cliffdiver »

I did it now in a very simple way.
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']);
I added the following lines

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);
After that lines the original code continues

Code: Select all

if ($paymentDescription != '') {
        echo '<div class="ph-info-payment-description">'.HTMLHelper::_('content.prepare', $paymentDescription).'</div>';
    }
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 :wink:
Maybe this helps somebody else, or maybe it find its way into the core files.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47891
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Placeholder in infoscreen

Post by Jan »

Hi, thank you for this guide.

Jan
If you find Phoca extensions useful, please support the project
Post Reply