Custom file path in products
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 7
- Joined: 03 Aug 2020, 13:30
Custom file path in products
Hello,
I am using Ameous package in Laravel 6.x version.
I would like to ask how can I change the upload path of product images?
So far I found I can change upload folders in shop.php config file like this:
Now, I would like to have same ulr media paths in view since they are not shown in admin panel:
https://www.dropbox.com/s/2mf5wtveou5e5 ... 2.png?dl=0
How can I do this, please?
Thanks in advance,
Milos
I am using Ameous package in Laravel 6.x version.
I would like to ask how can I change the upload path of product images?
So far I found I can change upload folders in shop.php config file like this:
Code: Select all
'fs' => [
'adapter' => 'Standard',
'basedir' => storage_path('app/public'),
'tempdir' => storage_path('tmp'),
],
https://www.dropbox.com/s/2mf5wtveou5e5 ... 2.png?dl=0
How can I do this, please?
Thanks in advance,
Milos
Re: Custom file path in products
You have to adapt the baseurl for the "fs" configuration in that case:
https://github.com/aimeos/aimeos-larave ... lt.php#L47
https://github.com/aimeos/aimeos-larave ... lt.php#L47
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 7
- Joined: 03 Aug 2020, 13:30
Re: Custom file path in products
Hello again,
First, thanks for the fast reply.
Now I would like to know one more thing about this topic.
So, I updated shop.php like you said:
Now I need those paths to be saved in media table. I miss that "/storage/" in link and preview fields.
https://www.dropbox.com/s/174z22cxggwb3 ... 8.png?dl=0
Do I need to extend some class to get this? And if I do what would be the way to to that?
Thanks in advance,
Milos
First, thanks for the fast reply.
Now I would like to know one more thing about this topic.
So, I updated shop.php like you said:
Code: Select all
'fs' => [
'adapter' => 'Standard',
'basedir' => storage_path('app/public'),
'tempdir' => storage_path('tmp'),
'baseurl' => config('app.url') . '/storage/',
],
https://www.dropbox.com/s/174z22cxggwb3 ... 8.png?dl=0
Do I need to extend some class to get this? And if I do what would be the way to to that?
Thanks in advance,
Milos
Re: Custom file path in products
The file paths in the database are relative to your "basedir" directory and that's OK:
The "baseurl" path will be prepended to your paths in the database to get the real URL.
Code: Select all
'basedir' => storage_path('app/public')
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star