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


PHP Mage_Sales_Model_Quote_Item类代码示例

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


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

示例1: getItemEditOptionsHtml

 /**
  * @param Mage_Sales_Model_Quote_Item $item
  * @return string
  */
 public function getItemEditOptionsHtml(Mage_Sales_Model_Quote_Item $item)
 {
     $product = $item->getProduct();
     $optionsBlock = $this->getLayout()->createBlock('emjainteractive_advancedoptions/catalog_product_view_options', 'product.info.options.' . $item->getId())->addOptionRenderer('file', 'emjainteractive_advancedoptions/catalog_product_view_options_type_text', 'emjainteractive/advancedoptions/catalog/product/view/options/type/text.phtml')->addOptionRenderer('select', 'emjainteractive_advancedoptions/catalog_product_view_options_type_select', 'emjainteractive/advancedoptions/catalog/product/view/options/type/select.phtml')->addOptionRenderer('date', 'emjainteractive_advancedoptions/catalog_product_view_options_type_date', 'emjainteractive/advancedoptions/catalog/product/view/options/type/date.phtml')->addOptionRenderer('text', 'emjainteractive_advancedoptions/catalog_product_view_options_type_text', 'emjainteractive/advancedoptions/catalog/product/view/options/type/text.phtml')->setTemplate('catalog/product/view/options.phtml')->setProduct($product)->setQuoteItem($item);
     $jsBlock = $this->getLayout()->createBlock('core/template', 'options_js' . $item->getId())->setTemplate('catalog/product/view/options/js.phtml');
     return $jsBlock->toHtml() . $optionsBlock->toHtml();
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:11,代码来源:Cart.php

示例2: _removeErrorsFromQuoteAndItem

 /**
  * Removes error statuses from quote and item, set by this observer
  *
  * @param Mage_Sales_Model_Quote_Item $item
  * @param int $code
  * @return Mage_CatalogInventory_Model_Observer
  */
 protected function _removeErrorsFromQuoteAndItem($item, $code)
 {
     //if(ITwebexperts_Payperrentals_Helper_Data::isReservationType($item->getProduct()) && ($item->getProduct()->getTypeId() == ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE_CONFIGURABLE || $item->getProduct()->getTypeId() == ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE_BUNDLE || $item->getProduct()->getTypeId() == ITwebexperts_Payperrentals_Helper_Data::PRODUCT_TYPE_GROUPED)){
     //  return $this;
     //}
     if ($item->getHasError()) {
         $params = array('origin' => 'cataloginventory', 'code' => $code);
         $item->removeErrorInfosByParams($params);
     }
     $quote = $item->getQuote();
     $quoteItems = $quote->getItemsCollection();
     $canRemoveErrorFromQuote = true;
     foreach ($quoteItems as $quoteItem) {
         if ($quoteItem->getItemId() == $item->getItemId()) {
             continue;
         }
         $errorInfos = $quoteItem->getErrorInfos();
         foreach ($errorInfos as $errorInfo) {
             if ($errorInfo['code'] == $code) {
                 $canRemoveErrorFromQuote = false;
                 break;
             }
         }
         if (!$canRemoveErrorFromQuote) {
             break;
         }
     }
     if ($quote->getHasError() && $canRemoveErrorFromQuote) {
         $params = array('origin' => 'cataloginventory', 'code' => $code);
         $quote->removeErrorInfosByParams(null, $params);
     }
     return $this;
 }
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:40,代码来源:Observer.php

示例3: compare

 /**
  * Compare item
  *
  * @param   Mage_Sales_Model_Quote_Item $item
  * @return  bool
  */
 public function compare($item)
 {
     if ($item->getOptionByCode('chili_document_id')) {
         return false;
     }
     return parent::compare($item);
 }
开发者ID:finelinePG,项目名称:finelink-dev,代码行数:13,代码来源:Item.php

示例4: _removeErrorsFromQuoteAndItem

 /**
  * Removes error statuses from quote and item, set by this observer
  *
  * @param Mage_Sales_Model_Quote_Item $item
  * @param string $origin
  * @param int $code
  * @return Jarlssen_CustomCartValidation_Model_Observer
  */
 protected function _removeErrorsFromQuoteAndItem($item, $origin, $code)
 {
     if ($item->getHasError()) {
         $params = array('origin' => $origin, 'code' => $code);
         $item->removeErrorInfosByParams($params);
     }
     $quote = $item->getQuote();
     $quoteItems = $quote->getItemsCollection();
     $canRemoveErrorFromQuote = true;
     foreach ($quoteItems as $quoteItem) {
         if ($quoteItem->getItemId() == $item->getItemId()) {
             continue;
         }
         $errorInfos = $quoteItem->getErrorInfos();
         foreach ($errorInfos as $errorInfo) {
             if ($errorInfo['code'] == $code) {
                 $canRemoveErrorFromQuote = false;
                 break;
             }
         }
         if (!$canRemoveErrorFromQuote) {
             break;
         }
     }
     if ($quote->getHasError() && $canRemoveErrorFromQuote) {
         $params = array('origin' => $origin, 'code' => $code);
         $quote->removeErrorInfosByParams(null, $params);
     }
     return $this;
 }
开发者ID:elvetemedve,项目名称:Jarlssen_CustomCartValidation,代码行数:38,代码来源:Observer.php

示例5: getMsrpHtml

 /**
  * Get html for MAP product enabled
  *
  * @param Mage_Sales_Model_Quote_Item $item
  * @return string
  */
 public function getMsrpHtml($item)
 {
     $product = $item->getProduct();
     $block = $this->_preparePriceBlock($product);
     $html = $block->setPriceElementIdPrefix('bundle-price-')->toHtml();
     $product->setRealPriceHtml($html);
     return $this->_getPriceContent($product);
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:14,代码来源:Bundle.php

示例6: getMsrpHtml

 /**
  * Get html for MAP product enabled
  *
  * @param Mage_Sales_Model_Quote_Item $item
  * @return string
  */
 public function getMsrpHtml($item)
 {
     $product = $item->getProduct();
     $block = $this->_preparePriceBlock($product);
     $html = $block->setDisplayMinimalPrice(true)->toHtml();
     $product->setRealPriceHtml($html);
     return $this->_getPriceContent($product);
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:14,代码来源:Configurable.php

示例7: getEddMessage

 /**
  * Get an estimated delivery message for a quote item.
  *
  * @param  Mage_Sales_Model_Quote_Item
  * @return string
  */
 public function getEddMessage(Mage_Sales_Model_Quote_Item $item)
 {
     /** @var string $singularOrPluralItem */
     $singularOrPluralItem = (int) $item->getQty() > 1 ? 's' : '';
     /** @var EbayEnterprise_Inventory_Model_Details_Item | Varien_Object | null $eddItem */
     $eddItem = $this->detailService->getDetailsForItem($item) ?: $this->inventoryHelper->getStreetDateForBackorderableItem($item);
     return $eddItem ? $this->inventoryHelper->__($this->inventoryConfig->estimatedDeliveryTemplate, $singularOrPluralItem, $eddItem->getDeliveryWindowFromDate()->format('m/d/y'), $eddItem->getDeliveryWindowToDate()->format('m/d/y')) : '';
 }
开发者ID:WinstonN,项目名称:magento-retail-order-management,代码行数:14,代码来源:Edd.php

示例8: setParentItem

 /**
  * Set parent item
  *
  * @param  Mage_Sales_Model_Quote_Item $parentItem
  * @return Mage_Sales_Model_Quote_Item
  */
 public function setParentItem($parentItem)
 {
     if ($parentItem) {
         $this->_parentItem = $parentItem;
         $parentItem->addChild($this);
     }
     return $this;
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:14,代码来源:Abstract.php

示例9: setUp

 protected function setUp()
 {
     $this->_block = new Mage_Checkout_Block_Cart_Item_Renderer();
     $item = new Mage_Sales_Model_Quote_Item();
     $product = new Mage_Catalog_Model_Product();
     $product->load(1);
     $item->setProduct($product);
     $this->_block->setItem($item);
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:9,代码来源:Renderer.php

示例10: quoteItemHasCustomTagOptions

 public function quoteItemHasCustomTagOptions(Mage_Sales_Model_Quote_Item $quoteItem)
 {
     return array_reduce($quoteItem->getOptions(), function ($acc, Mage_Sales_Model_Quote_Item_Option $option) {
         if ($acc || !preg_match('/^option_/', $option->getCode())) {
             return $acc;
         }
         return !!Mage::getResourceModel('catalog/product_option_value_collection')->addFieldToFilter('option_type_id', $option->getValue())->addFieldToFilter('is_custom_tag', '1')->setPageSize(1)->load()->getSize();
     }, false);
 }
开发者ID:suspiciousfellow,项目名称:TaggedOption,代码行数:9,代码来源:Data.php

示例11: validate

 /**
  * Implementation of the validation logic
  *
  * @param Mage_Sales_Model_Quote_Item $item
  * @return bool
  */
 public function validate($item)
 {
     $multipleNumber = $this->_helper->getMultipleQtyNumber();
     $qty = $item->getQty();
     //For example 100 % 10
     if ($qty % $multipleNumber != 0) {
         return false;
     }
     return true;
 }
开发者ID:Engr-Kaka,项目名称:MyCompany_ExampleValidation,代码行数:16,代码来源:ValidateMultipleQty.php

示例12: importQuoteItem

 public function importQuoteItem(Mage_Sales_Model_Quote_Item $quoteItem)
 {
     $this->_quote = $quoteItem->getQuote();
     $this->setQuoteItem($quoteItem)->setQuoteItemId($quoteItem->getId())->setProductId($quoteItem->getProductId())->setProduct($quoteItem->getProduct())->setSku($quoteItem->getSku())->setName($quoteItem->getName())->setDescription($quoteItem->getDescription())->setWeight($quoteItem->getWeight())->setPrice($quoteItem->getPrice())->setCost($quoteItem->getCost());
     if (!$this->hasQty()) {
         $this->setQty($quoteItem->getQty());
     }
     $this->setQuoteItemImported(true);
     return $this;
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:10,代码来源:Quote_Address_Item.php

示例13: validateStock

 /**
  * Validate stock of a quoteItem
  *
  * @param Mage_Sales_Model_Quote_Item $item
  * @param float                       $priceInclTax
  * @param float                       $priceExclTax
  * @return ShopgateCartItem $result
  */
 public function validateStock(Mage_Sales_Model_Quote_Item $item, $priceInclTax, $priceExclTax)
 {
     switch ($item->getProduct()->getTypeId()) {
         case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE:
             $model = Mage::getModel('shopgate/shopgate_cart_validation_stock_bundle');
             break;
         default:
             $model = Mage::getModel('shopgate/shopgate_cart_validation_stock_simple');
     }
     return $model->validateStock($item, $priceInclTax, $priceExclTax);
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:19,代码来源:Stock.php

示例14: getConfigureButtonHtml

 /**
  * Get button to configure product
  *
  * @param Mage_Sales_Model_Quote_Item $item
  * @return mixed
  */
 public function getConfigureButtonHtml($item)
 {
     $product = $item->getProduct();
     $options = array('label' => Mage::helper('sales')->__('Configure'));
     if ($product->canConfigure()) {
         $options['onclick'] = sprintf('orderEditItems.showQuoteItemConfiguration(%s)', $item->getId());
     } else {
         $options['class'] = ' disabled';
         $options['title'] = Mage::helper('sales')->__('This product does not have any configurable options');
     }
     return $this->getLayout()->createBlock('adminhtml/widget_button')->setData($options)->toHtml();
 }
开发者ID:AleksNesh,项目名称:pandora,代码行数:18,代码来源:Itemsgrid.php

示例15: setItem

 /**
  * Get gifregistry params by quote item
  *
  * @param Mage_Sales_Model_Quote_Item $newItem
  * @return Enterprise_GiftRegistry_Block_Cart_Product_Mark
  */
 public function setItem($newItem)
 {
     if ($this->hasItem() && $this->getItem()->getId() == $newItem->getId()) {
         return $this;
     }
     if ($newItem->getGiftregistryItemId()) {
         $this->setData('item', $newItem);
         $entity = Mage::getModel('enterprise_giftregistry/entity')->loadByEntityItem($newItem->getGiftregistryItemId());
         $this->setEntity($entity);
     }
     return $this;
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:18,代码来源:Mark.php


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