1 Comment

How can i export multiple table values as a single file

Separate store view which reverts back to the default store view

I need to export different tables values as same file,

Name – sku – category url – image path

Name:

category_products_entity_varchar :: [ value as name] {attribute_id = 71}

Sku:

catalog_products_entity :: [sku]

category url:

category_products_entity_varchar [value as category] {attribute_id = 57}

image path :

category_products_entity_media_gallery [value as image path]

Related Posts

  • How can i export multiple table values as a single file (1)
    I need to export different tables values as same file, Name - sku - category url - image path Name: category_products_entity_varchar :: [ value as name] {attribute_id = 71} Sku: catalog_products_entity :: [sku] category url: category_products_entity_varchar [value as […]
  • How can i export multiple table values as a single file (1)
    I need to export different tables values as same file, Name - sku - category url - image path Name: category_products_entity_varchar :: [ value as name] {attribute_id = 71} Sku: catalog_products_entity :: [sku] category url: category_products_entity_varchar [value as […]
  • How can i export multiple table values as a single file specific store (1)
    I need to export different tables values as same file, Name - sku - category url - image path Name: category_products_entity_varchar :: [ value as name] {attribute_id = 71} Sku: catalog_products_entity :: [sku] category url: category_products_entity_varchar [value as […]
  • How can i export multiple table values as a single file (1)
    I need to export different tables values as same file, Name - sku - category url - image path Name: category_products_entity_varchar :: [ value as name] {attribute_id = 71} Sku: catalog_products_entity :: [sku] category url: category_products_entity_varchar [value as […]
  • export all products from magento 2 for import into magento 1.9 programatically (1)
    I have finally come to realize that Magneto 2 is way to buggy and unusable. I have 30,000 products and 1500 categories. What tables do I need to export in order to bring them in magento 1.9? Also, are there any differences I need to know about? I know category paths are stored as […]
  • Download multiple invoice from back end (1)
    I want to select invoice month-vise and download it with a single click. Currently i have go in every invoice and click print. But i want to export all invoice in pdf form. Please tell me how can i acheieve it
  • How add category programmatically magento 2 (2)
    How create a category programatically. With the attributes name, url key, image, path, parent id, is active, description. And How to insert data for a new attribute added by InstallDate a category. Ejm.: new attribute -> code
  • Need url path for categories page (0)
    http://www.awesomescreenshot.com/0815up8se8 This is a backend page dashboard -> product -> categories I am searching for this page code file in cpanel. Can anyone tell me with the path where this file located in cpanel?
  • New products doesn't have .html at the end of the url (1)
    A few months ago I changed the Use Categories Path for Product URLs to no to avoid duplicate urls. Products had .html at the end of the url with or without the category. At this time, I do still have the .html sufix enabled but I've noticed that the new products I upload to Magento […]
  • How to import/transfer products to new database? (1)
    Is there a way to export products from an older database to a new one and also import the image urls? Everything I've read only tells how to import products by placing the images into another file. I just created a new database and still have the folders and complete Magento […]
Separate store view which reverts back to the default store view

1 Comment on this article

  • User October 13, 2016

    QUERY :

    SELECT cpev.value as Name,cpe.sku,gp.value category_url, ea.value image_path FROM catalog_product_entity cpe inner join (SELECT entity_id,value FROM catalog_product_entity_varchar WHERE attribute_id=”71″) cpev on cpev.entity_id = cpe.entity_id inner join (SELECT entity_id,value FROM catalog_product_entity_media_gallery) ea on ea.entity_id=cpe.entity_id inner join ( SELECT category_id, product_id FROM catalog_category_product) eavv on cpe.entity_id =eavv.product_id inner join ( SELECT entity_id,value FROM catalog_category_entity_varchar WHERE attribute_id=’57’) gp on eavv.category_id=gp.entity_id LIMIT 0 , 30

    SCRIPT :

    <?php
    
    ini_set("memory_limit","-1");
    ini_set('max_execution_time', 180000); 
    
    error_reporting(E_ALL | E_STRICT);
    
    ini_set('display_errors', 1);
    
    require_once('app/Mage.php');
    Mage::app();
    
    $products = Mage::getModel("catalog/product")->getCollection()->addAttributeToSelect('name');
    $products->addAttributeToFilter('status', 1);
    
    $fopen = fopen('products.csv', 'w');
    $csvHeader = array("Name","sku","Category","image", "GalleryImages");// Add the fields you need to export
    fputcsv( $fopen , $csvHeader,",");
    
    foreach ($products as $product){ 
    
       $_product = Mage::getModel("catalog/product")->load($product->getId());
       $gallery_images=$_product->getMediaGalleryImages();
    
       $image =Mage::getBaseUrl('media')."catalog/product".$_product->getImage();
    
       foreach($gallery_images as $g_image) {
           $g_images.=$g_image['url']."n";
       }
       $sku = $_product->getSku();
       $name= $_product->getName();
       $categories = $product->getCategoryIds();
       fputcsv($fopen, array($name,$sku,implode(",",$categories),$image,$g_images), ",");
    }
    echo"Done";
    fclose($fopen );
    

    Reply

Add a comment