VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: vmfyelloq19 on July 22, 2019, 09:09:35 AM

Title: Custom shopper field only for bill-to (BT) or ship-to (ST)?
Post by: vmfyelloq19 on July 22, 2019, 09:09:35 AM
Hi folks,

is it possible to add a custom shopper field to how up only on bill-to (BT) or ship-to (ST)?
Title: Re: Custom shopper field only for bill-to (BT) or ship-to (ST)?
Post by: Jörgen on July 22, 2019, 09:56:21 AM
Yes, but it need some adjustment in the template files for the (BT) and (ST) block. It should be easy to check for custom field name to include and exclude the custom field.

templates/your-template/html/com_virtuemart/invoice_order.php

Would be a good starting point.

Jörgen @ Kreativ Fotografi
Title: Re: Custom shopper field only for bill-to (BT) or ship-to (ST)?
Post by: vmfyelloq19 on July 22, 2019, 14:52:13 PM
Hi Jörgen,

thanks for your reply. Yes, I certainly know I can work that out with my templates. I was just wondering if it could be configured in a way the shop admin would have to call me to adjust the template whenever she adds or modifies a field.

Cheers!

Title: Re: Custom shopper field only for bill-to (BT) or ship-to (ST)?
Post by: Jörgen on July 22, 2019, 19:11:58 PM
Hello
If you give the admin some naming convention. Perhaps st_myfield and bt_myfield, he or she can add as much fields as they need.
Then you only need one mod of the template.
Jörgen @ Kreativ Fotografi
Title: Re: Custom shopper field only for bill-to (BT) or ship-to (ST)?
Post by: vmfyelloq19 on July 24, 2019, 08:44:28 AM
Hi Jörgen,

thanks for your hint. That's the way I usually do it, and it works somehow.
Still I feel it's some sort of crude and I had the idea there was a "proper" way implemented by the VM developers.
Working with VM you get the impression that there are many things you work around that would be much much cleaner and easier if we had a way to know they are already in the API.

Cheers!