*

bobyrou

  • ****
  • 107 posts
Marked as Sold - Hide phone number
« on: August 01, 2017, 11:23:14 PM »
If a post ad is marked as Sold... is there a way that Phone number to be hidden? so no one can contact the seller once the item have been sold. Thanks for any help!!
« Last Edit: August 03, 2017, 11:22:22 AM by bobyrou »

*

bobyrou

  • ****
  • 107 posts
Re: Hide phone number
« Reply #1 on: August 03, 2017, 11:19:09 AM »
Hi, anyone please help  :-* :-*

Marked as best answer by frosticek on August 05, 2017, 06:17:57 PM
*

MB Themes

Re: Marked as Sold - Hide phone number
« Reply #2 on: August 04, 2017, 12:05:03 PM »
@bobyrou
Wrap the phone number into block:
Code: [Select]
<?php $item_extra veronika_item_extraosc_item_id() ); ?>
<?php if($item_extra['i_sold'] <> 1) { ?>

  .. here is original block ...

<?php ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

bobyrou

  • ****
  • 107 posts
Re: Marked as Sold - Hide phone number
« Reply #3 on: August 04, 2017, 01:38:14 PM »
Thanks for your kindly help frosticek  :-*.. I am not sure what code needs wrapped. Can you please point me? I have pasted the whole item.php source code pasted here: https://pastebin.com/pSQ73ZqW


Btw I really like the veronika theme.

*

MB Themes

Re: Marked as Sold - Hide phone number
« Reply #4 on: August 05, 2017, 09:23:39 AM »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Romeo

  • ****
  • 115 posts
Re: Marked as Sold - Hide phone number
« Reply #5 on: August 05, 2017, 10:29:30 AM »
Hello, look at us babyrou , an example of a live ad that hides the phone when it's marked as sold.

*

bobyrou

  • ****
  • 107 posts
Re: Marked as Sold - Hide phone number
« Reply #6 on: August 09, 2017, 12:01:58 AM »
@bobyrou
Try this:
https://pastebin.com/ksrh7s4L

Hi frosticek, the solution works but partially.... It hides phone number okay if its marked as sold but also hides phone number on all other active ads. Is it possible just to hide those ads marked as sold?? thanks for any help given

*

MB Themes

Re: Marked as Sold - Hide phone number
« Reply #7 on: August 09, 2017, 08:35:49 AM »
@bobyrou
There is probably bug at start of code.
Change this:
Code: [Select]
if($item_extra['i_sold'] <> 1) {
  $mobile_found = false;
  $mobile = '';
}

into this:
Code: [Select]
if($item_extra['i_sold'] == 1) {
  $mobile_found = false;
  $mobile = '';
}
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

bobyrou

  • ****
  • 107 posts
Re: Marked as Sold - Hide phone number
« Reply #8 on: August 09, 2017, 01:31:31 PM »
Thank you so much!!! This works now perfect  8) 8) 8) 8)

*

calm

  • ***
  • 22 posts
Re: Marked as Sold - Hide phone number
« Reply #9 on: September 02, 2017, 12:44:55 AM »
@frosticek
@bobyrou

Could You tell in which blok I should add that code?
1)
Code: [Select]
  <?php 
    
if(osc_item_user_id() <> 0) {
      
$item_user User::newInstance()->findByPrimaryKey(osc_item_user_id());
    }

    
$mobile_found true;
    
$mobile $item_extra['s_phone'];

    if(
$mobile == '' && osc_item_user_id() <> 0) { $mobile $item_user['s_phone_mobile']; }      
    if(
$mobile == '' && osc_item_user_id() <> 0) { $mobile $item_user['s_phone_land']; }      
    if(
$mobile == '') { $mobile __('No phone number''veronika'); }   
   
    if(
trim($mobile) == '' || strlen(trim($mobile)) < 4) { 
      
$mobile __('No phone number''veronika');
      
$mobile_found false;
    }      
  
?>
or
2)
Code: [Select]
   <div class="phone<?php if(!$mobile_found) { ?> no-number<?php ?>">
                      <a href="#" class="phone-block" data-item-id="<?php echo osc_item_id(); ?>" data-item-user-id="<?php echo osc_item_user_id(); ?>">
                        <i class="fa fa-phone"></i>
                        <span>
                          <?php 
                            
if(strlen($mobile) >= && $mobile <> __('No phone number''veronika')) {
                              echo 
substr($mobile0strlen($mobile) - 4) . 'xxxx'
                            } else {
                              echo 
$mobile;
                            }
                          
?>

                        </span>
                      </a>

                      <?php if($mobile_found) { ?>
                        <a href="#" class="phone-show" data-item-id="<?php echo osc_item_id(); ?>" data-item-user-id="<?php echo osc_item_user_id(); ?>"><?php _e('Show''veronika'); ?></a>
                      <?php ?>
                    </div>

(I tested both and it works on both, but which is correct).