Advertisement:

Author Topic: Address field?  (Read 427 times)

letsforum

  • Newbie
  • *
  • Posts: 39
Address field?
« on: February 01, 2017, 04:53:48 pm »
What is the point of asking users for their address when it doesn't show on the ad?

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: Address field?
« Reply #1 on: February 01, 2017, 07:19:06 pm »
Hi, to normal users I think is not recommended you do it. I speech to my self. Address to company is ok, but to personal address, user need have your rights to preserve your personal data. So is better you use user_type and filter the content on that pages with complete address.

Any way, you can check user-public-profile.php and repass the code to item.php

For other hand, complete address is good to invoice when exists premium ads paid, and user/company need the invoice with VAT number of course.

Regards

Liath

  • issues
  • Hero Member
  • *
  • Posts: 1346
  • </html> the end is always near
Re: Address field?
« Reply #2 on: February 01, 2017, 07:33:31 pm »
i'm using the address field to calculate the distance between user and listing location, but the address isnt a must for users.

letsforum

  • Newbie
  • *
  • Posts: 39
Re: Address field?
« Reply #3 on: February 02, 2017, 02:44:44 pm »
Thanks guys is there a way to disable it? OR what should I use to show it on ad listing?

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: Address field?
« Reply #4 on: February 02, 2017, 08:22:12 pm »
Hi, osclass script not have that preference.
The only a way is create a plugin to do it, or edit one with sql structure, but you need add a new sql column, and more code to do it, condition, etc (is not so easy if you not have some experience).

Why you need the address of user on listings, when user can add address of listing?

Visitors or other register users can see address of user registered on own public profile if you want. But, is not an relevant information of standard users, only of companies can make sense be public. I suggest you use user_type on register of user, he will choose if is a standard user or a company. Then, you can use that value to filter what you need on that pages.

If your theme not have that, on user-register.php file add the field:
Code: [Select]
<?php UserForm::is_company_select(osc_user()); ?>And use the same field on user-profile.php file.

On item.php file and user-public-profile.php use the condition to filter the content of address if user is a company, maybe condition will works (not tested), you need try by your self, or wait for someone tell you to a proper condition, if that not works:
Code: [Select]
<?php 
$user 
User::newInstance()->findByPrimaryKeyosc_item_user_id() );
if (
$user['b_company'] == 1) {?>

<!-- the address content here -->
<?php ?>
Regards