Example #1
0
 /**
  * printBarCode
  * it prints the barcode taking in account whether the barcode exists or not
  * @param  [object] $product contains the product info row
  * @return [html] a html label will be returned with the barcode information
  */
 public static function printBarCode($product = null, $type = 'EAN8')
 {
     if ($product == null || !$product) {
         return trans('globals.barcode_error_msg');
     } else {
         return \DNS1D::getBarcodeSVG(trim($product->bar_code) != '' ? $product->bar_code : $product->id, $type);
     }
 }