*

MB Themes

Show mobile phone for logged in users only
« on: March 05, 2018, 09:30:37 AM »
Go to file:
oc-content/themes/veronika/item.php

Find code:
Code: [Select]
<?php if($mobile <> __('No phone number''veronika')) { ?> 

Replace it with:
Code: [Select]
<?php if(!osc_is_web_user_logged_in() && $mobile <> __('No phone number''veronika')) { ?> 
  $('.phone-show, .phone-block').attr('title', '<?php echo osc_esc_js(__('You must be logged in to show phone number''veronika')); ?>');

  $('.phone-show, .phone-block').click(function(e){
    e.preventDefault();
    var mobile = "<?php echo osc_esc_html(__('You must be logged in to show phone number''veronika')); ?>";

    if($('.phone-block').attr('href') == '#') {
      $('.phone-block, .phone-show').addClass('shown');
      $('.phone-block span').text(mobile).css('font-weight', 'bold');
      $('.phone-show').remove()

      return false;
    }
<?php } else if($mobile <> __('No phone number''veronika')) { ?> 
« Last Edit: March 07, 2018, 08:13:35 PM by MB Themes »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: Show mobile phone for logged in users only
« Reply #1 on: March 06, 2018, 08:04:15 AM »
@Robot
//updated original code
« Last Edit: March 07, 2018, 08:13:46 PM by MB Themes »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Fil

  • ***
  • 42 posts
Re: Show mobile phone for logged in users only
« Reply #2 on: March 08, 2018, 03:26:33 AM »
this code working, im tested