You are here:  » Recall saved field mappings


Recall saved field mappings

Submitted by zway on Thu, 2016-04-14 01:38 in

Hey David,

Is there a way to recall the saved fields that are currently mapped when you hit register on the feeds?

Regards,

Zway

Submitted by support on Thu, 2016-04-14 07:32

Hello Zway,

Sure - there's a mod for just that in this thred...

Cheers,
David.
--
PriceTapestry.com

Submitted by Nic0904 on Mon, 2016-04-18 17:37

Hi David,

This looked like a useful mod, so I tried it out and it didn't seem to work. The linked thread seems to be based on an earlier version and that area of the code in feeds_register_step2.php is different. Do you have an update for this mod?

Cheers
Dave

Submitted by support on Mon, 2016-04-18 18:19

Hi Dave / Zway,

Sorry about that - i'll consolidate threads accordingly for 15/09A, in the mean time, for 15/09A edit admin/feeds_register_step2.php and look for the following code at line 85:

  $productRecord = array();

...and REPLACE with:

  else
  {
    $sql = "SELECT * FROM `".$config_databaseTablePrefix."feeds` WHERE filename = '".database_safe($_GET["filename"])."'";
    if (database_querySelect($sql,$feeds))
    {
      $feed = $feeds[0];
      $_POST["merchant"] = $feed["merchant"];
      $_POST["field_merchant"] = $feed["field_merchant"];
      $_POST["user_category"] = $feed["user_category"];
      $_POST["user_brand"] = $feed["user_brand"];
      foreach($config_fieldSet as $k => $v)
      {
        $_POST["field_".$k] = $feed["field_".$k];
      }
    }
  }
  $productRecord = array();

Cheers,
David.
--
PriceTapestry.com

Submitted by BobL on Tue, 2016-05-24 11:48

Bob L.

Hi David,
Hope all is well.

I add the above mod to my version 15/09A.
It pulls in everything that is field_(name) but doesn't want to pull the user_(name).
I've only added 1 extra user_currency.

Any ideas?

Thanks in advance.

Submitted by support on Tue, 2016-05-24 12:07

Hello Bob,

The following REPLACEment will include user_ versions of custom fields...

  else
  {
    $sql = "SELECT * FROM `".$config_databaseTablePrefix."feeds` WHERE filename = '".database_safe($_GET["filename"])."'";
    if (database_querySelect($sql,$feeds))
    {
      $feed = $feeds[0];
      $_POST["merchant"] = $feed["merchant"];
      $_POST["field_merchant"] = $feed["field_merchant"];
      foreach($config_fieldSet as $k => $v)
      {
        $_POST["field_".$k] = $feed["field_".$k];
        if (isset($feed["user_".$k]))
        {
          $_POST["user_".$k] = $feed["user_".$k];
        }
      }
    }
  }
  $productRecord = array();

Cheers,
David.
--
PriceTapestry.com

Submitted by BobL on Tue, 2016-05-24 12:18

Bob L.

Wow Mr. David.
That was fast, thank you.
Really great support.
Had me double checking my code copy and couldn't see anything difference.

Sweet. t/y Mr. Midas touch.