CSV Import Question/Possible Bug?
Hi,
First off, please please will you help me with this issue. I have read *every* item in the forums about CSV import, I have read the tutorials, and I have read all the code concerning the CSV importer in Vantage. I have asked on the general forum, with no response (fair enough, that's community support after all). I believe what I want to do is supported already in Vantage, but there is NO DOCUMENTATION for it, and all my requests for help are being ignored.
I have put a lot of effort into personally supporting the Vantage forums recently, in the naive hope that perhaps that would help me get seen and helped by the Appthemes' crew when I had questions of my own. I just don't get why it is so hard to answer the question, since I've explained it so clearly.
If you enter a listing via the admin or front end and that listing has a custom field which is a multiple checkbox, each ticked value gets stored separately in wp_postmeta (and that's fantastic).
If I import a CSV that includes that custom field with multiple values separated by commas, my listing gets imported but I only have one row on wp_postmeta with all my custom field values strung together. These two methods of data entry SHOULD behave in the same way, so given that they do not behave the same way, that is potentially a bug in Vantage.
However, I don't think it would be a bug, if Appthemes could simply explain how to specify that a custom field is an array, when setting up the extra custom fields processing in my child theme's functions.php.
In my child them functions.php , I have this function, which is as per the instructions found on Apptheme's forum and tutorials:
Code:
function myown_custom_csv_fields( $args )
{
$args['custom_fields']['price'] = array( 'internal_key' => 'app_price' );
$args['custom_fields']['specialoffers'] = array( 'internal_key' => 'app_special-offers' );
$args['custom_fields']['contactemailaddress'] = array( 'internal_key' => 'app_business-owner-email-address' );
$args['custom_fields']['day'] = array( 'internal_key' => 'app_day' );
$args['custom_fields']['time'] = array( 'internal_key' => 'app_time' );
$args['custom_fields']['extrainfo'] = array( 'internal_key' => 'app_extra-info' );
$args['custom_fields']['age-group'] = array( 'internal_key' => 'app_age-group' );
return $args;
}
add_filter( 'va_csv_importer_args', 'myown_custom_csv_fields' );
The first 3 $args are standard text field custom fields. The next 4 $args rows relate to multiple checkbox custom fields which allow 'tick all that apply'.
I *think* I need some extra array() code around what I've got there for this to work as expected, but I can't figure it out. I have seen this comment in importer.php but I can't translate that into what I need in my functions.php?
Code:
/*
* Args can have 3 elements:
* 'taxonomies' => array( 'valid', 'taxonomies' ),
* 'custom_fields' => array(
* 'csv_key' => 'internal_key',
* 'csv_key' => array(
* 'internal_key' => 'key',
* 'default' => 'value'
* )
* ),
* 'tax_meta' => array( array( 'tax' => array( 'csv_key' => 'tax_key' ) )
*/
I don't generally go for irate forum posts, preferring to try to get help by asking reasonably. I do feel a bit let down with support for what is a paid-for theme, which advertised (somewhat misleadingly) 365 days of support as part of the purchase price. I am on my fourth commercial Vantage-based dev project in the space of 3 months, and I am sure I could do a lot more Apptheme's based projects, but I really need some support from time to time. I don't need my hand holding, just a very occasional explanation of something that usually already exists but isn't documented.
I think the main reason I am so upset with the support here, is because I'm not asking for you to change anything, to supply a bespoke code snippet or anything complicated (for you)....just to tell me how the CSV import system actually works for multiple checkbox custom fields.
Maybe as a larger issue, you need to consider paid support packages...at this point, even though I thought I'd already paid for 365 days of support' when I purchased the theme, I'd be willing to pay extra just to get this one issue resolved. I don't care whether it was a per-ticket cost or a per-month cost, just so long as someone, anyone would provide the answer...
Here's hoping!
red20
p.s. I'm usually quite friendly and accomodating