- Posts: 79
- Thank you received: 0
Adding attachment field to ask a question form on product detail page
-- Joomla version -- : joomla 3.7
Hi, i would like to add an attachment field on the contact form on product detail page.
do you have any tutorial or documentation to show how to get this done?
Please Log in or Create an account to join the conversation.
It should be no problem. Go in the menu Display>Custom fields, click on the "new" button, select the table "contact" and the type "ajax file" and save. Check also the display settings so that they are like you want and you're done.
You can find the documentation on custom fields here:
www.hikashop.com/support/documentation/4...shop-field-form.html
Please Log in or Create an account to join the conversation.
However the uploaded images is not sending to admin/vendor as attachment.
how can i add the field to email template also?
Please Log in or Create an account to join the conversation.
In the contact email notification, you should have a download link and that download link will allow you to get access to the file.
You didn't had the link in the email ?
If so, how did you configure the custom field ?
There is no option to have the file as an attachment of that email instead of a download link.
That would require you to add custom code in the "preload" of the contact form notification email via the menu System>Emails.
Please Log in or Create an account to join the conversation.
As your can see, there is no download link of the file . please advice.
Please Log in or Create an account to join the conversation.
I get it ! Can you go in your customization "A contact request has been made" page, and go to your PRELOAD VERSION part, around line 47, you have this :
Replace it for this :
The difference is on line 4 of this code sample :
That would solve your link display issue.
Regards
Please Log in or Create an account to join the conversation.
I had tried to modified your code but end up admin cant receive the email edi. Anything i did wrong?
One more thing, when user upload an image on the ask a question form, the thumbnail shows a broken image, is this normal? anyway to fix this? cause this is not very good looking on UI.
Please Log in or Create an account to join the conversation.
On our side, we haven't this kind of issue, so maybe you make something wrong inside your emails code...
Try to redo the modification from a default code, and so in emails listing click on the little trash icon in order to remove modification (you can save on your side your code before remove it).
And as said previously, just remove "$null" for "$data->product"
Awaiting news from you.
Regards
Please Log in or Create an account to join the conversation.
i did a mistake which i direct modified from the core file.
Now i redo your steps from the system configuration, the email is sending out already.
But still don't have the download link for the image that user uploaded at the contact form.
(ps: this form is submitted from vendor detail page, just in case the place that submit the form affected the output)
Please Log in or Create an account to join the conversation.
You have to be more precise because I believed that you want have your contact form in your product detail page...
" i would like to add an attachment field on the contact form on product detail page."
Vendor page or Product page isn't important because it's the same form, but not the same context and especially limits, when I look in your Custom field configuration you have a restriction on Product categories, and so I wonder how you can have the file dropped area with this configuration on your vendor page...
Anyway remove this restriction, there is no purpose if you have to use this custom field from vendor page and maybe that will solve your issue.
Awaiting news from you.
Regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Quite strange result... I don't know what can leads this kind of display, I see only 1 solution right now :
Provide backend/frontend access and an Url link in order to process some test.
Use our Contact us form to provide this AND don't forget to add in your message an Url link to this topic.
Notify us by posting in this topic when it's done.
Regards
Please Log in or Create an account to join the conversation.
We got the access. Thanks.
I didn't understood that you were talking about the vendor contact form. It's now clearer why you have the problem.
I changed the code:
However, note that this is a download link which requires a backend authentication (for security).
There is no way to have a download link available for the vendors on the frontend since otherwise, anyone would be able to download the files uploaded by users on the frontend and that would be a security issue.
So you can't have a custom fields of the type "ajax file", "ajax image", "file" or "image" for the vendor contact form.
Please Log in or Create an account to join the conversation.
But I am having the same problem and the solutions given here do not solve it.
I need a loaded file to arrive from a custom fields ajax of the hikashop contact form.
Thank you
Please Log in or Create an account to join the conversation.
The code by default should already support that properly.
Could you provide a URL to your contact form and a screenshot of an email that you got from a test on it where the custom field link wasn't included ?
Could you also provide a screenshot of the custom field settings ?
Please Log in or Create an account to join the conversation.
I am working on a big update, and I do not have this online, however I send a screen of the tests done.
Guide me on what to do please, thanks
Please Log in or Create an account to join the conversation.
I need the email with the file to arrive from the contact form outside the product
Please Log in or Create an account to join the conversation.
Then this would require to see the full custom field screenshot configuration, please.
Later, add an url link to see it by ourselves.
regards
Please Log in or Create an account to join the conversation.
The website I am updating it in a local environment, I send you the screenshot configuration and the email message.
I appreciate your help in this
Please Log in or Create an account to join the conversation.
I think what's missing is this piece of code:
Please Log in or Create an account to join the conversation.