Can the administrator attach a file to a Woocommerce order? - woocommerce

I was wondering what the best way to achieve the following:
Customer makes an order (normal functionality)
Once order is placed, the admin needs to upload a pdf attachment related to the order
The customer can then view the attachment(s) when viewing the order
I can see there are plugins where the custom can upload supporting files, but none that cater for the admin to do this.

Why not add a new custom field for that product?
(source: chizzledesigns.com)
So once your client generates the PDF they can upload it just like normal into the media gallery and add the link (or at least the file name) into the Order PDF field for that specific order.
Next you would need to decide how to show the user that in your theme but querying for that meta value should not be difficult.

With default woocommerce functionality the main way to do this is to create virtual downloadable product (but not available on shop pages) and upload your pdf file there. Then when the order would be ready, you should grant access to that virtual product at the order edit page.

Related

Woocommerce - Custom folder per product upload based on ID/SKU

What would be the best method to manage product images so that each product has its own folder in the uploads directory based on either its post id or sku?
Attempted a few different methods via wp all import but feel I need to think outside of the box.

Is there any plugin or add on for adding a file uploader into the wooCommerce product page?

I am looking for a plugin or addon for adding a file uploader into my product page.
As my client is selling something that should require some kind of certificate or evidence, this would request the user to upload the pics or files when they want to add something into the cart.
I've found a solution is to add the meta attribute for the product and then add the file uploader into the product page. But my project leader denied my solution, he wants me to search for some possible plugin or add on first.
What I need to is like, I need to find a plugin or add on which could enable me to add a file uploader on the product page when the customer is placing the order. The file will be included in the order because my client will not directly charge the money from the customer, once my client check that the evidence or certificate is valid, the money could charged and the good could be shipped.
I've done some search and I think just add a meta attribute is easy, but my leader denied this. So I am coming to ask some help.
Thanks.
You could use a plugin like this https://codecanyon.net/item/woocommerce-custom-fields/11332742
It's a paid plugin though.
I think, there is too many plugins (free or paid) are available to customize WooCommerce product page.
But File Upload option may only available in premium plugins.
Can you please check themehigh's WooCoomerce extra product option plugin?.
I have tried that plugin for one of my client. The options available in product page are File Upload, Text, Hidden, Password, Textarea, Radio, Checkbox, Select, Multi-select, Date picker, Time picker, Heading & Label etc.

Wordpress - Proper way to manage custom users

I have a site in Wordpress.
The functionality I need is such that, I can create 'users' of the site. These users have no purpose editing the Wordpress site in any way, and don't need to know we're even using the wordpress platform.
These users need to be able to edit their contact info and upload/view/swap out their own resume, using a page that I will build for them (not the wp-admin dashboard in any way). This resume will be PDFs and WordDocs.
At first I thought I'd just use the built in Wordpress Users and Roles that Wordpress offers. However, I'm not sure how I would attach resumes to that user, and let that user edit their own resume. I know I can use the 'user_contactmethods' hook to attach basic fields. However, I'd be trying to attach a link to a file that Wordpress hosts, and would need to be able to replace that file on a whim, in php. Also, my goal is to prevent them from ever using the Wordpress dashboard or editing tools.
Next, I thought I could create a custom post type for a 'SiteUser'. That would make it easy to manage a PDF/WordDoc attached to that post type. Also, that user wouldn't have any way to access the Wordpress stuff. Before I do that though, I wanted to ask on here if this really is the right way to do this.
This solution feels hacky.
Can I get some proposed solutions to this problem that could be perceived as 'the proper way'?
Thanks
Here is a rough idea of what you are looking to do.
Step 1
Create the user role for these new users
Step 2
Set the permission for them and disable backend access and redirect all access of those roles to a custom page /account/
Step 3
Use Advance custom fields plugin to create some custom fields on the user meta. (text, file, image)
Step 4
Apply some login logic/form and Link to a /account/edit-info/ custom page with the acf frontend form. https://www.advancedcustomfields.com/resources/create-a-front-end-form/
Step 5
Use these info to display somewhere on the /account/ page
Optional
Using gravity forms instead to manage user data entry gives better control but requires more coding, and a better user experience.
Front-end Admin Steps
Repeat Step 1-2
Loop site user and list them and their custom field files Have a button that opens a Gravity form with the user ID text field pre-populated and hidden, and have a file uploader element.
Add backend hooks after validation directly replace the user meta
containing the file path or ID (however you choice to store it in
Advance custom fields)

