Advertisement:

Author Topic: AdImporter Add-On Plug-In: How Do You Add Custom Fields??  (Read 307 times)

d33p

  • Newbie
  • *
  • Posts: 17
AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« on: January 28, 2019, 09:52:46 pm »
I am looking for the names of the extra custom fields like salary, department, and minimum experience for jobs.

I am using OSClass with the Importer Plugin.

The example file uses:
 
Code: [Select]
<custom name="client">Manny Testing Co</custom> 
        <custom name="tip">Vanzare</custom>   

and so I see the format for adding custom fields should look like this.
So I added a few extra fields to my XML file to upload:

 
Code: [Select]
<custom name="salary">Manny Testing Co</custom>
   <custom name="department">Vanzare</custom> 
 <custom name="minimumexperience">Vanzare</custom>   

I also wanted to know how to add here in index.php for that module:
Code: [Select]
Params::setParam("contactEmail", @$listing->getElementsByTagName("contactemail")->item(0)->nodeValue);   
is already there.  For custom field is it like this?
   
Code: [Select]
Params::setParam("customSalary", @$listing->getElementsByTagName("customSalary")->item(0)->nodeValue);

So far, no luck.  Thanks kindly for any help!!!!!!!!!!!!!~

Have  a good day, ppl. This is my first post here on this forum.
« Last Edit: January 28, 2019, 09:56:57 pm by d33p »

d33p

  • Newbie
  • *
  • Posts: 17
Re: AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« Reply #1 on: January 29, 2019, 07:54:22 pm »
I also had tried:
Code: [Select]
Params::setParam("customSalary", @$listing->getElementsByTagName("salary")->item(0)->nodeValue);

patrickFromCroatia

  • Hero Member
  • *****
  • Posts: 753
Re: AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« Reply #2 on: January 30, 2019, 08:38:36 pm »
Hello,

You are talking about the free plugin by Osclass: https://market.osclass.org/plugins/ad-management/ad-importer_53?
From what I see custom fields import is integrated into the plugin.

Regards.

d33p

  • Newbie
  • *
  • Posts: 17
Re: AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« Reply #3 on: January 30, 2019, 09:22:43 pm »
Yes; it's the free plugin.

OK, very cool that it's already set to import custom fields.



But how do I structure them in the .XML file I create and upload with the add-on?

Apparently, I haven't found the answer yet...  :(

The example file had this:

Code: [Select]
<custom name="client">Manny Testing Co</custom>
        <custom name="tip">Vanzare</custom> 

But changing to
Code: [Select]
<custom name="salary">test</custom>
or
any of the other fields I'm looking for like
 "minimumExperience" , "departmentorunit" , "numberOfPositions"
and
then upload I only get the fields that are already provided on the example XML.



And, I DLed another module for extended jobs fields, and those will have even MORE fields I would want to import.
So, it would be great if any forum members could provide not only the proper way to write the field names in the XML, but also where I can find any new fields another add-on module may add. 

PS...I also looked in the DB but couldn't find the KWs for these fields...I'm guessing it's there somewhere??!?


thx, kindly d33p  :)
« Last Edit: January 30, 2019, 09:36:12 pm by d33p »

d33p

  • Newbie
  • *
  • Posts: 17
Re: AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« Reply #4 on: January 30, 2019, 10:29:05 pm »
OK...I still haven't had ANY success.

However, the jobs attributes plug-in provided some answers about the NEW attributes,  at least...

From ModelJobs.php

 
Code: [Select]
/**
         * Insert Jobs attributes descriptions
         *
         * @param int $item_id
         * @param string $locale
         * @param string $desiredExp
         * @param string $studies
         * @param string $minRequirements
         * @param string $desiredRequirements
         * @param string $contract
         * @param string $companyDescription
         */

  /**
         * Insert Jobs attributes
         *
         * @param int $item_id
         * @param string $relation
         * @param string $company_name
         * @param string $position_type
         * @param int $salaryMin
         * @param int $salaryMax
         * @param int $salaryPeriod
         * @param int $salaryMinHour
         * @param int $salaryMaxHour
         */

These comments should correspond to the name used for the new job attributes strings, no??

However, what doesn't work is this:
Code: [Select]
<studies>22222222222222222222222</studies> 
or these:

