當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Mage_Catalog_Model_Product::getFinalPrice方法代碼示例

本文整理匯總了PHP中Mage_Catalog_Model_Product::getFinalPrice方法的典型用法代碼示例。如果您正苦於以下問題:PHP Mage_Catalog_Model_Product::getFinalPrice方法的具體用法?PHP Mage_Catalog_Model_Product::getFinalPrice怎麽用?PHP Mage_Catalog_Model_Product::getFinalPrice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mage_Catalog_Model_Product的用法示例。


在下文中一共展示了Mage_Catalog_Model_Product::getFinalPrice方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getFinalPrice

 function getFinalPrice($qty = null)
 {
     if ($this->currentlySelectedFit() && ($customPrice = $this->customPrice($this->currentlySelectedFit()))) {
         return $customPrice;
     }
     return parent::getFinalPrice();
 }
開發者ID:naz-ahmed,項目名稱:ndap-magento-mirror,代碼行數:7,代碼來源:Product.php

示例2: setCategoryPaths

 /**
  * set category path
  */
 public function setCategoryPaths()
 {
     $result = array();
     if ($this->_getExportHelper()->isProductVisibleInCategories($this->item)) {
         $itemsOrderOption = Mage::getStoreConfig(Shopgate_Framework_Model_Config::XML_PATH_SHOPGATE_EXPORT_ITEM_SORT);
         $linkedCategories = Mage::getResourceSingleton('shopgate/product')->getCategoryIdsAndPosition($this->item);
         foreach ($linkedCategories as $link) {
             $categoryItemObject = new Shopgate_Model_Catalog_CategoryPath();
             $categoryItemObject->setUid($link['category_id']);
             switch ($itemsOrderOption) {
                 case Shopgate_Framework_Model_System_Config_Source_Item_Sort::SORT_TYPE_LAST_UPDATED:
                     $sortIndex = Mage::getModel('core/date')->timestamp(strtotime($this->item->getUpdatedAt()));
                     $categoryItemObject->setSortOrder($sortIndex);
                     break;
                 case Shopgate_Framework_Model_System_Config_Source_Item_Sort::SORT_TYPE_NEWEST:
                     $sortIndex = Mage::getModel('core/date')->timestamp(strtotime($this->item->getCreatedAt()));
                     $categoryItemObject->setSortOrder(Shopgate_Framework_Model_Export_Product_Csv::MAX_TIMESTAMP - $sortIndex);
                     break;
                 case Shopgate_Framework_Model_System_Config_Source_Item_Sort::SORT_TYPE_PRICE_DESC:
                     $sortIndex = round($this->item->getFinalPrice() * 100, 0);
                     $categoryItemObject->setSortOrder($sortIndex);
                     break;
                 case Shopgate_Framework_Model_System_Config_Source_Item_Sort::SORT_TYPE_POSITION:
                     $categoryItemObject->setSortOrder($link['max_position'] - $link['position']);
                     break;
                 default:
                     $categoryItemObject->setSortOrder($link['position']);
             }
             $result[$link['category_id']] = $categoryItemObject;
         }
     }
     parent::setCategoryPaths($result);
 }
開發者ID:buttasg,項目名稱:cowgirlk,代碼行數:36,代碼來源:Xml.php

示例3: isPriceSpecial

 public function isPriceSpecial(Mage_Catalog_Model_Product $product)
 {
     /*
      * Check if sale price is activated and if so if sale price is LESS than normal price
      * I.E., customer might be a Member, so the member price might be less than sale price
      */
     $originalPrice = $product->getPrice();
     $finalPrice = $product->getFinalPrice();
     if ($finalPrice < $originalPrice) {
         return self::SPECIAL_PRICE;
     }
     /*
      * check if product is new
      */
     $current_date = time();
     // compare date
     $from_date = $product->getData('news_from_date');
     // begin date
     $to_date = $product->getData('news_to_date');
     // end date
     if ($this->isDateBetween($current_date, $from_date, $to_date)) {
         return self::NEW_PRODUCT;
     }
     return false;
 }
