News:

Support the VirtueMart project and become a member

Main Menu

move customer note box to the top

Started by jlover, July 07, 2020, 13:15:18 PM

Previous topic - Next topic

jlover

Hi,

my VM is up to date. I want to modify some part the cart and invoice.

Is it possible to move customer note box in cart view and in invoice to be at the bottom of customer address/shipping address area? which file I have to modify?

thank you very much.

Juser

AH

For the invoice - you can see the customer note field being written in

\components\com_virtuemart\views\invoice\tmpl\invoice_order.php


    <td><?php echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_CUSTOMER_NOTE'?></td>
    <td valign="top" align="left" width="50%"><?php echo $this->orderDetails['details']['BT']->customer_note?></td>



For the cart it requires a little more work as the cart loops through a set of userfields - so you (by default get TOS and Note)

\components\com_virtuemart\views\cart\tmpl\default_cartfields.php

You can see from this loop - that it will get all non hidden userfields and display them:

foreach($this->userFieldsCart['fields'] as $field) {


If you want to move the note field you will need to adjust this and explicitly skip over the customer_note field in the loop

Then just get the array value for display in the appropriate place for your cart.

Regards
A

Joomla 3.10.11
php 8.0

jlover

Hi AH,

thank you very much for your help. now I can move the box in invoice.

for the cart, I will try myself and give the feedback.

Juser :D


jlover

#3
Dear AH,

I am not a programmer, so do simple by move all code to correct file. I success to move the box+ term of service to the top of table by move most of the code to default_address.php, code in default_cartfields.php remains only a few row:

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

// Status Of Delimiter
$closeDelimiter = false;
$openTable = true;
$hiddenFields = '';


?>


not exactly i want but acceptable. thank you.