Osclass Support Forums

Osclass plugin support => Virtual Products Plugin => Topic started by: Dawid on January 30, 2019, 05:47:32 PM

Title: Question
Post by: Dawid on January 30, 2019, 05:47:32 PM
Hi , its posible to show version product in item.php ? If users posting new items can add file's. must write version product .

What function must use ?

Title: Re: Question
Post by: MB Themes on January 30, 2019, 06:31:36 PM
Will check that
Title: Re: Question
Post by: Dawid on January 30, 2019, 06:39:12 PM
Thank You for any help .
Title: Re: Question
Post by: Dawid on February 02, 2019, 03:28:56 PM
MB Themes check that ???
Title: Re: Question
Post by: MB Themes on February 04, 2019, 08:36:44 AM
@Dawid
In file:
/oc-content/plugins/virtual/functions.php

Create new function:
Code: [Select]
// GET VERSION OF LAST FILE BY ITEM ID
function vrt_item_file_version($item_id) {
  if($item_id > 0) {
    $file = vrt_item_file($item_id);
   
    if(isset($file['i_version']) && $file['i_version'] <> '') {
      return $file['i_version'];
    }
  }

  return false;
}

You can then use it anywhere as:
Code: [Select]
<?php echo vrt_item_file_version(osc_item_id()); ?>
Title: Re: Question
Post by: Dawid on February 04, 2019, 03:28:37 PM
Thank You so mutch . :) You are the best ;)