News:

Looking for documentation? Take a look on our wiki

Main Menu

echo $viewData["payment_name"]; inside HTML code

Started by ketbel, March 31, 2020, 07:38:08 AM

Previous topic - Next topic

ketbel

Hi,
I'm trying to rewrite this code

<div class="post_payment_order_number">
   <span class="post_payment_order_number_title"><?php echo vmText::_ ('COM_VIRTUEMART_ORDER_NUMBER'); ?> </span>
   <?php echo  $viewData["order_number"]; ?>
</div>

in to page orderdone.php. The code in this page is build up with HTML inside an PHP.

The first and second line is ok have I solved

echo '<div class="post_payment_payment_name">';
   echo '<span class="post_payment_payment_name_title">' .vmText::_ ('VMPAYMENT_STANDARD_PAYMENT_INFO').'</span>';

but how do I write this code:
<?php echo  $viewData['displayTotalInPaymentCurrency']; ?>.

I tried this:
echo $viewData["payment_name"];

and this

echo '<div>'$viewData['payment_name']'</div>';

Virtuemart v. 4.2.6 10972
Joomla v. 5.0.3
PHP 8.1.27
VMuikit X 10.37
Payplan 5.0.7
Admin Tools Professional 7.4.2

Jörgen

This is not VM support, this is PHP 101.

It is all about context

In PHP context:
echo $viewData["payment_name"];

In HTML context:
<?php echo $viewData["payment_name"]; ?>

There are plenty of tutorials out there, GOOGLE.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.