Attaching files to order
10 years 9 months ago #224361
by filiar
Attaching files to order was created by filiar
-- HikaShop version -- : 2.6.0
Hi,
I would like to manually attach some downloadable from the user files, for each order (like infoice, warranty card and others). The files should be unique for each order, so they cannot be pre-added.
I searched but could not find any ideas how to do that, so I will apreciate your help.
Thank You!
Iliya
Hi,
I would like to manually attach some downloadable from the user files, for each order (like infoice, warranty card and others). The files should be unique for each order, so they cannot be pre-added.
I searched but could not find any ideas how to do that, so I will apreciate your help.
Thank You!
Iliya
Please Log in or Create an account to join the conversation.
10 years 9 months ago #224367
by filiar
Replied by filiar on topic Attaching files to order
Ok, I think I find that out.
I made another file type custom field for the order table and made it visible for the Front-end.
So when adding file to that field it is shown at the bottom of the order in front-end.
But what happens when the order has been made without registration?
I made another file type custom field for the order table and made it visible for the Front-end.
So when adding file to that field it is shown at the bottom of the order in front-end.
But what happens when the order has been made without registration?
Please Log in or Create an account to join the conversation.
10 years 9 months ago #224374
by Xavier
Replied by Xavier on topic Attaching files to order
Hi,
If the order has been made without registration so the customer will not have access to the orders in frontend.
But in the email, the name of the file will be displayed, so you can potentially edit the email, set the file full path and send it to the customer, that way he can have all the informations even if he's not registered.
The emails can be sent from the order edition page in backend.
If the order has been made without registration so the customer will not have access to the orders in frontend.
But in the email, the name of the file will be displayed, so you can potentially edit the email, set the file full path and send it to the customer, that way he can have all the informations even if he's not registered.
The emails can be sent from the order edition page in backend.
Please Log in or Create an account to join the conversation.
10 years 9 months ago - 10 years 9 months ago #224452
by filiar
Replied by filiar on topic Attaching files to order
Thank You Xavier.
Just could you please help me fixing the full file path. Where are those files saved and how should the link look like?
EDIT: I found the files in "/media/com_hikashop/upload/safe/", but that folder is not public accessible I think?
Regards,
Iliya
Just could you please help me fixing the full file path. Where are those files saved and how should the link look like?
EDIT: I found the files in "/media/com_hikashop/upload/safe/", but that folder is not public accessible I think?
Regards,
Iliya
Last edit: 10 years 9 months ago by filiar.
Please Log in or Create an account to join the conversation.
10 years 9 months ago - 10 years 9 months ago #224457
by Xavier
Replied by Xavier on topic Attaching files to order
Hi,
The location of the files depends on your settings under Configuration > Main > Files.
The link should look like this:
If you are using this method, check your permission settings via ftp in order to lock the access to the folder but enable the access to the file.
And yes, the files in the safe folder are not directly accessible.
The location of the files depends on your settings under Configuration > Main > Files.
The link should look like this:
Code:
http://yourwebsite.ext/the_path_set_in_the_settings
And yes, the files in the safe folder are not directly accessible.
Last edit: 10 years 9 months ago by nicolas.
Please Log in or Create an account to join the conversation.
10 years 9 months ago - 10 years 9 months ago #224555
by filiar
Replied by filiar on topic Attaching files to order
Thank You, Xavier.
So I solved it that way:
This way for the custom file fields (that I created named 'order_invoice' and 'order_warranty') links to the files will be added in the notification email.
So the question now is what will happen with that code after I update HS. I suppose changes will be overwritten.
How to solve that? And do you think about implementing such links to files?
So I solved it that way:
- As you requested I made files readable (by changing .htaccess file permissions for safe folder to "allow from all") and the folder properties itself to 751 (denied read access, but allowed execute for word)
- Changed those lines in media/com_hikashop/mail/order_status_notification.preload.php
toCode:if(hikashop_level(2)) { $fields = $fieldsClass->getFields('frontcomp',$data,'order',''); foreach($fields as $fieldName => $oneExtraField) { if(isset($data->$fieldName) && !isset($data->cart->$fieldName)) $data->cart->$fieldName = $data->$fieldName; if(empty($data->cart->$fieldName)) continue; echo $sep . $fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField, $data->cart->$fieldName,'user_email'); $sep = '<br />'; } }Code:if(hikashop_level(2)) { $fields = $fieldsClass->getFields('frontcomp',$data,'order',''); foreach($fields as $fieldName => $oneExtraField) { if(isset($data->$fieldName) && !isset($data->cart->$fieldName)) $data->cart->$fieldName = $data->$fieldName; if(empty($data->cart->$fieldName)) continue; $val = ($oneExtraField->field_namekey=='order_invoice' || $oneExtraField->field_namekey=='order_warranty') ? '<a href="'.HIKASHOP_LIVE.'media/com_hikashop/upoad/safe/'.$data->cart->$fieldName.'">'.$data->cart->$fieldName.'</a>' : $fieldsClass->show($oneExtraField, $data->cart->$fieldName,'user_email'); echo $sep . $fieldsClass->trans($oneExtraField->field_realname).' : '.$val; $sep = '<br />'; } }
This way for the custom file fields (that I created named 'order_invoice' and 'order_warranty') links to the files will be added in the notification email.
So the question now is what will happen with that code after I update HS. I suppose changes will be overwritten.
How to solve that? And do you think about implementing such links to files?
Last edit: 10 years 9 months ago by filiar.
Please Log in or Create an account to join the conversation.
10 years 9 months ago #224560
by Xavier
Replied by Xavier on topic Attaching files to order
Hi,
To keep the modifications even when updating, you have to create override so edit the emails via the menu System > Emails (in HikaShop) instead of editing the files in the folder directly. That way, you will always keep your modifications.
To keep the modifications even when updating, you have to create override so edit the emails via the menu System > Emails (in HikaShop) instead of editing the files in the folder directly. That way, you will always keep your modifications.
Please Log in or Create an account to join the conversation.
Time to create page: 0.222 seconds