Open to all! Ask other shopowners for help.
LeeFoster
Contributor
Posts: 263 Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times
Post
by LeeFoster » Thu Feb 17, 2022 2:03 pm
Afternoon all,
I am working on adding an image upload to the account edit & create pages using a hook, I believe I have most of it done but I am having an issue when trying to upload the image.
When I try to do the upload I am getting the below error. I know I must have missed something or I'm not including a connection to the class so if someone can help it is much appreciated.
Fatal error: Uncaught Error: Class 'upload' not found
ecartz
Core Team
Posts: 3084 Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times
Post
by ecartz » Thu Feb 17, 2022 2:23 pm
You have to copy the class from admin/includes/classes/ to one of the catalog locations, e.g. includes/system/override/
LeeFoster
Contributor
Posts: 263 Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times
Post
by LeeFoster » Thu Feb 17, 2022 2:44 pm
ecartz wrote: ↑ Thu Feb 17, 2022 2:23 pm
You have to copy the class from admin/includes/classes/ to one of the catalog locations, e.g. includes/system/override/
Yep, that got rid of the error. Now I just need to figure out why it doesn't upload the file or insert the file name into the DB.
LeeFoster
Contributor
Posts: 263 Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times
Post
by LeeFoster » Thu Feb 17, 2022 3:45 pm
I'm gonna say yes but we both know I didn't so I'm going to go look into that now
LeeFoster
Contributor
Posts: 263 Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times
Post
by LeeFoster » Thu Feb 17, 2022 3:57 pm
Made progress and have the function working for when I'm editing an account, need to get it to insert now for new accounts.
LeeFoster
Contributor
Posts: 263 Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times
Post
by LeeFoster » Thu Feb 17, 2022 5:43 pm
@ecartz is a hook the right way to do this or is creating a customer data module a better option?
ecartz
Core Team
Posts: 3084 Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times
Post
by ecartz » Thu Feb 17, 2022 6:13 pm
You can use the same customer data module on both pages. You'd need two hooks for that.
LeeFoster
Contributor
Posts: 263 Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times
Post
by LeeFoster » Thu Feb 17, 2022 6:29 pm
ecartz wrote: ↑ Thu Feb 17, 2022 6:13 pm
You can use the same customer data module on both pages. You'd need two hooks for that.
So customer data module is better then
LeeFoster
Contributor
Posts: 263 Joined: Sun Feb 28, 2021 9:41 pm
Phoenix Version: v1.0.8.20
Has thanked: 1 time
Been thanked: 5 times
Post
by LeeFoster » Fri Feb 18, 2022 12:00 pm
Working with the cd modules and have the file upload showing I just need to get the file to upload and the data in the the db now.
If anyone has done this or has any ideas please shout up.