WordPress: Can I batch upload lots of files (e.g. via a custom field) which will appear on my website as a list of downloadable files?

TL;DR: Can I upload hundreds of files via WordPress (vanilla or with free/premium plugins) which will appear on my website as downloadable files, or would another CMS be better suited to this task?
More info: I'm building a site to replace an old WordPress MU site. My (non-technical) client needs to be able to create a single profile page for each of their employees. Each employee page must include some or all of:
A header image
A text intro
A photo gallery
A list of links
Multiple audio embeds
Multiple video embeds
A list of ~1000 downloadable files, mostly pdf/jpg, divided into subgroups
Ideally the last point would be achieved something like this:
Client adds a custom field and must name it
Client drags any number (realistically 1-100) of files onto the field, or uploads via "add files" function
Files are saved in the backend to a folder named after the custom field
File order is editable by client
The field is output to the HTML page like this:
<h1>Custom Field Name</h1>
<ul>
<li><a>file1.pdf</a></li>
<li><a>file2.jpg</a></li>
...~100
</ul>
Employee A is totally separate from Employee B, C, etc. All employees' pages will be managed by a single user. Their files should exist separately in the backend. The paths to their files will ideally include their name, but only the filename itself needs to be printed to the page. A file system like this would be perfect:
/EmployeeFirstName-EmployeeLastName/Media/YYYY/Filename.xxx
I believe WP's default media file save directories can be customised via plugins.
I'm trying to do this in WP because it's what I've used in the past and it's what my client is familiar with. A friend recommended the Advanced Custom Fields plugin for WP, which I am looking into. I'm an experienced designer but a beginner developer. I accept my naïveté and I'm keen to learn.
Possible structures:
A single WP install with a Page per employee
A Multisite WP install with a Site per employee
Other?
After much searching I'm beginning to think WP might not be a suitable platform for long and busy pages (~80 video embeds per page, added via ACF) with this type of file management requirement. The admin page for my test page is already very slow to update and I haven't even started the file list part.
Since the key feature of this page template will be the ability to list hundreds of downloadable files, it seems logical to me to pick a CMS based on that requirement, rather than pick a familiar CMS and try to force it to do what I want.
Thanks for reading!
I have used
Download Attachments plugin which provide facilities to upload attachment as post meta from admin panel and user can download it from front end. Try it might help you.

WordPress Media as a Custom Post Type

I am building a WordPress website that will allow members to upload media such as videos, images, etc. They will do this on a public form at for example: domain.com/upload
The form will ask for a Title, a brief summary, show some categories to choose from, and finally a file uploader. The user will then be able to submit the form and it will appear on the site as a post but instead of being just text it is a piece of media.
I have created a custom post type and all seems to be fine, the problem I have is how to deal with the media upload, as the default WP method is to upload an item and then manually insert it into the post (and you can have as many inserted as you like). Where as I want users to be only able to upload one file per post and not have to insert the file into a post because the file itself is the post. They will also be able to upload a featured image.
Any ideas on how I can develop this? Thanks.
You could use WP upload methods to upload your file to the server. Then (depending on your upload's media type) you would insert HTML representation of the file into the post (e.g. parse a text file, create tag for image or embed a video).
If you want to see some working example, please let me know. I just outline the flow:
wp-handle_upload() to physically upload a file
wp_update_post() or wp_insert_post() depending on whether you're creating a new user post or editing existing one. Both methods require one argument - Post object. That's where you put your content (as a post_content field of course) and post data

Resources