<?php $item_extra = veronika_item_extra( osc_item_id() ); ?><?php if($item_extra['i_sold'] <> 1) { ?> .. here is original block ...<?php } ?>
<?php $item_extra = veronika_item_extra( osc_item_id() ); ?>
<?php if($item_extra['i_sold'] <> 1) { ?>
<?php } ?>
@bobyrouTry this:https://pastebin.com/ksrh7s4L
if($item_extra['i_sold'] <> 1) { $mobile_found = false; $mobile = '';}
if($item_extra['i_sold'] == 1) { $mobile_found = false; $mobile = '';}
<?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; } ?>
<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) >= 4 && $mobile <> __('No phone number', 'veronika')) { echo substr($mobile, 0, strlen($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>
<?php if(!$mobile_found) { ?>
<?php echo osc_item_id(); ?>
<?php echo osc_item_user_id(); ?>
<?php if(strlen($mobile) >= 4 && $mobile <> __('No phone number', 'veronika')) { echo substr($mobile, 0, strlen($mobile) - 4) . 'xxxx'; } else { echo $mobile; } ?>
<?php if($mobile_found) { ?>
<?php _e('Show', 'veronika'); ?>