- Posts: 39
- Thank you received: 0
product image, where association to product_id?
I want to display a few products in a module, which I'm doing on my own, but I can not find the associated link to the pictures of the product. The pictures are stored in media/.... , but how can I display the pictures of e.g a product with the product_id of '20' (in MySQL)?
If the link would be saved in the database, I could do something like that:
But how can I get the link to the picture belonging to the product?
Thank You,
Storm
Please Log in or Create an account to join the conversation.
Like that:
SELECT * FROM jos_hikashop_file WHERE file_type="product" AND file_ref_id=20
Please Log in or Create an account to join the conversation.
I'm gonna take a look at it, but why is e.g in the file views->product->tmpl->show.php no query with "SELECT...."?
Regards,
Storm
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The path does no work, too
Please Log in or Create an account to join the conversation.
The path there is a relative path from the upload folder specified in the configuration. That's maybe why you're saying that it doesn't work ? You should prepend to it the upload path from the configuration.
Please Log in or Create an account to join the conversation.
The images in the upload folder have a different name than the path.
E.G:
In table: test_img.jpg
In folder: test_img_128495603.jpg
The code above would give me the path, if the names were equal.
Regards,
Storm
Please Log in or Create an account to join the conversation.
Since it works everywhere, it must be something else which is creating the problem.
Please Log in or Create an account to join the conversation.
The images in the folder: joomla/media/com_hikashop/upload are not equal to the paths in the table.
I don't know why, but the images in the folder have got a number after their name.
Or am I in the wrong folder?
:blink:
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
but why doesn't it work, when I take the value of path_file, e.g "450 8mb11 pic3.jpg"
and add it to the location of the upload folder:
localhost/joomla/media/com_hikashop/upload/thumbnail/450 208mb11 20pic3.jpg
It does not find the file...
Thank You for your help
Please Log in or Create an account to join the conversation.
If the path_file has a file name which doesn't exists in the upload folder, there is only one reason: that file has been deleted manually via FTP and you should not see it when editing the product in the back end but instead you should see the default bar code image.
Please Log in or Create an account to join the conversation.
I've got it, there are two tables, one with the prefix "bak" and one with "jos".
I haven't noticed the "jos"- table (it's the right one).
Is the "bak" table important? Can I drop this table?
Regards,
Storm
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.