Advertisement
Guest User

Untitled

a guest
Nov 30th, 2017
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     private static function productAvailible($product)
  2.     {
  3.         $product_available = false;
  4.         if (isset($product['skus'])) {
  5.             if (count($product['skus']) > 1) {
  6.                 return $product_available;
  7.             } else {
  8.                 $sku = $product['skus'][$product['sku_id']];
  9.                 $product_available = $product['status'] && $sku['available'] && ($sku['count'] === null || $sku['count'] > 0);
  10.             }
  11.         } else {
  12.             $product_available = $product['count'] === null || $product['count'] > 0;
  13.         }
  14.         return $product_available;
  15.     }
  16.  
  17.     public static function getListFormHtml($product)
  18.     {
  19.         if(!self::productAvailible($product))
  20.         {
  21.             $settings = include self::path('config.php');
  22.             $settings['expiration'] = explode(",",$settings['expiration']);
  23.             $view = wa()->getView();
  24.             $view->assign("first_load",self::$first_load);
  25.             if(self::$first_load) {
  26.                 self::$first_load = false;
  27.             }
  28.             $view->assign('settings', $settings);
  29.             $view->assign('product', $product);
  30.             $view->assign('link_type', "list");
  31.             $view->assign('action_url', wa()->getRouteUrl('shop/frontend/arrivedAdd'));
  32.             return $view->fetch(wa()->getAppPath('plugins/arrived', 'shop').'/templates/templateProduct.html');
  33.         }
  34.     }
Advertisement
RAW Paste Data Copied
Advertisement