開發者ID:ankita-parashar,項目名稱:magento,代碼行數:25,代碼來源:ICC_Pricemodification_Helper_Data.php

示例4: handleAddResponse

 public function handleAddResponse(Mage_Catalog_Model_Product $product, Mage_Core_Controller_Request_Http $request, Mage_Core_Controller_Response_Http $response)
 {
     $output = array('product_id' => $product->getId(), 'product_price' => $product->getFinalPrice(), 'product_image' => (string) Mage::helper('catalog/image')->init($product, 'image')->resize(150, 150), 'product_qty' => 1, 'quote_total' => $this->_getQuote()->getSubtotal(), 'quote_qty' => $this->_getQuote()->getItemsQty(), 'success' => true);
     $transport = new Varien_Object($output);
     $this->_retrieveHtmlResponse($transport);
     Mage::dispatchEvent('swiftotter_addtocart_success_output', array('transport' => $transport));
     $this->_send($response, $transport->getData(), 200);
 }
開發者ID:swiftotter,項目名稱:addtocart,代碼行數:8,代碼來源:Cart.php

示例5: getFinalPrice

 public function getFinalPrice($qty = null)
 {
     if (Mage::getSingleton('customer/session')->isLoggedIn()) {
         $helper = Mage::helper('ism_newstore_members');
         $price = Mage::getModel('catalog/product')->load($this->getId())->_getData('ism_newstoremembers_price');
         $customerId = Mage::getSingleton('customer/session')->getId();
         if ($price !== null && $helper->isMemberValid($customerId) && $helper->isMemberAddress($customerId)) {
             return $price;
         }
     }
     return parent::getFinalPrice($qty);
 }
開發者ID:swnsma,項目名稱:practice,代碼行數:12,代碼來源:Product.php

示例6: getFinalPrice

 function getFinalPrice($qty = null)
 {
     if (!$this->currentlySelectedFit()) {
         return parent::getFinalPrice($qty);
     }
     $vehicle = $this->vf_product->getFirstCurrentlySelectedFitment();
     if (!$vehicle) {
         return parent::getFinalPrice($qty);
     }
     $customPrice = $this->customPrice($vehicle);
     if ($customPrice) {
         return $customPrice;
     }
     return parent::getFinalPrice($qty);
 }
開發者ID:hashir-dhattiwala,項目名稱:vfmagento,代碼行數:15,代碼來源:Product.php

示例7: getFinalPrice

 function getFinalPrice($qty = null)
 {
     if (!$this->currentlySelectedFit()) {
         return parent::getFinalPrice($qty);
     }
     $selection = $this->currentlySelectedFit();
     $vehicle = $selection->getFirstVehicle();
     if (!$vehicle) {
         return parent::getFinalPrice($qty);
     }
     $customPrice = $this->customPrice($vehicle);
     if ($customPrice) {
         return $customPrice;
     }
     return parent::getFinalPrice($qty);
 }
開發者ID:xiaoguizhidao,項目名稱:autotech_design,代碼行數:16,代碼來源:Product.php

示例8: createIndexData

 public function createIndexData(Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null)
 {
     $data = array();
     $data['store_id'] = $attribute->getStoreId();
     $data['entity_id'] = $object->getId();
     $data['attribute_id'] = $attribute->getId();
     $data['value'] = $object->getData($attribute->getAttributeCode());
     if ($attribute->getAttributeCode() == 'price') {
         $result = array();
         foreach ($this->_customerGroups as $group) {
             $object->setCustomerGroupId($group->getId());
             $finalPrice = $object->getFinalPrice();
             $row = $data;
             $row['customer_group_id'] = $group->getId();
             $row['value'] = $finalPrice;
             $result[] = $row;
         }
         return $result;
     }
     return $data;
 }
