how to deal with woocommerce products

Closed
ImportWP Pro - WordPress XML & CSV Importer ImportWP Pro - WordPress XML & CSV Importer June 02, 2019
Login to reply
James Collings Support Agent commented privately
GAlex Stefani commented privately
James Collings Support Agent commented privately
GAlex Stefani
6 months ago

ok so after playing a lot those are the fields that i cannot find (at least those that i need)

image gallery photos and

attributes

thanks in advance for your help

GAlex Stefani
6 months ago

thanks for the very fast reply!!!!

generally i have no variable products so that wont be a problem for now. 

I must say that both your plugin and your support is very good.

GAlex Stefani commented privately
James Collings Support Agent
6 months ago

Hi GAlex Stefani,

ImportWP is a generic importer, while i am currently working on an importer template specific to woocommerce is it is not yet ready.

You can still import WooCommerce products if you know all the product custom fields you need to set if you are just importing simple products? or are you trying to also import variable products?

The best way to do conditional values is to add a script to your themes functions file, for example the following script will take a stockstatus of 'Y' or 'N' and convert is to instock or outofstock.

function jciwp_ticket_3774_woocommerce_stock_status($value){


 // Uncomment to limit this to a specific importer based on its id
 // if(JCI()->importer->get_ID() !== 45177) {
 // return value;
 // }

 // if field is populated
 if('Y' === $value){
  return 'instock';
 }

 return 'outofstock';
}
add_filter('iwp/custom_field/_stock_status', 'jciwp_ticket_3774_woocommerce_stock_status');

You can override any custom field values by adding a filter 'iwp/custom_field/{field_name}'

Hope this helps.
James

GAlex Stefani
6 months ago

ok I think i found how to find fields etc for woocommerce using this for referce and adding them to custom fileds section adding "_". for example "_regular_price" and "_price" 

but i am facing an other problem right now.

in my xml the "stock status" has value Y or N. Woocommerce _stock_status field only allow the values "instock" or "outofstock". 

how can i add something like an if statement. is that even possible? 

GAlex Stefani
6 months ago

cannot find where to add stock levels, images, stock availability etc generally only few fields. can you please advise?