How to get path for image/file from custom field?

  • Posts: 175
  • Thank you received: 0
9 years 9 months ago #204332

-- url of the page with the problem -- : -
-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.36

Hi

i tried to add a custom field containing image/file for my category & products


however when i want to know the path of image stored, it seems it's generated

i also tried it through template override

but it only containing the filename of the image




link in the front end

how to generate the link image / where the image is stored ?

Last edit: 9 years 9 months ago by veeco.

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

  • Posts: 26205
  • Thank you received: 4032
  • MODERATOR
9 years 9 months ago #204401

Hi,

Images from custom fields are generally not accessible directly ; they are stored in the "safe" folder and we use a PHP script to let them available (if you have the right access to).
So even if you can generate the right url ; the file won't be accessible (because the "safe" folder is not restricted). You need to display the field using the custom field system (with the field class and the "show" function).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 175
  • Thank you received: 0
9 years 9 months ago #204435

Hi

i need to use them in front end using the template override [as shown], is there anyway i can get the file then?

i need a field to upload file in back end and then use the picture in front end

any suggestion how to do it?

Last edit: 9 years 9 months ago by veeco.

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
9 years 9 months ago #204480

Hi,

As jerome said, you need to display the field using the custom field system (with the field class and the "show" function):

<?php $fieldsClass = hikashop_get('class.field');
$fields = $fieldsClass->getFields('frontcomp', $this->row, 'category', 'checkout&task=state');
foreach($fields as $key => $val){
 echo $fieldsClass->show($val,$this->row->$key); 
} ?>

But normally, custom category fields are already displayed on the listings as long as you turn on the "frontend" setting of the field, so it should not even be necessary.

Last edit: 9 years 9 months ago by nicolas.

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

  • Posts: 14
  • Thank you received: 1
6 years 9 months ago #293580

Hi,
So if I create an external form (like say using RSFORM) then how get i retrieve the path of the this uploaded file? Appreciate your help

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
6 years 9 months ago #293600

Hi,
You would have to ask RSFORM's support for that. We don't know how that extension forms work.

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

  • Posts: 14
  • Thank you received: 1
6 years 9 months ago #293722

Hi,
I mean if I want to create a plain file and make a direct connection using php code to select the data of a particular order items . How can I call for the product images since is there any php code that i can used to display the images?

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
6 years 9 months ago #293726

Hi,

The exact code will depend on how you configured the custom field. We would need a screenshot of its settings to be able to say.

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

  • Posts: 12
  • Thank you received: 0
4 years 3 weeks ago #329944

Hi,

here is my screenshot, my question is: How can I access these fields caTest, certTest, keyTest in function onAfterOrderConfirm.

Attachments:

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 2 weeks ago #329949

Hi,

This thread is about custom fields, not plugin settings.
And I already replied to you about this here:
www.hikashop.com/forum/integrations/9019...t-plugin.html#329893
As I already told you:

you can use such code:
$plugin = JPluginHelper::getPlugin('hikashoppayment', 'xxx');
$this->params = new JRegistry(@$plugin->params);
echo $this->params->get('yyy');
where xxx is the folder name of your plugin and yyy the name of the setting (field).

Is there something you don't understand in this text ?

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

Time to create page: 0.090 seconds
Powered by Kunena Forum