Code: [Select]
<custom name="studies">32534</custom>
 <s_studies>22222222222222222222222</s_studies> 
<custom name="s_studies">32534</custom>


I also added

Code: [Select]
Params::setParam("studies", @$listing->getElementsByTagName("studies")->item(0)->nodeValue);
and

Code: [Select]
  Params::setParam("s_studies", @$listing->getElementsByTagName("s_studies")->item(0)->nodeValue);
to index.php in the importer.

Any help wld be greatly appreciated!~
« Last Edit: January 30, 2019, 10:41:31 pm by d33p »

patrickFromCroatia

  • Hero Member
  • *****
  • Posts: 753
Re: AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« Reply #5 on: January 30, 2019, 10:50:46 pm »
Are you sure that you use your custom field identifier, not name here: <custom name="studies">? Check the attached screenshot.

Regards.

d33p

  • Newbie
  • *
  • Posts: 17
Re: AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« Reply #6 on: January 30, 2019, 11:01:56 pm »
Are you sure that you use your custom field identifier, not name here: <custom name="studies">? Check the attached screenshot.

Regards.

Thanks. It's useful that you provided me with the place where the custom name is assigned.

However, it STILL did not work, using:
Code: [Select]
<s_department>22222222222222222222222</s_department> 
<custom name="s_department">32534</custom>
 <department>22222222222222222222222</department> 
<custom name="department">32534</custom>

in the upload XML

and

Code: [Select]
Params::setParam("s_department", @$listing->getElementsByTagName("s_department")->item(0)->nodeValue);
Params::setParam("department", @$listing->getElementsByTagName("department")->item(0)->nodeValue);

in index.php in importer.

So, I'm still not having any success with this....anyone have any ideas?>?>

patrickFromCroatia

  • Hero Member
  • *****
  • Posts: 753
Re: AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« Reply #7 on: January 30, 2019, 11:25:53 pm »
You tried using only "<custom name="CUSTOM FIELD IDENTIFIER">something something</custom>", without any mods in index.php?

Regards.

d33p

  • Newbie
  • *
  • Posts: 17
Re: AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« Reply #8 on: January 30, 2019, 11:42:32 pm »
You tried using only "<custom name="CUSTOM FIELD IDENTIFIER">something something</custom>", without any mods in index.php?

Regards.

I also tried both
Code: [Select]
Params::setParam("s_department", @$listing->getElementsByTagName("s_department")->item(0)->nodeValue);
and


Code: [Select]
Params::setParam("department", @$listing->getElementsByTagName("department")->item(0)->nodeValue);
but still zero success.  :( :( :( :( :(





in index.php

d33p

  • Newbie
  • *
  • Posts: 17
Re: AdImporter Add-On Plug-In: How Do You Add Custom Fields??
« Reply #9 on: January 30, 2019, 11:47:05 pm »
You tried using only "<custom name="CUSTOM FIELD IDENTIFIER">something something</custom>", without any mods in index.php?

Regards.

I also tried

Code: [Select]
Params::setParam("s_department", @$listing->getElementsByTagName("s_department")->item(0)->nodeValue);
and


Code: [Select]
Params::setParam("department", @$listing->getElementsByTagName("department")->item(0)->nodeValue);


in index.php in the importer addon folder, but still zero success.  :( :( :( :( :(

hmm..upon closer look at existing entries, maybe  I messed up!  :P

The existing fields look like this:

Code: [Select]
Params::setParam("cityArea", @$listing->getElementsByTagName("city_area")->item(0)->nodeValue);
and since there is no s_department field, it should have looked more like this, I believe:

Code: [Select]
Params::setParam("department", @$listing->getElementsByTagName("s_department")->item(0)->nodeValue);
or

Code: [Select]
Params::setParam("departmentOrUnit", @$listing->getElementsByTagName("s_department")->item(0)->nodeValue);
but .....still no success.



OK

This worked!!!!!!!!!!!!!!

Code: [Select]
<custom name="s_salary">42534</custom> in XML
and
Code: [Select]
Params::setParam("salary", @$listing->getElementsByTagName("s_salary")->item(0)->nodeValue);
in index.php
« Last Edit: January 30, 2019, 11:56:39 pm by d33p »