*

officela

  • ***
  • 68 posts
How to export Users & listings to Wordpress
« on: February 04, 2025, 09:50:29 AM »
Hi everyone,

I have tried more than 4 years with Osclass to give to my clients a good looking modern listings website, without success for me, i've tried 2-3 themes and numerous plugins.
if i had programming skills i think that this would be possible for Osclass to do what i need, but since i have those skills - i found what i was looking for in Wordpress.

Can you propose / guide / hlelp me for the steps i need to export users and listings from Osclass to Wordpress ?
I am  not a programmer but i have experience in cpanel  and i can follow phpmyadmin instructions.
I am using Google social login and i have users also registered with them email. I can manually assing the listings to the users if this is big issue to come arround.
But i think no matter i have to let my users be able to login and manage them listings to the wordpress to not loose them
I have around 1000 listings.

Has anyone done something like this ? Can you assist ?

EDIT #1: I found a plugin on google Pro XML Ads Import/Export from Algoritex than now is permanently stopped working website etc...that does export correctly but not all fields, like customs fields.. so is there any plugin to be working with latest Osclass and be able to export all fields and users ? i think this is what i need ?
EDIT #2 i found another plugin (https://www.valueweb.gr/forums/osclass-free-plugins/csv-export-free-plugin-for-osclass/)  but this also not includes the custom fields.... - not having the custom fields would be a real pain but i am ready for this if not have any solution )

I've tried so far and i am able to import the listings to wordpress ( with many missing fields..... but i am ready to edit one by one 1000 listings and correct the date)  how i can import the users ? ( by editing each listing i will be able to assign the listings to the correct user )

If you have a full guide ( anyone ??? ) let me know or assist please on users transfer .....
« Last Edit: February 04, 2025, 05:45:54 PM by officela »

Re: How to export Users & listings to Wordpress
« Reply #1 on: February 04, 2025, 11:04:42 PM »
I don't like WordPress for one reason - translation of classified plugin is done through translate plugin. In Osclass I've done Ukrainian translation by my self in Poedit, it's better this way.

*

MB Themes

Re: How to export Users & listings to Wordpress
« Reply #2 on: February 05, 2025, 06:44:34 AM »
I think you can get titles & descriotions oretty easy, but thats mostly it. Data like categories, locations, attributes will be harder to export and even harder to import.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

officela

  • ***
  • 68 posts
Re: How to export Users & listings to Wordpress
« Reply #3 on: February 05, 2025, 10:24:46 AM »
Title, description, category i've taken already and yes it's easy.

How to take the custom fields ?

( Oleksandr i partially agree with this , but this is one reason, there are much more that are best compare to Osclass )

I tried more than 4 years without success, i was waiting that another major update would possible come after 8.2.1 but nothing for i think a year now....

It's time for me to move on..

If anyone can help me how to make .xml exports ( or csv)  please inform me how to do it.... including all fields... that's my issue now.

I have photos and all basic fields, but in my case i have a real estate listings website and i need extra fields like sq.m. of property, sq.m. of plot...All my extra fields created with Attributes Osclass Plugin..... and if i can't get all those my export is not helping....

In wordpress site i found plugin that i can map each field to the fields that it corresponds .

Any plugin that can do the same ? select what fields i need to make the xml for osclass ????
« Last Edit: February 05, 2025, 10:42:08 AM by officela »

*

officela

  • ***
  • 68 posts
Re: How to export Users & listings to Wordpress
« Reply #4 on: February 05, 2025, 11:20:02 AM »
That is the code of the plugin that works

Code: [Select]
/**
 * Get all the ads from de bbdd
 *
 * @return array
 */
function retrieveAds()
{
    $dao = new DAO();
    $select = $dao->getTablePrefix() . 't_category_description.s_name, ' . $dao->getTablePrefix() . 't_item_description.s_title, ' .
        $dao->getTablePrefix() . 't_item_description.s_description, ' . $dao->getTablePrefix() . 't_item_location.s_country, ' .
        $dao->getTablePrefix() . 't_item_location.s_address, ' . $dao->getTablePrefix() . 't_item_location.s_zip, ' .
        $dao->getTablePrefix() . 't_item_location.s_region, ' . $dao->getTablePrefix() . 't_item_location.s_city, ' .
        $dao->getTablePrefix() . 't_item_location.s_city_area, ' . $dao->getTablePrefix() . 't_item.i_price, ' .
        $dao->getTablePrefix() . 't_item.fk_c_currency_code, ' . $dao->getTablePrefix() . 't_item.s_contact_name, ' .
        $dao->getTablePrefix() . 't_item.pk_i_id, ' . $dao->getTablePrefix() . 't_item.s_contact_email';

    $from = $dao->getTablePrefix() . 't_category_description, ' . $dao->getTablePrefix() . 't_item_description, ' .
        $dao->getTablePrefix() . 't_item_location, ' . $dao->getTablePrefix() . 't_item';

    $where = $dao->getTablePrefix() . 't_category_description.fk_i_category_id =' . $dao->getTablePrefix() . 't_item.fk_i_category_id AND ' .
        $dao->getTablePrefix() . 't_item.pk_i_id  =' . $dao->getTablePrefix() . 't_item_description.fk_i_item_id AND ' .
        $dao->getTablePrefix() . 't_item.pk_i_id  =' . $dao->getTablePrefix() . 't_item_location.fk_i_item_id';

    $query = "SELECT " . $select . " FROM " . $from . " WHERE " . $where;

    $results = $dao->dao->query($query);
    return $results->result();
}



