Forums › Forums › Search & Filter Pro › Post meta values aren't added automaticaly after import
Tagged: acf, post meta auto value, wp all import
- This topic has 13 replies, 2 voices, and was last updated 8 years, 7 months ago by Anonymous.
-
Anonymous(Private) April 9, 2016 at 12:51 pm #42144
Hi guys,
I’m using your plugin and WP All Import in combination. Your plugin is used for lots of filters and WP All Import for importing shop data. After new import and adding new products, S&F filter didn’t refresh and add new custom field values. I tried to rebuild cache, but new values in filter didn’t appear. But, if I go and manualy publish products with new values, filter value also appear. NOw, you probably can guess that I don’t want to publish all imported posts to get new values 🙂 Can you help.
I forgot to mention, if I go to filter edit page and check post meta values manualy, I have newly imported values there, but I don’t want to have manual values because that means that I need to do this every time I import new data.Thanks.
Trevor(Private) April 11, 2016 at 8:49 am #42232I understand the issue. The Search & Filter Pro cache is not seeing these post as having been changed and thus does not make changes to the cache for them. as soon as you edit the post and hit update, without making any changes, the posts are flagged as having been changed and thus the cache knows to update itself for each post.
I have not done this for some time, but last time I had to do something like this I used a plugin:
https://wordpress.org/plugins/custom-bulkquick-edit/
I selected all the posts, made no changes, and hit the update button. Maybe that would work for you?
Anonymous(Private) April 11, 2016 at 9:29 am #42236I tried, but no luck. I tried this earlier (bulk edit then Update) without plugin, still didn’t get any results. Maube this can help: if I select to manually populate post meta (instead of automaticaly), I get all values, but I don’t want to populate filter manualy, because there’s a lots of data in filters updated regulary.
Trevor(Private) April 11, 2016 at 9:51 am #42244You will need to trigger our cache as each post inserts, using an action from WP All Import. This code would go into your child theme functions.php (if you haven’t made a child theme, you need to follow the guidance for the theme you have, or the generic guidance from the WordPress Codex and/or the many Internet guides on it):
add_action('pmxi_saved_post', 'post_saved', 10, 1); function post_saved($id) { do_action("search_filter_update_post_cache", $id); }
Sadly, any that are already imported cannot be caught by this.
Anonymous(Private) April 17, 2016 at 10:07 pm #43019Hi Trevor,
unfortunately, it doesn’t help even when I emptied complete shop and make fresh import. Also, on live website, I tried to go through each and every product and update manualy (clicking on Update), some of the meta values shows then dissapear right after and I still doesn’t have them in the list. I also tried to create new filter from scratch, but same things occured – no luck. it still counts 0 for thoose meta values even through products listed with that meta value in wp query I used to test.
Any thoughts? Thanks. -
AuthorPosts