Path of image code in magento - magento

I am using magento 1.6.I want to know which files contains the code for image functions like when you uploading the image ,excluding the image etc.Actually i want to hide products as per user category.

There are several files handling your images. Look at app/code/core/Mage/Catalog/Helper/Image.php as an entry point.

Related

Extracting the main product image from a ecommerce product page

I am looking for options to extract the main image from a product page on a retailer website, the problem is there are multiple images in a product page (related images) , one approach I thought would work would be to extract all the image links, download each one of them and compare the size of each of those images and consider the one has the largest size in terms of storage bytes as the one that is the main product image.
Obviously that would be a very inefficient approach , we know that most of the retailers use certain ecommerce platforms like magento , bigcommerce etc, the major ecommerce platforms are only handful , is it possible to detect the ecommerce platform and leverage the template provided by each one of them to precisely extract the main product image?
I know the approach would never be perfect , but I am looking an algorithm that would be mostly accurate about 80% or so , is it doable?
Do you have a list of retailers that you're looking to extract the images from? If so, then go through each retailer's site manually, look at its HTML, and create some code that would successfully extract the image from this particular retailer. If not, then I'm afraid you're out of luck - you could just grab the biggest image on the page, or use some other heuristic, but there's no guarantee that you're grabbing the actual product image.
The problem with creating some sort of generic utility is that each e-commerce platform has its own structure for displaying product images, and that structure could be changed with each site. For example, just because Magento usually structures its images in a certain way, doesn't mean you'll always see them that way - it's entirely up to the theme that's currently applied.
You can use simple dom html lib to extract html. In terms of magento, the product thumbnail image is the img tag inside "product-image" class on product page. You can extract it as a good sized thumbnail image.
If you know the retailers and image as well download it through a script and check the sizes in a foreach loop statement and save the biggest one.
Thanks

Magento Updating Products with csv overwrites Image

On Magento 1.9 I managed to upload several products via csv including images with Dataflow - Profiles.
Now I'd like to update for example all the descriptions. But when I upload the CSV file, it overwrites my images.
When I leave the path media/import it imports the same image a
second time. Now the product has the same image stored twice.
When I write the path /0/5/imagename.jpg where magento automatically
saved the image, it gives me a "images doesn't exist" error.
when I leave the "image" field empty, it sets the default image to "none"
and shows no image in the frontend.
When I delete the whole cell
for images, it gives me a "broken link" symbol in the product
details page.
How can I update product details without messing with my images? Sorry if I missed something?

Store images in prestashop from URL

I have a web service that is called to get products for a prestashop project. The web service is returning information about the product and also each product have a link representing the image of the product. I know that prestashop stores images into "img/p/id/picture.ext", but I want to find a solution to store that URL in the database and output everywhere in template files that picture. I want to know if there is a module for this, or how should I solve this the fastest way ? Thank you guys!
The easiest way would be to save the product image URL in an unused product field (e.g., Reference) and modify the src attribute of the product image img tag in product.tpl:
<img src="{$product->reference}">

How to import mangeto product gallery from magento dataflow profile?

I just tried to export all products from magento using magento import/export. i got all products with gallery url's in a .CSV file.
But when i tried to import that file in another magento store with same category structure, I got 'small', 'thumbnail' and 'base' images at admin but not able to see any gallery images which is in exported magento store.
How can i get all product gallery images?
Thanks in advance
To import the images also you need to copy them inside media/import folder keeping the rest of the path intact.
For example if you have in the exported file an image names '/i/m/image.jpg', you should copy that image to media/import/i/m/image.jpg of your other website.
Magento will take care of the rest (copying the image in the right folder and renaming it of necessary).
[EDIT]
For every image you need a new row in the import file. Near the end of the file there should be some columns called _media_attribute_id,_media_image,_media_lable,_media_position,_media_is_disabled. These should be filled with the correct values.
Let's take an example. Let's say you have 2 images for a product with SKU 123. The import file should look like this (I skipped the rest of the attributes):
sku,....,_media_attribute_id,_media_image,_media_lable,_media_position,_media_is_disabled
123,....,88,/i/m/image1.jpg,"Some label here",1,0
,....,88,/i/m/image2.jpg,"Some other label",2,0
As you can see there are 2 rows. One for each image. On the second row all the fields are empty except the ones I mentioned above. (The value for _media_attribute_id might be different).

Magento product csv upload with images

I’m trying to upload the csv file with about 300 products in and I’m having a couple of issues with it.
1). I have put the images in media/catalog/product/images/ and the path I’m giving in csv is /images/image_name.jpg. Now when I import the csv I can see the products with image at frontend. But in admin panel, I can’t see any image against the products. I don’t know where I’m doing wrong to show these images in admin panel.
2). I have a couple of multi select attributes. CSV import is not working with multi select attributes (it just picks up the first one). Any solution for this?
You are placing your images to wrong folder and they should be in media/import instead with right permissions and case sensitive names.
Refer to http://blog.calientedesign.com/?p=56 or perform a web search for "magento image import"
As Jonathan said, you must put all of your images that you wish to import into media/import. The other crucial part of this is your CSV. Every image name must of course match properly, but it must have a forward slash in front of the image name. So, if you put 'image1.jpg' into media/import, then in your spreadsheet, the image columns should have '/image1.jpg'.

Resources