How to hide Payment box from all except the seller
« on: March 03, 2018, 08:09:10 PM »
How do I hide Promote box from all except the seller.
« Last Edit: March 04, 2018, 02:44:12 PM by Engr Ogba Victor »

Re: How to hide Payment box from all except the seller
« Reply #1 on: March 04, 2018, 02:45:49 PM »
Admin sorry I changed it to promote. The thing is seems everyone sees the promote box. I want to hide it from all but the seller just like the demo.

Marked as best answer by engr.victor on March 05, 2018, 12:00:09 PM
*

MB Themes

Re: How to hide Payment box from all except the seller
« Reply #2 on: March 05, 2018, 08:52:03 AM »
@Ogba
In file:
oc-content/plugins/osclass_pay/user/item_post.php

After following code:
Code: [Select]

  if(!isset($is_itempay)) {
    $is_itempay = 0;
  }

Add this:
Code: [Select]
  $hide = false;
  if(osc_is_ad_page()) {
    $item_full = Item::newInstance()->findByPrimaryKey($item_id);

    if(!osc_is_web_user_logged_in() || osc_item_user_id() <> osc_logged_user_id()) {
      $hide = true;
    }
  }

Then replace following code:
Code: [Select]
<div class="osp-promote-form <?php if(osc_get_osclass_location() == 'ajax' && osc_get_osclass_section() == 'runhook') { ?>osp-is-publish<?php ?>">
with:
Code: [Select]
<div <?php if($hide) { ?>style="display:none!important;"<?php ?> class="osp-promote-form <?php if(osc_get_osclass_location() == 'ajax' && osc_get_osclass_section() == 'runhook') { ?>osp-is-publish<?php ?>">
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: How to hide Payment box from all except the seller
« Reply #3 on: March 05, 2018, 11:59:57 AM »
Worked Perfectly. Thanks