OS Property support center

CSV Import Floors

  • Jim
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 4 months ago #55289 by Jim
CSV Import Floors was created by Jim
Hi,
I have been testing the CSV import feature and it works really well.

However, the 'Floors' field doesn't import. I have tested by exporting the csv then re-importing the same with these results.

Floors on CSV export 3
Floors on CSV import 0

Is there a fix for this?

Also can other fields be added? (e.g. Parking?)

Thanks Jim

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #55329 by Mr. Dam
Replied by Mr. Dam on topic CSV Import Floors
Hi Jim,
To fix the issue, please follow these steps
1. Open file
administrator > components > com_osproperty > classes > csvimport.php
2. find
$db->setQuery("Select column_number from #__osrs_form_fields where form_id = '$row->id' and `field` like 'rooms'");
$col_rooms = $db->loadResult();
$col_rooms--;
$rooms = $cell[$col_rooms];
and add this bellow
$db->setQuery("Select column_number from #__osrs_form_fields where form_id = '$row->id' and `field` like 'number_of_floors'");
$col_number_of_floors = $db->loadResult();
$col_number_of_floors--;
$col_number_of_floors = $cell[$col_number_of_floors];

find
$property->rooms = $rooms;
and add this bellow that line
$property->col_number_of_floors = $col_number_of_floors;

Good luck
Dam

Please Log in or Create an account to join the conversation.

  • Jim
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 4 months ago #55431 by Jim
Replied by Jim on topic CSV Import Floors
Thanks Dam,

But i don't have a csvimport.php file, ? only a csvexport.php file !

Jim

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #55491 by Mr. Dam
Replied by Mr. Dam on topic CSV Import Floors
Sorry Jim, it should be csvform.php
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Jim
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 4 months ago #55553 by Jim
Replied by Jim on topic CSV Import Floors
Hi Dam,
No problem thanks.
I have added the lines but then receive the following error on import (see attached file)
Jim
Attachments:

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #55607 by Mr. Dam
Replied by Mr. Dam on topic CSV Import Floors
Hi Jim,
Sorry my wrong,
$property->col_number_of_floors = $col_number_of_floors;
should be
$property->number_of_floors = $col_number_of_floors;
Thanks
Dam
The following user(s) said Thank You: Jim

Please Log in or Create an account to join the conversation.

  • Jim
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 4 months ago #55615 by Jim
Replied by Jim on topic CSV Import Floors
Hi Dam,
No problem, have adjusted the code and works well.
Thanks again
Jim

Please Log in or Create an account to join the conversation.

More
10 years 4 months ago #55616 by Mr. Dam
Replied by Mr. Dam on topic CSV Import Floors
Ok Jim
Dam
The following user(s) said Thank You: Jim

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamNguyen Phu Quan