add_filter('wp_all_export_csv_rows', 'wp_all_export_csv_rows', 10, 3);
function wp_all_export_csv_rows( $articles, $options, $export_id ) {
if ( $export_id == '40' ) { // change to your export ID
foreach( $articles as $key => $article ) {
if ( array_key_exists( 'ID', $article ) ) {
$i = 1;
$product = wc_get_product( $article['ID'] );
$m_category = get_terms( ['taxonomy' => 'product_cat'] );
if ( ! empty( $m_category ) ) {
// use $m_category->parent to check if it's a parent category or sub-category.
$articles[ $key ]['Category '] = $m_category->name; //category name from category object
}
if ( ! empty( $product ) ) {
$featured_img = wp_get_attachment_url( $product->get_image_id() );
if ( ! empty( $featured_img ) ) {
$articles[ $key ]['Image ' . $i] = $featured_img;
}
$other_imgs = $product->get_gallery_image_ids();
if ( ! empty( $other_imgs ) ) {
foreach ( $other_imgs as $id ) {
$i++;
$img = wp_get_attachment_url( $id );
$articles[ $key ]['Image ' . $i] = $img;
}
}
}
}
}
}
var_dump($m_category);
return $articles; // Return the array of records to export
}
add_filter('wp_all_export_csv_rows', 'wp_all_export_csv_rows', 10, 3);
]]>in one of the latest updates, it seems that the formatting of the image gallery has changed. The consequence of that is that only the first image is seen as image by various plugins, such as WPML and WPAllExport for all newly added properties.
For existing properties, it makes that the first (featured) image is listed twice in the xml file.
WPML support told me:
I ran several tests and different combinations of the configuration, however the images still don\’t appear in the Translation Editor.
This is due to the fact that these images are handled in a different way so I recommend you to contact the Estatik\’s support service and ask them about this behavior
You can use the featured image as a reference of the behavior you expect from the images in the gallery
WPAllExport support told me:
I’m seeing that the gallery images are stored in the “es_property_gallery” custom field, as a serialized list of image IDs:
a:3:{i:0;s:3:”679″;i:1;s:3:”677″;i:2;s:3:”678″;}
What has changed, and how to fix all these issues?
]]>What i need is to achieve this logic
I have custom taxonomy in XML called {Conditions} which return value of each post as “Used” “New”
Values appear correctly, but where i need to export XML required different values then those above, which i need to replace during export.
Logic:
If {Conditions} = “Used”
Set Used = “20”;
Elseif{Conditions} = “New”
Set New = “10”;
In this case, my site is running in its own PHP-FPM pool. Ownership was being granted to the pool user, www-pool1 and to the ubuntu group:
sudo chown -R www-pool1:ubuntu wp-content/uploads/wpallimport
After some experimentation it turned out that I needed to do this instead:
sudo chown -R www-pool1:www-data wp-content/uploads/wpallimport
The same applies if you’re experiencing the same writable error for WP All Export.
(you’ll need to make sure the path supplied in this command matches the location of your wpallimport directory).
]]>Your server terminated the export process
Ask your host to check your server’s error log. They will be able to determine why your server is terminating the export process
QUESTION?
I want to export products feed include only variations (I have size variation) and images of product.
sample feed attached.
pls help?
]]>Is it possible to export variations with parent product names, instead of the default “Variation ### of [product name]”.
Also variations don’t have the excerpt from the parent product.
Thanks for support
]]>