News:

Support the VirtueMart project and become a member

Main Menu

one images for all product

Started by marvays, March 30, 2017, 11:08:43 AM

Previous topic - Next topic

marvays

hi. i have question. my client want add one image with your logo to all product.
Any idea?

1. i need save my time to adding one image 500x for 500 product.
2. save speed of loading time, because, if i will be uploading one image 500x, i will be have 500 (the same) images.

AH

#1
Just point all products to the single image in admin -

or do some database table entries

In virtuemart_product_medias

Ensure the virtuemart_media_id is known

Then just add the 500 entries for the relevant virtuemart_product_id's so they all have the same virtuemart_product_media_id
Regards
A

Joomla 4.4.5
php 8.1

marvays

Quote from: AH on March 30, 2017, 11:54:27 AM
Just point all products to the single image in admin -
i am not understand U :(

jenkinhill

Are you wanting to replace the product image with this logo? Assuming that the products are already entered, then as AH says, do it in the database!

First: Upload your logo to a product, then look in the media list in VM backened.  Then look at the media file ID column, on the far right in VM3 admin. Then you can see the ID of that image.

Second: Open phpMyAdmin and locate the table ###_virtuemart_product_medias where you will see the product IDs with their corresponding media IDs. You need to replace all media IDs with your logo's media ID. You can do that by running some SQL, or manually editing.

This is for VM3 - I'm assuming that the VM2 tables are similar unless you have now updated your VM version.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Milbo

Uhhmm,.. I wouldnt do that,....there is a lot easier way, which is even more performant.

Create a product, attach the media you want to display with it,... dont give it any category. Set it unpublished, write as name "My product pattern". Note the product id somewhere (for example in your mind)

Now edit your origin product, on the first tab is a possibility to set the parent product, set there the noted product id, done. Any product, which should use this media, should be derived from the parent. Thats it.

Of course, the whole concept of media means, that you can use always the same media and when you change the image of the media, it is "replaced" for any product which uses this media. This is the basic concept.

But there is no need to touch the db. Learn to love the parent products and use them as pattern, it is very handy.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/