V
V
Vitaly Morozov2019-04-21 10:00:34
WordPress
Vitaly Morozov, 2019-04-21 10:00:34

How to solve the problem with importing products in WooCommerce?

The situation is this: After importing products via WP All import or Product CSV Import Export, the products are imported, displayed by category, but the names of the products are not visible in the Ajax search and are not filtered by price, or rather, the filter does not see prices. If you resave the product in the admin panel without changing anything, then everything works right away and the filter by price and Ajax search. There was a similar problem with product attributes, after importing the "Specifications" tab was not displayed in the product, after resaving everything became normal, the developer helped to solve the problem with the following code:

add_action( 'woocommerce_before_single_product', 'ec_child_modify_display_specs_attr' );

function ec_child_modify_display_specs_attr() {
  global $post;

  update_post_meta( $post->ID, '_specifications_display_attributes', 'yes' );

}

By the way, if you use the built-in import in WooCommerce, then everything is fine with the names in the AJAX search and the price filter, but it has limited functionality.
The question is how to massively resave all products? Or how to set it up so that when you import everything at once was Feng Shui.
Ps I understand that I need to dig towards update_post (), but I'm not a programmer, I don't know how to do it

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Morozov, 2019-04-22
@MorozBY

The issue was resolved by purchasing the Pro version of the Product Import Export Plugin For WooCommerce plugin and sending a support letter.
For those who have a free version of this plugin, there are two partial solutions to the issue
1) only for updating prices in the new version of WooCommerce in the "Status" there is a field to regenerate pages for search, the action must be done after each import / update by import. Ajax search didn't work.
2) in the admin panel, select the goods with birds - change - apply - set the status, for example, published - update. Both the price and the name for the AJAX search are updated, but there are many actions (depending on the number of goods and the speed of your hosting, I couldn’t manage more than 100 at a time)

D
deadnice, 2019-04-22
@deadnice

Try pasting the following into the code above:
wp_update_post(array(['ID'] => $post->ID));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question