Add extra custom postcode field to invoice

  • Posts: 14
  • Thank you received: 0
9 years 8 months ago #192728

-- url of the page with the problem -- : www.sleepever.nl/
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.36
-- Browser(s) name and version -- : Firefox 36.0

Hi,

In the Netherlands we have a postcode which is 6 characters.The first 4 characters are numbers and the last 2 are letters.

Shipment for the mainland is free but shipment to the islands (based on the first 4 characters of the postcode) costs extra.

The standard postcode field is limited to 4 characters so I can determmine the location of the shipment (main land or 1 of the islands). I made an extra custom field (collumn name: address_post_code_suffix) so the cutomer can fill in the letters from his postcode.

Shipment price is working ok (free for the main land, extra costs for the islands), but the invoice does not show the letters. I added the custom address_post_code_suffix to Display -> Views -> address_template but the field is still not showing on the invoice.

I read on the forum that there should be an Invoice view when selecting Display -> view -> order but there I only see Address_template, listing and show

How can I get the full postcode on the invoice instead of only the first 4 characters?

Kind regards,
Eric Beernink

Please Log in or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
9 years 8 months ago #192747

Hi,

When you add the tag for your extra custom field in the address_template view file, you need to add it to it for both your frontend template AND your backend template. I guess that you only did it for one of the two.

Regarding the post code limitations, you should be able to do it with only one field but it might require the modification of how you set your shipping methods post code restrictions.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
9 years 8 months ago #192827

Hi Nicolas,

Thank you for your quick answer! Still no luck.

When I go to Display -> views en select my template (and the address view) I have 3 options:
1.Frontend and backend (the custom field is here also visible).
2. Frontend (here I now also added the custom field)
3. Backend (this list is empty so I cannot change anything here

address / address_template.php:

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.3.5
 * @author	hikashop.com
 * @copyright	(C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>{address_company}
{address_title} {address_firstname} {address_lastname}
{address_street}
{address_post_code} {address_post_code_suffix} {address_city} {address_state}
{address_country}
<?php echo JText::sprintf('TELEPHONE_IN_ADDRESS','{address_telephone}');?>

regarding your second remark, I initially tried to solve this with 1 field, but couldn't figure out how to configure pre- and suffix. I guess it should be possible but I couldn't make it work.

Kind regards,
Eric

Last edit: 9 years 8 months ago by insitevision.

Please Log in or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
9 years 8 months ago #192861

Hi,

You say that you first select "your template" and then you select backend.
It's normal that you don't get any result since "your template" is the template you're using on your frontend, not the template you're using on your backend I suppose.
Instead of selecting your frontend template, select your backend template and you'll see that you get a result for the backend address_template view file and that's where you also want to change the code and add your tag.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
9 years 8 months ago #192897

Hi Nicolas,

Thank you, that solved my problem!

Regards,
Eric

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum