Hello support team, thank you for your time.
I’m trying to import the listings images from a CSV file. I import them already, they appear in the Media library already attached to each listing, but in the listing only shows the first one, have to say that each listing comes with 5 to 8 images. By the way, I’m using th WP Import Export Lite plugin, someone mentioned it in another thread. I’m also attaching a couple of screenshots so you can visualize it better. Hope you can help me with this.
Great plugin, is my first time using it. Regards.
Hi,
The following conditions must be met when importing images:
- hp_parent_model with value “listing”
- hp_parent_field with value “images” in post_parent attachment listing ID
Also, please try disabling the HivePress cache:
if ( ! defined( 'HP_CACHE' ) ) {
define( 'HP_CACHE', false );
}
I hope this is helpful to you.
Hello andrii.
Thank you for your help, but I’m not sure where exactly put the conditios you mention.
I’m attaching the plugin screenshots so maybe this could help to show how to follow your instructions. In the custom fields we can put Normal data and Serialized data, maybe this has something to do with your instructions.
I’m struggling with this issue several days now, hope you can help.
Thank you in advanced, best regards.
Hi,
Unfortunately, we are not very familiar with this third-party plugin, so we cannot provide more details. But, you can write to their support to clarify if they have the option to set two meta fields hp_parent_model=listing
and hp_parent_field=images
for each uploaded image (as in your first screenshot example).
Hello @andrii
I was hoping you can help me, I’m struggling for more than two weeks trying to solution this issue, I already wrote to the plugin support, but not answering yet. Must be something simple, as you can see, the images in the Media Library seems already attached to each correspondant listing, but when you look to the listing page, back and frontend, only the first image is showed, all the images are uploaded and attached in the Media Library but not showing, just the featured image. Hope @ihor or someone in the community can help me with this.
Thank you anyway andrii for trying to help. Regards.
Hello.
I’m noticing something very weird related to listing images. When I select an image and upload it to a lisiting it shows in the Images box, but when I update the listing, the image dissapears from the Images box, it still shows on the listing frontend, but dissapears from the backend. I’m attaching screenshots. Any thoughts?
Thanks in advanced.
Hola compañero !
I can’t help you much with this plugin, but maybe you should try WP All Import instead. I chose this one.
I don’t mean it’s simple, it has it’s own ways too…
Sometimes I need to rerun an import, to have my data properly imported. Go figure !
But I am able to import users / vendors / listings and even reviews…
If you stick with WP Import Export plugin, maybe you should apply for help at their own support page.
My two cents.
This issue occurs because the imported images don’t have two meta fields required for HivePress to detect them as a part of the image gallery:
hp_parent_model
meta value set to listing
hp_parent_field
meta value set to images
Please try contacting the import plugin support and ask them how to add meta to the imported attachments, this should resolve the issue. If there’s no such option (based on the screenshots above, they have options to set meta for the imported post/listing, but not the attachments), then the only way would be using another import plugin (you can try using our HivePress Import extension), or another possible option is creating a custom code snippet that sets the required meta, but this requires code tweaks.
Hope this helps
Hello @ihor thank you for your reply.
About the hp_parent_model, I think the plugin detect and has the two meta fields.
Look:
-
First step, you need to upload your CSV file.
-
Second step, you have to choose from a list of items including Posts, Comments, Attributes… etc. and Listings appears on the list, please check image_01 (I’m attaching images of the process for better understanding). I think it shows it because detects the meta field.
-
Third step, you have to drag and drop the name of your CSV columns to the correspondant field, for this case images to images, like other import plugins normally works. As you can see, I have in my CSV one filename per line as it is recommended, check image_02.
-
Four step, I indicates to update the images, because by the way, I can import all the listings attibutes without a problem, I choose now only the images because the attributes were already imported, image_03.
-
Once the import process is completed, the images are in the Media library already attached to its correspondant listing, so looks that everything is fine, image_04.
-
But if you open the listings, the images are not there, check image_05, but the first image marked as futured image, check again image_02, appears in the frontend. You also can see that all the attibutes were imported without a problem before.
-
To make it more wierd, if I upload images directly from my desktop to a listing, they of course are showed in the images box of the listing, like image_06, but if I update the listing, you know, with the normal Update blue button in the top right corner, the images disappear again from the images box, like image_07.
-
And guess what, yes, the images looks normal on the frontend, check image_08.
As I said, have no problem to import all the data, which means title, content, all the attributes, etc. but no luck with the images, have no idea what’s wrong. I think is not an issue of missing meta fields, or maybe yes, I’m struggling with this issue for weeks now and could not solved it. Hope my explanation helps to find a solution, thanks support team for your time.
Hola amigo @cotasson
I tried more than three import plugins, including WP All Import, the issue with this plugin is that the images import section is a Pro featured, I think that importing images to WP is a basic thing, there are other plugins that have it for free, anyway, I could pay for the Pro version, but still not sure is going to work neither, I need to first to try understand the problem before paying for a solution that maybe is not.
Thank you mon ami for trying to help, as always. Best regards.
Hola de nuevo,
Problems I had during the process of importing users / vendors / listings, maybe this will help you out in your quest :
- the profile would be eventually linked to the admin profile instead of the real user_id. This caused me a lot of headaches, until I noticed it. It was due to some mapping problem (I was linking to the listing vendor id instead of the expected user id).
- some tags cannot be imported ‘as is’, example : ‘my taxo’, but you would have to use the matching slug instead to be taken into considation, therefore ‘my_taxo’.
- image import were numbered (1.jpg, 2.jpg), and even though it’s possible to locate them locally (on the server) during the import (/my-cat1/1.jpg , my-cat2/1.jpg), they all would end up under the normal media hierarchy (/year/month/1.jpg), so WP All import would consider that the previous image was already there (duplicate), and would not import the new file, as it was holding the same name).
- sometimes I have to rerun the import twice (force the import), so that it would be taken into account.
Hopefully, this could help.
I found a bit hacky workaround, but it may work. This check for the field name was added to one of the recent updates (it was needed to distinguish images uploaded to the main gallery and to possible attachment attributes), there’s a check for HivePress installation date for older installations compatibility hivepress/includes/models/class-listing.php at master · hivepress/hivepress · GitHub
If you update the installation date manually (to an older date), then it should be ok and any images attached to a listing should appear in the gallery. Please run this code once (e.g. via the Code Snippets plugin):
update_option('hp_installed_time', 1717196400);
I also recommend using this code during the development, then the second issue may be resolved:
define('HP_CACHE', false);
Hello @ihor
Your hack works! But only for the frontend, I can see the images in the front, but in the backend still missing, any thoughts on this?
I’m sorry but I do not understand the problem quiet well. Is a bug? Is an issue just for imported images? Is an update release problem?
If I update the plugin when a new release will be launch, I will have the problem again?
Anyway, thank you very much for your help, this was a tough issue, I was struggling for weeks with it. And thank you @cotasson for always trying to help the community.
Best regards.
Hi,
No worries, we’re always happy to help.
Regarding the issue with hidden images, we recommend that you re-upload the images after adding the code above. Also, don’t forget to remove this code after you have run it at least once (we mean the update_option
code).
As for the issue with the cache, this code should be left. The case you described may be after you have imported, even if the listings themselves were imported, but the images were not. You should try to create a new listing manually and upload the image, and check if the issue repeats in the same way as with the listing import.
Thank you @andrii
Now I’m facing a similar problem with the comments, I already imported them, in the Comments section you can see that all 10 comments exists but I can’t see them nor the front or backend. I have the HivePress Reviews plugin installed and activated, I used hp_review as comment type when imported, but can’t find them anywhere. Has to be also with the update_option issue? By the way I ran it once again after imported the comments in case works like the images, but nothing. The comments are somewhere already imported, but can not find them.
I found this thread but I can’t find My Home or Quick links button as there are suggested, don’t know which admin plugin they are using. Hope you can help me with this.
Best regards.
I think I started that thread you are referring to. This is very hard to find for some reason but I hope I can help.
On your WP dashboard, go to “my Home” on the left Panel and look at the Quick links in right panel. Go to WP Admin and scroll to the bottom of the page and check “at a Glance” or Activity. You should see comments there and it will take you to a page where you can approve it. I have no idea why we can’t get to it through the regular comments menu item.
Good luck!
May I suggest you try debugging by looking at what’s happening behind the scenes, i.e. at the database level ?
select * from [wp_your_prefix]_comments where comment_type='hp_review' order by comment_id desc;
Hi,
If you are familiar with the WordPress database, add a review from HivePress reviews, see how it is displayed in the wp_comments table, try to import it afterward, compare everything, and check the difference in wp_comments again with your imported one. Perhaps some column is incorrectly filled in or the comment is not approved, because if you imported the comment correctly (even custom type), then the comment should appear in WordPress comments.
Hello.
Thank you @luna for your help, I follow your steps but in my case the comments do not show even in the At a Glance window, so I can not resolve the problem in that way, but I found a solution, in case someone else have the same problem. When import the comments should put the number 1 in the field Comments Approve, it looks that 1 means approved, so after it the comments appeared in the Comments page and correct attached to each listing.
Thank you @andrii and @cotasson, your answers put me also in the right direction.
I have one more question, is there a custom field for the review stars that someone gives?
I found hp_review and hp_review_count, but they are for all the listing, but for each review?
Thanks again, regards.