Customer Order History & Tracking Numbers

  • Posts: 21
  • Thank you received: 2
10 years 8 months ago #148724

-- url of the page with the problem -- :
-- HikaShop version -- : 2.3.0
-- Joomla version -- :3.2
-- PHP version -- : 5.4

Is there a way to add tracking information in the customers order history so they can log in and access their tracking number?

Thanks :)

Last edit: 10 years 8 months ago by Scott. Reason: Figured part of it out

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 8 months ago #148738

Hi,

You can create a custom field of the table "order" via the menu Display>Custom fields.
That way you'll be able to edit it in the order details page in the backend.
Then, you can edit the file "show" of the view "order" via the menu Display>Views and add such code in order to display what you entered in the custom field:
<?php echo $this->element->FIELD_NAME; ?>
where FIELD_NAME is the column name of your custom order field.

The following user(s) said Thank You: Scott

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

  • Posts: 21
  • Thank you received: 2
10 years 8 months ago #148860

Thank you.

If I wanted to add 2 custom fields, how would I code that? For example, if I wanted to add a tracking number and the date of shipping I enter the code:

<?php echo $this->element->shipping_date; ?>
<?php echo $this->element->tracking_number; ?>

But they both appear on the same line. Is there a way to insert a link break so they appear of different lines?

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

  • Posts: 21
  • Thank you received: 2
10 years 8 months ago #148865

Solved it. For anyone interested, if you want text to appear before the information such as:

Shipped On: (your entry)
Tracking Number: (your entry)

Insert the following code on line 501 of Displays > View > Orders > Show:

<?php echo JText::_('Shipped on').' : '.$this->element->shippingdate; ?><br/>
<?php echo JText::_('Tracking Number').' : '.$this->element->tracking_number; ?>

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

Time to create page: 0.060 seconds
Powered by Kunena Forum