Custom Order field - Display only in user account

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14069

I would like to be able to have a custom field (type=file), tied to Orders, which will allow me to upload a PDF of a finished print job. Then, when my users log into their account and go to CUSTOMER ACCOUNT > ORDERS, the list of orders displayed will include a link to the PDF for each order, where applicable.

I created the custom file field, and set "Front End" to "No". I need to do this to keep it from displaying with my other custom Order fields during checkout. I am assuming that I now need to customize the Dashboard->Order view to include this field in that list, but I cannot seem to figure out how to do this. I can simply replace the price column, as it is not needed for my purposes. Is there a way to do this?

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
13 years 7 months ago #14083

You can edit the file listing of the view order of the front end via the menu Display->Views and change the code:

<?php echo $row->order_number; ?>

to:

<?php echo $row->order_number; ?>
<br/>
<?
$class = hikashop::get('class.field');
$field = $class->getField('FIELD_COLUMN_NAME','order');
echo $class->show($field,$row->FIELD_COLUMN_NAME);
?>

You need to replace FIELD_COLUMN_NAME by the column name of your field.

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14084

nicolas,

I know you had discussed the possibility of the next version of HikaShop allowing for a more widespread use of custom fields. Is the something that would be included in that?

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
13 years 7 months ago #14085

Not really. That's really a custom request. If other users ask for a similar thing, we will look at including it but no one had that need so far.

If you do that change via the interface, you will still be able to update HikaShop later on without loosing your modifications.

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14086

Perfect! That works for me!

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14172

I am in Display->Views->Order->listing.php (Front End)

I cannot find the line you reference:

<?php echo $row->order_number; ?>

Am I in the right file?

And if I am, and wish to replace the Order Total with this custom field, do I replace this line:
<?php echo $this->currencyHelper->format($row->order_full_price,$row->order_currency_id);?>

Thanks!!

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
13 years 7 months ago #14173

Then you're not using the version 1.4.9
Before that version it was:
echo hikashop::encode($row);

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14175

I updated to 1.4.9 this morning, and I just verified my version (Help->Update/About) and I am still not seeing the line:

<?php echo $row->order_number; ?>

But I do find the line:

echo hikashop::encode($row);

Just thought I would mention it, because I am just not seeing what you are.

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
13 years 7 months ago #14176

That's probably because you had edited your view before updating. At the beginning of each view code, you have the version number of the file. You probably have a previous version number there.

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

  • Posts: 202
  • Thank you received: 2
13 years 7 months ago #14177

You got it!! No matter, it works absolutely PERFECTLY!!!!!

Do you ever sleep? You have provided support that is on-par with Geraint Edwards (JEvents), and I never thought I would find a developer I would say that to. It is SO rare to find this, even with commercial extensions, in the Joomla world. Thank you, thank you, thank you!!

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

  • Posts: 4
  • Thank you received: 0
8 years 9 months ago #229010

I have a question referring to that. How can I display the individual order of my clients?
Profil -> Order (and here I would like to display the orders they have done, if it is possible with a picture and the name of the product and a link the the digital order they made)

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #229027

Hi,

You can create a new menu item of the type "hikashop orders listing" via the Joomla menu manager so that your customers will be able to access it. There, they'll get a listing of all the orders they previously made on your website and when opening one, they'll be able to see the downloads of the products of that order.

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

  • Posts: 4
  • Thank you received: 0
8 years 9 months ago #229302

Thank you so much. But is it possible to show them with a picture? And that picture i would like to link to an external URL.
If that would be possible - it would be great.

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
8 years 9 months ago #229348

Hi,

There is no option for that. But if you want to add it, it's possible. You need to edit the file "show" of the view "order" via the menu Display>Views and add the HTML for your image tag and link around it.

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

Time to create page: 0.088 seconds
Powered by Kunena Forum