開發者ID:quyip8818,項目名稱:Mag,代碼行數:21,代碼來源:Price.php

示例9: getFinalPrice

 /**
  * Retrieve product final price
  *
  * @param   Mage_Catalog_Model_Product $product
  * @return  float
  */
 public function getFinalPrice($product)
 {
     return $product->getFinalPrice();
 }
開發者ID:sagmahajan,項目名稱:aswan_release,代碼行數:10,代碼來源:Product.php

示例10: _preparePrice

 /**
  * Prepare price accordingly to percentage and store rates and round its
  *
  * @param Mage_Catalog_Model_Product $product
  * @param float|int|string $price
  * @param bool $isPercent
  * @return float
  */
 protected function _preparePrice($product, $price, $isPercent = false)
 {
     if ($isPercent && !empty($price)) {
         $price = $product->getFinalPrice() * $price / 100;
     }
     $price = Mage::app()->getStore()->convertPrice($price);
     $price = Mage::app()->getStore()->roundPrice($price);
     return $price;
 }
開發者ID:quyip8818,項目名稱:Mag,代碼行數:17,代碼來源:Configurable.php

示例11: getSelectionPrice

 /**
  * Calculate price of selection
  *
  * @param Mage_Catalog_Model_Product $bundleProduct
  * @param Mage_Catalog_Model_Product $selectionProduct
  * @param decimal $selectionQty
  * @return decimal
  */
 public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty = null, $multiplyQty = true)
 {
     if (is_null($selectionQty)) {
         $selectionQty = $selectionProduct->getSelectionQty();
     }
     if ($bundleProduct->getPriceType() == self::PRICE_TYPE_DYNAMIC) {
         if ($multiplyQty) {
             return $selectionProduct->getFinalPrice($selectionQty) * $selectionQty;
         } else {
             return $selectionProduct->getFinalPrice($selectionQty);
         }
     } else {
         if ($selectionProduct->getSelectionPriceType()) {
             // percent
             return $bundleProduct->getPrice() * ($selectionProduct->getSelectionPriceValue() / 100) * $selectionQty;
         } else {
             // fixed
             return $selectionProduct->getSelectionPriceValue() * $selectionQty;
         }
     }
 }
開發者ID:par-orillonsoft,項目名稱:magento_work,代碼行數:29,代碼來源:Price.php

示例12: _getTierPrices

 /**
  * Get tier prices (formatted)
  *
  * @param Mage_Catalog_Model_Product $product
  * @return array
  */
 protected function _getTierPrices(Mage_Catalog_Model_Product $product)
 {
     if (null === $product) {
         return array();
     }
     $prices = $product->getFormatedTierPrice();
     $res = array();
     if (is_array($prices)) {
         foreach ($prices as $price) {
             $price['price_qty'] = $price['price_qty'] * 1;
             if ($product->getPrice() != $product->getFinalPrice()) {
                 if ($price['price'] < $product->getFinalPrice()) {
                     $price['savePercent'] = ceil(100 - 100 / $product->getFinalPrice() * $price['price']);
                     $price['formated_price'] = Mage::app()->getStore()->formatPrice(Mage::app()->getStore()->convertPrice(Mage::helper('tax')->getPrice($product, $price['website_price'])), false);
                     $price['formated_price_incl_tax'] = Mage::app()->getStore()->formatPrice(Mage::app()->getStore()->convertPrice(Mage::helper('tax')->getPrice($product, $price['website_price'], true)), false);
                     $res[] = $price;
                 }
             } else {
                 if ($price['price'] < $product->getPrice()) {
                     $price['savePercent'] = ceil(100 - 100 / $product->getPrice() * $price['price']);
                     $price['formated_price'] = Mage::app()->getStore()->formatPrice(Mage::app()->getStore()->convertPrice(Mage::helper('tax')->getPrice($product, $price['website_price'])), false);
                     $price['formated_price_incl_tax'] = Mage::app()->getStore()->formatPrice(Mage::app()->getStore()->convertPrice(Mage::helper('tax')->getPrice($product, $price['website_price'], true)), false);
                     $res[] = $price;
                 }
             }
         }
     }
     return $res;
 }
