You are here:  » export all product which not use product feed


export all product which not use product feed

Submitted by technoarenasol on Fri, 2012-10-12 19:38 in

Hi

Can be possible to export All merchant Product list which not use product mapping

Submitted by support on Sat, 2012-10-13 08:36

Hi technoarenasol,

It's a straight forward script, but bear in mind that you would have to run this of course after full import with niche mode disabled ($config_nicheMode = FALSE in config.php). Have a go with the following:

unmapped.php:

<?php
  header
("Content-Type: text/plain");
  require(
"includes/common.php");
  
$sql "SELECT DISTINCT(name) FROM `".$config_databaseTablePrefix."products` WHERE name NOT IN (SELECT name FROM `".$config_databaseTablePrefix."productsmap`)";
  
$link = @mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword);
  @
mysql_select_db($config_databaseName,$link);
  
$result mysql_unbuffered_query($sql,$link);
  if (
$result)
  {
    while(
$row mysql_fetch_array($result,MYSQL_ASSOC))
    {
      print 
$row["name"]."\n";
    }
  }
?>

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Sat, 2012-10-13 08:55

technoarenasol

Thnx David...also give any script Which I Import all master.csv product into product mapping automatically. after that only require add to alter name of particular product.

Submitted by support on Mon, 2012-10-15 08:30

Hi,

Have a go with:

mastermapping.php:

<?php
  header
("Content-Type: text/plain");
  require(
"../includes/common.php");
  require(
"../includes/MagicParser.php");
  function 
myRecordHandler($record)
  {
    global 
$config_databaseTablePrefix;
    
$sql "SELECT id FROM `".$config_databaseTablePrefix."productsmap` WHERE name='".database_safe($record["name"])."'";
    if (!
database_querySelect($sql,$result))
    {
      
$sql "INSERT INTO `".$config_databaseTablePrefix."productsmap` SET name='".database_safe($record["name"])."'";
      
database_queryModify($sql,$result);
    }
  }
  
MagicParser_parse($config_feedDirectory."master.csv","myRecordHandler","csv|44|1|34");
?>

(create, upload and browse to from main either /admin/ or /scripts/ folder)

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Tue, 2012-10-16 07:40

technoarenasol

Can be possible to print also merchant name OR feed name in unmapped product list ??

Nokia asha 302 (merchant 1) OR (merchant1.csv)
Nokia asha 202 (merchant 2)
Nokia asha Pnone 303 (merchant 1)

Submitted by support on Tue, 2012-10-16 08:46

Hi technoarenasol,

Have a go with:

<?php
  header
("Content-Type: text/plain");
  require(
"../includes/common.php");
  
$sql "SELECT name,filename FROM `".$config_databaseTablePrefix."products` WHERE name NOT IN (SELECT name FROM `".$config_databaseTablePrefix."productsmap`) ORDER BY name,filename";
  
$link = @mysql_connect($config_databaseServer,$config_databaseUsername,$config_databasePassword);
  @
mysql_select_db($config_databaseName,$link);
  
$result mysql_unbuffered_query($sql,$link);
  if (
$result)
  {
    
$lastName "";
    while(
$row mysql_fetch_array($result,MYSQL_ASSOC))
    {
      if (
$row["name"] <> $lastName)
      {
        print 
"\n";
        print 
$row["name"];
        
$lastName $row["name"];
      }
      print 
"(".$row["filename"].")";
    }
  }
?>

This will print a list of filenames in which the unmapped product is found, e.g.

Nokia ashs 301 (merchant1.csv) (merchant2.csv)

Note - inline with mastermapping.php I've modified the above to run from /admin/ or /scripts/

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Wed, 2012-10-17 09:07

technoarenasol

Hi David also possible to copy all product name into alternative name ?? means when I import all master.csv product name into product mapping also copy same product name into alternative names.

Submitted by support on Wed, 2012-10-17 09:30

Hi technoarenasol,

If a feed product name is identical to your master product name there is no need for it to be in the Alternatives list since it will be imported anyway as a result of already matching one of the Product Mapping master names - let me know if you're not sure of anythying...

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Wed, 2012-10-17 09:35

technoarenasol

HI David ..I am set $config_nicheMode = TRUE

Submitted by support on Thu, 2012-10-18 08:08

Hi technoarenasol,

I'm not sure I understand I'm afraid - could you perhaps explain more
what you want to put into the Alternatives box when you import
master.csv?

Thanks!

David.
--
PriceTapestry.com

Submitted by technoarenasol on Thu, 2012-10-18 09:55

technoarenasol

Sorry David....some misunderstanding...I think that need to give alternate product name if master product name and merchant feed name are same

But now I realise no need to give alternate name if master.csv and merchant feed name are same...

Submitted by Alex on Thu, 2019-01-17 08:32

Hi David,

I would like to use this for all products with an unique customfield (like EAN/isbn). How would the two scripts look like in that case?

Submitted by support on Thu, 2019-01-17 10:13

Hi Alex,

In the scripts you want to use, just change the WHERE clause in the $sql from:

WHERE name NOT IN (SELECT name FROM `".$config_databaseTablePrefix."productsmap`)

to for example:

WHERE ean = '123456789012'

Cheers,
David.
--
PriceTapestry.com

Submitted by Alex on Tue, 2019-01-22 10:39

Hi David,

My question was not clear i see.
I would like to export products with an EAN code that are not mapped / linked to a product.
Then i would like to import all unique EAN's to make custom products. Not just for 1 specific product.

Submitted by support on Tue, 2019-01-22 11:04

Hi Alex,

Ah - in that case, have a go with the following WHERE clause:

WHERE name NOT IN (SELECT name FROM `".$config_databaseTablePrefix."productsmap`) AND ean <> ''

That will only export products with EAN value...

I wasn't quite sure about the second part of your question regarding import - let me know if you still need help with that having made the export you want...

Cheers,
David.
--
PriceTapestry.com