Custom Field Image

  • Posts: 16
  • Thank you received: 0
11 years 11 months ago #81645

Hi,

i created a simple plugin for Hikashop that filters some information from an order and creates some files.
For that i need a custom field for an image, that the customer can upload for a specific product.

I've created the field and it displays on the product page. But when i checkout i cant get any information about the image the user chose (also the image isnt listed in the cart like other custom field values do). I am using the OnBeforeOrder() trigger for debugging but when i print out the product details, there isnt any information about the image. Other custom fields work fine (text, textarea).

Am i doing anything wrong or isnt it possible to attach a file/image to a product within an order?

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #81758

Hi,

"Item" custom field are different than "Product" custom field.
A product custom field is for products in the store.
An item custom field is for products in the cart.

In order to attached a file to a product in the user cart, you have to create a "file item custom field" (table: item, type: file).
When the product would be added in the cart, the filename should be display in the checkout cart. And the custom field data could be read in the cart object.

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.
The following user(s) said Thank You: mobe84

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

  • Posts: 16
  • Thank you received: 0
11 years 11 months ago #81819

Thank you for the quick reply.

I've created a custom field (table: item, type: file). On the product page the user can add a file to the product and also some text in another custom field with type = text. But in the cart there is only the text value displayed and also in the cart object there is no file attached. The same happens with field type = image. Text and textarea fields are working fine.

Do i need some extra settings for file/image fields?

Edit: I have another issue with my fields. One of my text fields is "required", but when i add an item to the cart it is possible without using a value for that field. How can i fix this?

Last edit: 11 years 11 months ago by mobe84.

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

  • Posts: 82796
  • Thank you received: 13357
  • MODERATOR
11 years 11 months ago #82003

That means that the upload of the file didn't succeed. There are two possible reasons to that:
1. The file is too big for your upload restrictions. You should try with a smaller file and/or increase the upload limit of your web server.
2. The folder where the file has to be saved is not writable. So you should check that both the folders media/com_hikashop/upload and media/com_hikashop/upload/safe are writable via FTP.

Regarding your other issue, could you do a screenshot of the options of that field and give a link to that product page ?

The following user(s) said Thank You: mobe84

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

  • Posts: 16
  • Thank you received: 0
11 years 11 months ago #82040

Thank you.
I will look at the folders, case 1 should not be a problem. I used very small images for my test. So it should be case 2.

For the second issue i have a screenshot added. A link to the product page isnt possible yet.
All i can say is that the product with the field is been added to the cart regardless of the fact that the field is filled or not.


Attachments:

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #82114

Hi,

I have test it with the latest HikaShop package and the javascript is working.
If you have some javascript errors in your page, it could be possible for a customer to add the product in the cart when the field is empty.
If you use the "add to cart" button in a product listing, where the custom field is not displayed, the restriction could not be test, so the product would be added.

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: 16
  • Thank you received: 0
11 years 10 months ago #82406

Hi,

I have tested the weekend on a local 2.5 joomla installation with hikashop business and the problem still exists :(

A added some screens what exactly happens when adding an item to the cart.
The folders are writeable, settings for the required text field as seen in my screenshot above.

For the test i have 2 custom fields (sreen 1):
- Text field (required): "Book id"
- Image upload field: "Bild"

When i enter an id in the first field it shows on the cart/checkout (screen 3)
When i enter nothing the item is still be added to the cart (screen 2)
When i add an image to the upload field it doesnt show on the cart. It seems the image isnt uploaded at all, not even a temporary file in the /tmp folder.
Also there are no warnings or error massages at all shown on my pages.

Is there something i could possibly have forgotten in my configuration of joomla/hikashop?
Or could this be some problem with a specific joomla/hikashop version?

Hope you can help.

Attachments:

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 10 months ago #82583

Hi,

Which version of HikaShop do you use (I don't see your license with your account) ?
I have made a test in the demo website and it's working good.

If you have some javascript errors, the custom field validation could not work properly.
I tried with "use ajax" and it is working too.

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.
Attachments:

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

  • Posts: 16
  • Thank you received: 0
11 years 10 months ago #82919

Hey,

i am developing for a company, they purchased the business version (username: luckyman24). The Update page in the backend tells me that we are using 2.0.0 and there is no update available.

I cant see any javascript errors in the chrome console. Tested with different browsers also.
"Use Ajax" does not solve the problem. We now have a local and a web based page and both are generating these errors.

I programmed a module for uploading an image via frontend and it works fine.
All this seems kind of weird :(

I will ask my boss for a test account, so you can test it yourself on our page.

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 10 months ago #82999

Hi,

Yes, it would be easier.

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: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 10 months ago #83991

Hi,

The problem is a link to: variants + upload.
It should be fixed in the latest HikaShop package. Please redownload HikaShop business.
If it does not fix the problem, we would require an temporaly admin access to your website in order to install some special patched package (with some debug trace) in order to fix it and so, install you a fixed package.

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: 16
  • Thank you received: 0
11 years 10 months ago #84154

Thank you,

is the link on our order page the latest hikashop package and do we have to reinstall the complete shop?


Moritz

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 10 months ago #84164

Hi,

You can use the order page or you can use the "your subscription" page : www.hikashop.com/en/account/your-subscriptions.html
The subscription page allow you to choose the package type (tar.gz or zip).

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: 36
  • Thank you received: 0
11 years 10 months ago #84588

I'm also using variants with an item file upload, however it still doesn't work with today's package update.

I don't see any errors after uploading, not on the frontend, not in the backend, not in apache or php logs.

Small files, big files, none show in the checkout or in the backend after purchase.

Is there anything I can change to make this work?

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

  • Posts: 36
  • Thank you received: 0
11 years 10 months ago #84652

After some testing it is clearly a bug (which still exists in the latest business package) with the item-file and item-image customfields. I've tried with textfields, and those work nicely with variants.

For now I've added a fileupload for the order, however that really limits my customers. I hope you guys can help crush this bug soon.

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 10 months ago #84752

Hi,

The last time than Nicolas test it, the problem was solved.
So maybe you have a special case that we didn't try.
Would it be possible to have an access to your website in order to make some tests and installed a patched version of HikaShop ?

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: 36
  • Thank you received: 0
11 years 10 months ago #84859

I sent a PM with detailed info...

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

  • Posts: 36
  • Thank you received: 0
11 years 10 months ago #85092

Jerome, when do you think to have some time to look in to this?

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

  • Posts: 82796
  • Thank you received: 13357
  • MODERATOR
11 years 10 months ago #85181

Hi,

We got the user/password access your provided but there were no URL for the access. I tried with the URL on which your subscription is attached ( dutchdecals.com ) but that didn't work. Thus I couldn't look at the problem. Could you give the necessary information so that we could look into the problem ? Also, on top of a backend access, a FTP access would help us look directly into the code of the files in case we need to add traces to the problem. I'm ok with a copy of the website as long as we can reproduce the problem.

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

  • Posts: 36
  • Thank you received: 0
11 years 10 months ago #85226

PM sent with updated details. The running shop was on a alias/subdomain.

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

Time to create page: 0.085 seconds
Powered by Kunena Forum