開發者ID:chucky515,項目名稱:Magento-CE-Mirror,代碼行數:35,代碼來源:Default.php

示例13: getSelectionPrice

 /**
  * Calculate price of selection
  *
  * @param Mage_Catalog_Model_Product $bundleProduct
  * @param Mage_Catalog_Model_Product $selectionProduct
  * @param decimal $selectionQty
  * @return decimal
  */
 public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty = null, $multiplyQty = true)
 {
     if (is_null($selectionQty)) {
         $selectionQty = $selectionProduct->getSelectionQty();
     }
     if ($bundleProduct->getPriceType() == Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Extend::DYNAMIC) {
         if ($multiplyQty) {
             return $selectionProduct->getFinalPrice($selectionQty) * $selectionQty;
         } else {
             return $selectionProduct->getFinalPrice($selectionQty);
         }
     } else {
         if ($selectionProduct->getSelectionPriceType()) {
             return $bundleProduct->getPrice() * $selectionProduct->getSelectionPriceValue() / 100 * $selectionQty;
         } else {
             return $selectionProduct->getSelectionPriceValue() * $selectionQty;
         }
     }
 }
開發者ID:HelioFreitas,項目名稱:magento-pt_br,代碼行數:27,代碼來源:Price.php

示例14: getProductData

 /**
  * @param Mage_Catalog_Model_Product $product
  * @return array
  */
 public function getProductData(Mage_Catalog_Model_Product $product)
 {
     $id = $product->getId();
     if (!$this->helper()->shouldUseRealProductId()) {
         $id = $product->getSku() ? $product->getSku() : md5($id);
     }
     $data = array('id' => $id, 'url' => $product->getProductUrl(), 'name' => $product->getName(), 'unit_price' => (double) $product->getPrice(), 'unit_sale_price' => (double) $product->getFinalPrice(), 'currency' => $this->_getCurrency(), 'description' => strip_tags($product->getShortDescription()), 'sku_code' => $product->getSku());
     if ($this->helper()->shouldShowProductStockInfo()) {
         $data['stock'] = (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
     }
     $catIndex = $catNames = array();
     $limit = 2;
     $k = 0;
     foreach ($product->getCategoryIds() as $catId) {
         if (++$k > $limit) {
             break;
         }
         if (!isset($catIndex[$catId])) {
             $catIndex[$catId] = Mage::getModel('catalog/category')->load($catId);
         }
         $catNames[] = $catIndex[$catId]->getName();
     }
     if (isset($catNames[0])) {
         $data['category'] = $catNames[0];
     }
     if (isset($catNames[1])) {
         $data['subcategory'] = $catNames[1];
     }
     return $data;
 }
開發者ID:yurevichcv,項目名稱:UniversalVariable-Magento-Extension,代碼行數:34,代碼來源:Uv.php

示例15: _shouldExport

 protected function _shouldExport(Mage_Catalog_Model_Product $product)
 {
     if ($this->_filterPrice && $product->getFinalPrice() < $this->_filterPrice) {
         return false;
     }
     if ($this->_isComplexProduct($product)) {
         return true;
     }
     if (!$this->_filterStock && !$product->getStockItem()->getIsInStock()) {
         return false;
     }
     if (!$this->_filterStock && $this->_filterStockFrom && $this->_stock[$product->getId()] < $this->_filterStockFrom) {
         return false;
     }
     return true;
 }
開發者ID:xiaoguizhidao,項目名稱:devfashion,代碼行數:16,代碼來源:Feedsalidzini.php


注:本文中的Mage_Catalog_Model_Product::getFinalPrice方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。