Results 1 to 1 of 1

Thread: modifying PHP to import ads with attachments w/ custom fields?? help!

  1. #1
    Thread Starter
    mattadika's Avatar
    Join Date
    Apr 2014
    Location
    United States
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    modifying PHP to import ads with attachments w/ custom fields?? help!

    I am trying to import my database of firearms to my site. I have created custom fields and the import.csv file has different fields.

    How do I change the php or import fuctions to allow me to post with the custom fields? I tried modifying the import.php function but i am getting an error:

    Warning: array_combine(): Both parameters should have an equal number of elements in /home/mattadika/public_html/wp-content/themes/classipress/framework/admin/importer.php on line 165

    please help? can someone tell me if this code is correct and if i need to modify importer.php?

    // categories list display
    function cp_create_categories_list( $location = 'menu' ) {
    global $cp_options;

    $prefix = 'cat_' . $location . '_';

    $args['menu_cols'] = ( $location == 'menu' ? 3 : $cp_options->{$prefix . 'cols'} );
    $args['menu_depth'] = $cp_options->{$prefix . 'depth'};
    $args['menu_sub_num'] = $cp_options->{$prefix . 'sub_num'};
    $args['cat_parent_count'] = $cp_options->{$prefix . 'count'};
    $args['cat_child_count'] = $cp_options->{$prefix . 'count'};
    $args['cat_hide_empty'] = $cp_options->{$prefix . 'hide_empty'};
    $args['cat_nocatstext'] = true;
    $args['cat_order'] = 'ASC';
    $args['taxonomy'] = APP_TAX_CAT;

    $args['custom_fields']['manufacturer'] = 'manufacturer';
    $args['custom_fields']['model'] = 'model';
    $args['custom_fields']['caliber'] = 'caliber';
    $args['custom_fields']['firearm type'] = 'firearm type';
    $args['custom_fields']['email'] = 'email';
    $args['custom_fields']['phone'] = 'phone';
    $args['custom_fields']['price'] = 'price';


    return appthemes_categories_list( $args );

    }
    function childtheme_add_importer_args_filter( $args ) {
    // add args
    $args['custom_fields']['csv_extra_field_1'] = 'cp_extra_field_1';
    $args['custom_fields']['csv_extra_field_2'] = 'cp_extra_field_2';

    return $args;
    }
    add_filter( 'cp_csv_importer_args', 'childtheme_add_importer_args_filter', 10, 1 );


    add_filter( 'cp_csv_importer_args', 'childtheme_add_importer_args_filter', 10, 1 );

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. CSV Import with custom fields for Classipress
    By swaynevds4755 in forum ClassiPress General Discussion
    Replies: 24
    Last Post: March 16th, 2016, 11:38 AM
  2. Samcy ClassiPress Import von 'custom fields'
    By audioboerse in forum Help Using ClassiPress
    Replies: 1
    Last Post: May 22nd, 2014, 04:53 PM
  3. Custom Fields CSV Import Question
    By red20me in forum Vantage General Discussion (Legacy)
    Replies: 1
    Last Post: October 16th, 2013, 06:28 AM
  4. import custom fields - possible?
    By almightyeric in forum Report ClassiPress Bugs
    Replies: 4
    Last Post: August 18th, 2012, 04:03 PM
  5. Custom Fields Import
    By bbihun12 in forum Vantage General Discussion (Legacy)
    Replies: 1
    Last Post: August 15th, 2012, 03:33 PM