Appear div depending on condition

1

Good afternoon

At the end of an order I want a div to appear depending on the payment method, perhaps by the name of the payment method. The div in question is this

<div>
<h2>
	<a href="javascript:submitPaymentByPopUp('<?php echo $viewData["order_number"];?>','<?php echo $viewData['displayTotalInPaymentCurrency'];?>','','site',500,600);">Fazer pagamento</a></h2>
	</div>

The whole code of the page is this:

<?php
defined ('_JEXEC') or die();

?>
<div class="post_payment_payment_name" style="width: 100%">
	<span class="post_payment_payment_name_title"><?php echo vmText::_ ('VMPAYMENT_STANDARD_PAYMENT_INFO'); ?> </span>
	<?php echo  $viewData["payment_name"]; ?>
</div>

  <div>
<h2>
	<a href="javascript:submitPaymentByPopUp('<?php echo $viewData["order_number"];?>','<?php echo $viewData['displayTotalInPaymentCurrency'];?>','','site',500,600);">Fazer pagamento</a></h2>
	</div>


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

<div class="post_payment_order_total" style="width: 100%">
	<span class="post_payment_order_total_title"><?php echo vmText::_ ('COM_VIRTUEMART_ORDER_PRINT_TOTAL'); ?> </span>
	<?php echo  $viewData['displayTotalInPaymentCurrency']; ?>
</div>
<a class="vm-button-correct" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=orders&layout=details&order_number='.$viewData["order_number"].'&order_pass='.$viewData["order_pass"], false)?>"><?php echo vmText::_('COM_VIRTUEMART_ORDER_VIEW_ORDER'); ?></a>

My question is, depending on the name of the payment method, it is possible to hide the div where it is called pop up, that is, I just want it to appear for a payment method.

    
asked by anonymous 03.04.2017 / 17:39

1 answer

0

Verify the payment method using if :

<?php if ($viewData["payment_name"] == 'PayPal'): ?>
    <a href="javascript:submitPaymentByPopUp('<?=$viewData["order_number"];?>','<?=$viewData['displayTotalInPaymentCurrency'];?>','','site',500,600);">Fazer pagamento</a></h2>
<?php end if; ?>

Tip :

You can use the short tag <?= ?> to display text, instead of the complete tag <?php echo ... ?>

    
03.04.2017 / 19:27