当前位置: 首页>>代码示例>>PHP>>正文


PHP ProductDownload::getFilenameFromIdProduct方法代码示例

本文整理汇总了PHP中ProductDownload::getFilenameFromIdProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductDownload::getFilenameFromIdProduct方法的具体用法?PHP ProductDownload::getFilenameFromIdProduct怎么用?PHP ProductDownload::getFilenameFromIdProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProductDownload的用法示例。


在下文中一共展示了ProductDownload::getFilenameFromIdProduct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getProducts

 /**
  * Get order products
  *
  * @return array Products with price, quantity (with taxe and without)
  */
 public function getProducts($products = false, $selected_products = false, $selected_qty = false)
 {
     if (!$products) {
         $products = $this->getProductsDetail();
     }
     $order = new Order($this->id_order);
     $customized_datas = Product::getAllCustomizedDatas($order->id_cart);
     $result_array = array();
     foreach ($products as $row) {
         // Change qty if selected
         if ($selected_qty) {
             $row['product_quantity'] = 0;
             foreach ($selected_products as $key => $id_product) {
                 if ($row['id_order_detail'] == $id_product) {
                     $row['product_quantity'] = (int) $selected_qty[$key];
                 }
             }
             if (!$row['product_quantity']) {
                 continue;
             }
         }
         $this->setProductImageInformations($row);
         $this->setProductCurrentStock($row);
         $this->setProductCustomizedDatas($row, $customized_datas);
         // Add information for virtual product
         if ($row['download_hash'] && !empty($row['download_hash'])) {
             $row['filename'] = ProductDownload::getFilenameFromIdProduct((int) $row['product_id']);
             // Get the display filename
             $row['display_filename'] = ProductDownload::getFilenameFromFilename($row['filename']);
         }
         $row['id_address_delivery'] = $order->id_address_delivery;
         /* Ecotax */
         $round_mode = $order->round_mode;
         $row['ecotax_tax_excl'] = $row['ecotax'];
         // alias for coherence
         $row['ecotax_tax_incl'] = $row['ecotax'] * (100 + $row['ecotax_tax_rate']) / 100;
         $row['ecotax_tax'] = $row['ecotax_tax_incl'] - $row['ecotax_tax_excl'];
         if ($round_mode == Order::ROUND_ITEM) {
             $row['ecotax_tax_incl'] = Tools::ps_round($row['ecotax_tax_incl'], _PS_PRICE_COMPUTE_PRECISION_, $round_mode);
         }
         $row['total_ecotax_tax_excl'] = $row['ecotax_tax_excl'] * $row['product_quantity'];
         $row['total_ecotax_tax_incl'] = $row['ecotax_tax_incl'] * $row['product_quantity'];
         $row['total_ecotax_tax'] = $row['total_ecotax_tax_incl'] - $row['total_ecotax_tax_excl'];
         foreach (array('ecotax_tax_excl', 'ecotax_tax_incl', 'ecotax_tax', 'total_ecotax_tax_excl', 'total_ecotax_tax_incl', 'total_ecotax_tax') as $ecotax_field) {
             $row[$ecotax_field] = Tools::ps_round($row[$ecotax_field], _PS_PRICE_COMPUTE_PRECISION_, $round_mode);
         }
         // Aliases
         $row['unit_price_tax_excl_including_ecotax'] = $row['unit_price_tax_excl'];
         $row['unit_price_tax_incl_including_ecotax'] = $row['unit_price_tax_incl'];
         $row['total_price_tax_excl_including_ecotax'] = $row['total_price_tax_excl'];
         $row['total_price_tax_incl_including_ecotax'] = $row['total_price_tax_incl'];
         /* Stock product */
         $result_array[(int) $row['id_order_detail']] = $row;
     }
     if ($customized_datas) {
         Product::addCustomizationPrice($result_array, $customized_datas);
     }
     return $result_array;
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:64,代码来源:OrderInvoice.php

示例2: getProducts

 /**
  * Get order products
  *
  * @return array Products with price, quantity (with taxe and without)
  */
 public function getProducts($products = false, $selectedProducts = false, $selectedQty = false)
 {
     if (!$products) {
         $products = $this->getProductsDetail();
     }
     $resultArray = array();
     foreach ($products as $row) {
         // Change qty if selected
         if ($selectedQty) {
             $row['product_quantity'] = 0;
             foreach ($selectedProducts as $key => $id_product) {
                 if ($row['id_order_detail'] == $id_product) {
                     $row['product_quantity'] = (int) $selectedQty[$key];
                 }
             }
             if (!$row['product_quantity']) {
                 continue;
             }
         }
         $this->setProductPrices($row);
         /* Add information for virtual product */
         if ($row['download_hash'] && !empty($row['download_hash'])) {
             $row['filename'] = ProductDownload::getFilenameFromIdProduct($row['product_id']);
         }
         /* Stock product */
         $resultArray[(int) $row['id_order_detail']] = $row;
     }
     return $resultArray;
 }
开发者ID:baroni93,项目名称:PrestaShop-1.4,代码行数:34,代码来源:Order.php

示例3: getProducts

 /**
  * Get order products
  *
  * @return array Products with price, quantity (with taxe and without)
  */
 public function getProducts($products = false, $selectedProducts = false, $selectedQty = false)
 {
     if (!$products) {
         $products = $this->getProductsDetail();
     }
     //$customized_datas = Product::getAllCustomizedDatas($this->id_cart);
     $resultArray = array();
     foreach ($products as $row) {
         //var_dump($row);die;
         // Change qty if selected
         if ($selectedQty) {
             $row['product_quantity'] = 0;
             foreach ($selectedProducts as $key => $id_product) {
                 if ($row['id_order_detail'] == $id_product) {
                     $row['product_quantity'] = (int) $selectedQty[$key];
                 }
             }
             if (!$row['product_quantity']) {
                 continue;
             }
         }
         $this->setProductImageInformations($row);
         $this->setProductCurrentStock($row);
         // Backward compatibility 1.4 -> 1.5
         $this->setProductPrices($row);
         //$this->setProductCustomizedDatas($row, $customized_datas);
         // Add information for virtual product
         if ($row['download_hash'] && !empty($row['download_hash'])) {
             $row['filename'] = ProductDownload::getFilenameFromIdProduct((int) $row['product_id']);
             // Get the display filename
             $row['display_filename'] = ProductDownload::getFilenameFromFilename($row['filename']);
         }
         //$row['id_address_delivery'] = $this->id_address_delivery;
         /* Stock product */
         $resultArray[(int) $row['id_order_detail']] = $row;
     }
     /*if ($customized_datas)
       Product::addCustomizationPrice($resultArray, $customized_datas);*/
     return $resultArray;
 }
开发者ID:TheTypoMaster,项目名称:neotienda,代码行数:45,代码来源:NeoExchanges.php

示例4: getProducts

 /**
  * Get order products
  *
  * @return array Products with price, quantity (with taxe and without)
  */
 public function getProducts($products = false, $selectedProducts = false, $selectedQty = false)
 {
     if (!$products) {
         $products = $this->getProductsDetail();
     }
     $order = new Order($this->id_order);
     $customized_datas = Product::getAllCustomizedDatas($order->id_cart);
     $resultArray = array();
     foreach ($products as $row) {
         // Change qty if selected
         if ($selectedQty) {
             $row['product_quantity'] = 0;
             foreach ($selectedProducts as $key => $id_product) {
                 if ($row['id_order_detail'] == $id_product) {
                     $row['product_quantity'] = (int) $selectedQty[$key];
                 }
             }
             if (!$row['product_quantity']) {
                 continue;
             }
         }
         $this->setProductImageInformations($row);
         $this->setProductCurrentStock($row);
         $this->setProductCustomizedDatas($row, $customized_datas);
         // Add information for virtual product
         if ($row['download_hash'] && !empty($row['download_hash'])) {
             $row['filename'] = ProductDownload::getFilenameFromIdProduct((int) $row['product_id']);
             // Get the display filename
             $row['display_filename'] = ProductDownload::getFilenameFromFilename($row['filename']);
         }
         $row['id_address_delivery'] = $order->id_address_delivery;
         /* Translit product name */
         //$row['translit_name'] = $this->translit($row['product_name'])."222";
         if ($row['translit_name'] == "Война и мир") {
             $row['translit_name'] = "это война и мир";
         } else {
             $row['translit_name'] = "это что-то другое";
         }
         /* Stock product */
         $resultArray[(int) $row['id_order_detail']] = $row;
     }
     if ($customized_datas) {
         Product::addCustomizationPrice($resultArray, $customized_datas);
     }
     return $resultArray;
 }
开发者ID:Gelikon,项目名称:gelikon,代码行数:51,代码来源:translit+OrderInvoice.php

示例5: getProducts

 /**
  * Get order products
  *
  * @return array Products with price, quantity (with taxe and without)
  */
 public function getProducts($products = false, $selectedProducts = false, $selectedQty = false)
 {
     if (!$products) {
         $products = $this->getProductsDetail();
     }
     $resultArray = array();
     foreach ($products as $k => $row) {
         // Change qty if selected
         if ($selectedQty) {
             $row['product_quantity'] = 0;
             foreach ($selectedProducts as $key => $id_product) {
                 if ($row['id_order_detail'] == $id_product) {
                     $row['product_quantity'] = intval($selectedQty[$key]);
                 }
             }
             if (!$row['product_quantity']) {
                 continue;
             }
         }
         $row['product_price_wt'] = number_format($row['product_price'] * (1 + $row['tax_rate'] * 0.01), 2, '.', '');
         $row['total_wt'] = $row['product_quantity'] * $row['product_price_wt'];
         $row['total_price'] = number_format($row['total_wt'] / (1 + $row['tax_rate'] * 0.01), 2, '.', '');
         $row['total_wt'] = number_format($row['total_wt'], 2, '.', '');
         /* Add information for virtual product */
         if ($row['download_hash'] and !empty($row['download_hash'])) {
             $row['filename'] = ProductDownload::getFilenameFromIdProduct($row['product_id']);
         }
         /* Stock product */
         $resultArray[intval($row['id_order_detail'])] = $row;
     }
     return $resultArray;
 }
开发者ID:raulgimenez,项目名称:dreamongraphics_shop,代码行数:37,代码来源:Order.php

示例6: getProducts

 /**
  * Get order products
  *
  * @return array Products with price, quantity (with taxe and without)
  */
 public function getProducts($products = false, $selectedProducts = false, $selectedQty = false)
 {
     if (!$products) {
         $products = $this->getProductsDetail();
     }
     $resultArray = array();
     foreach ($products as $k => $row) {
         // Change qty if selected
         if ($selectedQty) {
             $row['product_quantity'] = 0;
             foreach ($selectedProducts as $key => $id_product) {
                 if ($row['id_order_detail'] == $id_product) {
                     $row['product_quantity'] = intval($selectedQty[$key]);
                 }
             }
             if (!$row['product_quantity']) {
                 continue;
             }
         }
         if (Configuration::get('PS_1_3_2_UPDATE_DATE')) {
             if ($this->_taxCalculationMethod == PS_TAX_EXC) {
                 $row['product_price'] = Tools::ps_round($row['product_price'], 2);
             }
             if ($this->_taxCalculationMethod == PS_TAX_INC) {
                 $row['product_price_wt'] = Tools::ps_round($row['product_price'] * (1 + $row['tax_rate'] * 0.01), 2);
             } else {
                 $row['product_price_wt'] = $row['product_price'];
             }
             if ($row['reduction_percent']) {
                 $row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] - $row['product_price_wt'] * ($row['reduction_percent'] * 0.01), 2);
                 $row['product_price'] = $row['product_price'] - $row['product_price'] * ($row['reduction_percent'] * 0.01);
             }
             if ($row['reduction_amount']) {
                 $row['product_price'] = $row['product_price'] - $row['reduction_amount'];
                 if ($this->_taxCalculationMethod == PS_TAX_INC) {
                     $row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] - $row['reduction_amount'] * (1 + $row['tax_rate'] * 0.01), 2);
                 } else {
                     $row['product_price_wt'] = $row['product_price'];
                 }
             }
             if (($row['reduction_percent'] or $row['reduction_amount']) and $this->_taxCalculationMethod == PS_TAX_EXC) {
                 $row['product_price'] = Tools::ps_round($row['product_price'], 2);
             }
             $row['total_wt'] = $row['product_quantity'] * $row['product_price_wt'];
             $row['total_price'] = $row['product_quantity'] * $row['product_price_wt'];
         } else {
             $price = $row['product_price'];
             if ($this->_taxCalculationMethod == PS_TAX_EXC) {
                 $price = Tools::ps_round($price, 2);
             }
             $row['product_price_wt'] = Tools::ps_round($price * (1 + $row['tax_rate'] * 0.01), 2);
             $row['total_wt'] = $row['product_quantity'] * $row['product_price_wt'];
             $row['total_price'] = $row['product_quantity'] * $row['product_price_wt'];
         }
         /* Add information for virtual product */
         if ($row['download_hash'] and !empty($row['download_hash'])) {
             $row['filename'] = ProductDownload::getFilenameFromIdProduct($row['product_id']);
         }
         /* Stock product */
         $resultArray[intval($row['id_order_detail'])] = $row;
     }
     return $resultArray;
 }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:68,代码来源:Order.php


注:本文中的ProductDownload::getFilenameFromIdProduct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。