function getCustomFields($item_id) {
    $dao = new DAO();
    $select = $dao->getTablePrefix() . 't_meta_fields.s_name, ' . $dao->getTablePrefix() . 't_item_meta.s_value';

    $from =  $dao->getTablePrefix() . 't_meta_fields, ' . $dao->getTablePrefix() . 't_item_meta';

    $where = $dao->getTablePrefix() . 't_item_meta.fk_i_item_id  =' . $item_id . ' AND ' .
        $dao->getTablePrefix() . 't_meta_fields.pk_i_id  =' . $dao->getTablePrefix() . 't_item_meta.fk_i_field_id';

    $query = "SELECT " . $select . " FROM " . $from . " WHERE " . $where;

    $results = $dao->dao->query($query);
    return $results->result();
}
/**
 * Export the ads tp the xml output file
 *
 * @param array $data
 * @param array $tags
 */
function doExport($data, $tags)
{

    if (count($data) > 0) {
        $xml_output = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><listings></listings>');

        foreach ($data as $item) {

            $xml_item = $xml_output->addChild("listing");

            $xml_item->addChild($tags['title'] == "" ? "title" : $tags['title'], $item['s_title'] == null ? "" : $item['s_title']);
****** $xml_item->addChild($tags['basic_land'] == "" ? "basic_land" : $tags['basic_land'], $item['basic_land'] == null ? "" : $item['basic_land']);
            $xml_item->addChild($tags['description'] == "" ? "description" : $tags['description'], $item['s_description'] == null ? "" : $item['s_description']);
            $xml_item->addChild($tags['category'] == "" ? "category" : $tags['category'], $item['s_name'] == null ? "" : $item['s_name']);
            $xml_item->addChild($tags['price'] == "" ? "price" : $tags['price'], $item['i_price'] == null ? "" : $item['i_price']/1000000);
            $xml_item->addChild($tags['currency'] == "" ? "currency" : $tags['currency'], $item['fk_c_currency_code'] == null ? "" : $item['fk_c_currency_code']);
            $xml_item->addChild($tags['country'] == "" ? "country" : $tags['country'], $item['s_country'] == null ? "" : $item['s_country']);
            $xml_item->addChild($tags['region'] == "" ? "region" : $tags['region'], $item['s_region'] == null ? "" : $item['s_region']);
            $xml_item->addChild($tags['city'] == "" ? "city" : $tags['city'], $item['s_city'] == null ? "" : $item['s_city']);
            $xml_item->addChild($tags['area'] == "" ? "area" : $tags['area'], $item['s_city_area'] == null ? null : $item['s_city_area']);
            $xml_item->addChild($tags['zip'] == "" ? "zip" : $tags['zip'], $item['zip'] == null ? "" : $item['zip']);
            $xml_item->addChild($tags['address'] == "" ? "address" : $tags['address'], $item['s_address'] == null ? "" : $item['s_address']);
            $xml_item->addChild($tags['name'] == "" ? "name" : $tags['name'], $item['s_contact_name'] == null ? "" : $item['s_contact_name']);
            $xml_item->addChild($tags['email'] == "" ? "email" : $tags['email'], $item['s_contact_email'] == null ? "" : $item['s_contact_email']);

In order to get more fields i tried:
On the export part i added this : ********
Code: [Select]
$xml_item->addChild($tags['basic_land'] == "" ? "basic_land" : $tags['basic_land'], $item['basic_land'] == null ? "" : $item['basic_land']); ------------------

Since i know from the Attributes plugin each Identifier and in my case the "basic_land" is the identifier.

This line alone of course will not write anything on the xml file since it needs to read this i think at the 1st part of the code like it does with 
Code: [Select]
$dao->getTablePrefix() . 't_item_description.s_description, ' . $dao->getTablePrefix() . 't_item_location.s_country, ' . 
Could you please help me with a custom field? and i can write all the others......
What i need replace to this in order to read the basic_land custom attribute : 
Code: [Select]
$dao->getTablePrefix() . 't_item_description.s_description, ' . $dao->getTablePrefix() . 't_item_location.s_country, ' . 
« Last Edit: February 05, 2025, 03:10:38 PM by officela »

Re: How to export Users & listings to Wordpress
« Reply #5 on: February 05, 2025, 07:49:06 PM »
I changed a domain name to expensive one and my website got more popular. Even it's a new website. CMS WordPress is hevier than Osclass and works slower.
« Last Edit: February 05, 2025, 10:16:10 PM by Oleksandr Kravchuk »

*

officela

  • ***
  • 68 posts
Re: How to export Users & listings to Wordpress
« Reply #6 on: February 06, 2025, 09:21:30 AM »
I changed a domain name to expensive one and my website got more popular. Even it's a new website. CMS WordPress is hevier than Osclass and works slower.

I agree with you. It's something that i plan to solve by upgrading the server later on when it gets more popular.
Host the photos to amazon etc.....
I have tested the theme that has all included with more than 1000 ads and i have not seen any difference.

"Duzhe dyakuyu" for this but it's a decision already made.

If anyone knows how to assist me with the code above please do...