Support » Plugin: WPAdverts - Classifieds Plugin » Imported classifieds not showing custom fields

  • Resolved cdoher01

    (@cdoher01)


    Hi I am importing classifieds, the data is coming in but the custom fields are not rendering when I view the page.

    If I go into the classified in wp-admin screen and simple press update, then the fields show on the site for that listing. But given the number of listings I cannot do that manually for each.

    How can I get these custom fields to show?

    I did read this doc but it didn’t get me to a good solution: https://wpadverts.com/documentation/custom-fields/

    Thanks,
    Connor

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    hmm i would need some more details on what you are doing, if i understand correctly after the import the custom fields values show in wp-admin / Classifieds panel while editing the Ad but not when viewing the Ad in the frontend?

    If you could paste a screenshot from wp-admin / Classifieds edition where i could see how does the edit page look like it would be useful.

    By default, WPAdverts can recognize only the meta fields with the following names: adverts_person, adverts_email, adverts_phone, adverts_price, adverts_location.

    If you have fields with different names, then WPAdverts can recognize them if the field is registered using the Custom Fields extension or the API.

    Here is a screenshot of how the info is showing up in Edit Classified screen: https://www.boatvalue.com/wp-content/uploads/2019/11/Screen-Shot-2019-11-25-at-5.47.33-PM.png

    But when viewing it on the frontend only the default meta fields are showing:
    https://www.boatvalue.com/advert/2016-tartan-sailboats-101/?preview_id=3006&preview_nonce=89b61196e4&preview=true

    However if I were to click the update button on the Edit Classified screen for this advert it would then show on the frontend as expected.

    It appears I need a script to run the code that would be trigger by pressing the update button. Is something like that possible?

    I see: add_action( “save_post_advert”, “wpadverts_custom_fields_save_form_scheme_admin”, 10, 2 );
    but I am not sure how to add that so it will happen automatically for these listings.

    Thanks

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    i am also suspecting this is a problem with missing form scheme, and tested that indeed this might be the case, but to make sure that this is the problem, after importing an advert please run the following query from phpMyAdmin

    
    INSERT INTO <code>wp_postmeta</code> (<code>meta_id</code>, <code>post_id</code>, <code>meta_key</code>, <code>meta_value</code>) VALUES (NULL, '1000', '_wpacf_form_scheme_id', 'test');
    

    Just replace the ‘1000’ with an actual ID of an imported Advert and the ‘test’ with the actual form scheme name.

    If this was causing a problem then in your import file you will need to additionally include the ‘_wpacf_form_scheme_id’ with a value equal to a selected form scheme name.

    Hey Greg,

    Looks like including the _wpacf_form_scheme_id is enabling it to pickup the other custom field values.

    Thanks!

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    ok great, i understand it is working correctly now, if you will have any other problems with the import please let me know.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.