VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: andrai2 on April 21, 2015, 17:31:51 PM

Title: How to add shipment name in the "Thank you for yor order" page..?
Post by: andrai2 on April 21, 2015, 17:31:51 PM
Hello!

I would like to ask
How to add shipment name in the "Thank you for yor order" page..?

To ilustrate my idea i have add an image

So what i understand

If go here, i can see there elements that ar show in thans page

vmpayment/standard/standard/tmpl/post_payment.php

This is code, i manage to delete payment order nummber
?>
<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 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>


so what i understand i how to copy one piecie of code and modify it

<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>


Can someone help modify this code to show shipment in the "Thanks" page..?

I try something like this but i am beginer in php

<div class="post_shipment_shipment_name" style="width: 100%">
<span class=post_shipment_shipment_name_title"><?php echo vmText::('VMPAYMENT_STANDARD_shipment_INFO'); ?> </span>
<?php echo  $viewData["shipment_name"]; ?>
</div>


The code is wrong, but maybe somen can help me..?

Thans in advance

Joomla 3.3.6
VirtueMart 3.0.2
Artisteer template
Site is multilangiage
Title: Re: How to add shipment name in the "Thank you for yor order" page..?
Post by: GJC Web Design on April 21, 2015, 22:19:05 PM
you need to find and add the shipment name to the the $html array in plugins\vmpayment\standard\standard.php

~  line 127

$html = $this->renderByLayout('post_payment', array(
         'order_number' =>$order['details']['BT']->order_number,
         'order_pass' =>$order['details']['BT']->order_pass,
         'payment_name' => $dbValues['payment_name'],
         'displayTotalInPaymentCurrency' => $totalInPaymentCurrency['display']
      ));

no idea what the shipname is - it will be in either the $cart or $order object

then add

'shipment_name' =>$whatever->thename->is,

it will then be available in the vmpayment/standard/standard/tmpl/post_payment.php

as  $viewData["shipment_name"]



Title: Re: How to add shipment name in the "Thank you for yor order" page..?
Post by: andrai2 on April 24, 2015, 14:54:53 PM
Can you please help me with this line, which i have to add in plugins\vmpayment\standard\standard.php line 127
'shipment_name' =>$whatever->thename->is,

I have two simple shipment methedos (weight_countries)
1. Get the product in shop
2. Delivery to adress

Can you give me a real example how this line could look like..? To show selected shipment method in the cart

Basicly must be the same idea as payment method, that shows selected payment
This is payment methed standard.php line 127
'payment_name' => $dbValues['payment_name'],


I try the same idead with shipment metheod

'shipment_name' => $dbValues['shipment_name'],


but no luck

to add my progrres i have add an image

So i manage to to show shipment as title in thanks messsage i modify file post_payment.php , but i can show select shipment method

Hope to get some feedback

Thanks!
Title: Re: How to add shipment name in the "Thank you for yor order" page..?
Post by: andrai2 on April 29, 2015, 13:30:57 PM
'shipment_name' =>$whatever->thename->is,

Can someon give me an example how this line could look like...?

p.s GJC Web Design you are my big hope to help solve this issue