*

nijamutheen

  • ****
  • 110 posts
How to hide available quantity particular​ categories
« on: March 01, 2018, 09:02:29 AM »
How to hide available quantity particular​ categories example for dating, matrimonial, classess

*

MB Themes

Re: How to hide available quantity particular​ categories
« Reply #1 on: March 01, 2018, 09:19:44 AM »
@nijamutheen
You can only do it on code level in file:
/oc-content/plugins/osclass_pay/functions.php

Find code:
Code: [Select]
function osp_product_to_cart_link($item_id = -1, $quantity = 1, $is_hook = 0) {
  $sellers = explode(',', osp_param('seller_users'));
  $html = '';

  if($item_id == -1) {
    $item_id = osc_item_id();
  }

Bellow this code you can define categories that have quantity disabled, so add there:
Code: [Select]
    $item = Item::newInstance()->findByPrimaryKey($item_id);

    if(in_array($item['fk_i_category_id'], array(1,2,3,4,5,6,7,8))) {
      return false;
    }

Where 1 - 8 are ids of categories where nothing is shown.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

nijamutheen

  • ****
  • 110 posts
Re: How to hide available quantity particular​ categories
« Reply #2 on: March 04, 2018, 09:34:52 AM »
this is not working it showing while posting ads

*

MB Themes

Re: How to hide available quantity particular​ categories
« Reply #3 on: March 05, 2018, 08:56:17 AM »
In same file find code:
Code: [Select]
// ITEM SELL FORM
function osp_item_sell_form($catId = false, $item_id = false) {
  $html = '';
  $current_url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
  $sellers = explode(',', osp_param('seller_users'));
  $quantity = 1;
  $sell = 0;

  if($item_id) {
    $item_data = ModelOSP::newInstance()->getItemData($item_id);
    $quantity = @$item_data['i_quantity'];
    $sell = @$item_data['i_sell'];
  }

Bellow it add:
Code: [Select]
    if(in_array($catId, array(1,2,3,4,5,6,7,8))) {
      return false;
    }
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots