本文整理汇总了PHP中Mage_Sales_Model_Order_Item::getIsVirtual方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Order_Item::getIsVirtual方法的具体用法?PHP Mage_Sales_Model_Order_Item::getIsVirtual怎么用?PHP Mage_Sales_Model_Order_Item::getIsVirtual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Order_Item
的用法示例。
在下文中一共展示了Mage_Sales_Model_Order_Item::getIsVirtual方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _needToAddDummyForShipment
/**
* Decides if we need to create dummy shipment item or not
* for eaxample we don't need create dummy parent if all
* children are not in process
*
* @deprecated after 1.4, Mage_Sales_Model_Service_Order used
* @param Mage_Sales_Model_Order_Item $item
* @param array $qtys
* @return bool
*/
protected function _needToAddDummyForShipment($item, $qtys)
{
if ($item->getHasChildren()) {
foreach ($item->getChildrenItems() as $child) {
if ($child->getIsVirtual()) {
continue;
}
if (isset($qtys[$child->getId()]) && $qtys[$child->getId()] > 0) {
return true;
}
}
if ($item->isShipSeparately()) {
return true;
}
return false;
} else {
if ($item->getParentItem()) {
if ($item->getIsVirtual()) {
return false;
}
if (isset($qtys[$item->getParentItem()->getId()]) && $qtys[$item->getParentItem()->getId()] > 0) {
return true;
}
return false;
}
}
}
示例2: _needToAddDummy
/**
* Decides if we need to create dummy shipment item or not
* for eaxample we don't need create dummy parent if all
* children are not in process
*
* @deprecated after 1.4, Mage_Sales_Model_Service_Order used
* @param Mage_Sales_Model_Order_Item $item
* @param array $qtys
* @return bool
*/
protected function _needToAddDummy($item, $qtys)
{
if ($item->getHasChildren()) {
foreach ($item->getChildrenItems() as $child) {
if ($child->getIsVirtual()) {
continue;
}
if (isset($qtys[$child->getId()]) && $qtys[$child->getId()] > 0 || !isset($qtys[$child->getId()]) && $child->getQtyToShip()) {
return true;
}
}
return false;
} else {
if ($item->getParentItem()) {
if ($item->getIsVirtual()) {
return false;
}
if (isset($qtys[$item->getParentItem()->getId()]) && $qtys[$item->getParentItem()->getId()] > 0 || !isset($qtys[$item->getParentItem()->getId()]) && $item->getParentItem()->getQtyToShip()) {
return true;
}
return false;
}
}
}
示例3: _canShipItem
/**
* Check if order item can be shiped. Dummy item can be shiped or with his childrens or
* with parent item which is included to shipment
*
* @param Mage_Sales_Model_Order_Item $item
* @param array $qtys
* @return bool
*/
protected function _canShipItem($item, $qtys = array())
{
if ($item->getIsVirtual() || $item->getLockedDoShip()) {
return false;
}
if ($item->isDummy(true)) {
if ($item->getHasChildren()) {
if ($item->isShipSeparately()) {
return true;
}
foreach ($item->getChildrenItems() as $child) {
if ($child->getIsVirtual()) {
continue;
}
if (empty($qtys)) {
if ($child->getQtyToShip() > 0) {
return true;
}
} else {
if (isset($qtys[$child->getId()]) && $qtys[$child->getId()] > 0) {
return true;
}
}
}
return false;
} else {
if ($item->getParentItem()) {
$parent = $item->getParentItem();
if (empty($qtys)) {
return $parent->getQtyToShip() > 0;
} else {
return isset($qtys[$parent->getId()]) && $qtys[$parent->getId()] > 0;
}
}
}
} else {
return $item->getQtyToShip() > 0;
}
}
示例4: getItemShippingDescription
/**
* Get the shipping description to use for an item. Takes into account if
* the item is a physical or virtual item.
*
* @param Mage_Sales_Model_Order_Item
* @param Mage_Sales_Model_Order_Address
* @return string
*/
protected function getItemShippingDescription(Mage_Sales_Model_Order_Item $item, Mage_Sales_Model_Order_Address $address)
{
return $item->getIsVirtual() ? $this->shippingHelper->getVirtualMethodDescription() : $address->getShippingDescription();
}
示例5: _createOrderItemStatus
/**
* Creates OCL OrderStatus record
*
* @param Mage_Sales_Model_Order_Item $item
* @return string
*/
protected function _createOrderItemStatus(Mage_Sales_Model_Order_Item $item)
{
switch ($item->getStatusId()) {
case Mage_Sales_Model_Order_Item::STATUS_SHIPPED:
return self::STATUS_SHIPPED;
case Mage_Sales_Model_Order_Item::STATUS_BACKORDERED:
return self::STATUS_BACKORDERED;
case Mage_Sales_Model_Order_Item::STATUS_CANCELED:
return self::STATUS_CANCELLED;
case Mage_Sales_Model_Order_Item::STATUS_PARTIAL:
return self::STATUS_PARTIALLY_SHIPPED;
case Mage_Sales_Model_Order_Item::STATUS_REFUNDED:
case Mage_Sales_Model_Order_Item::STATUS_RETURNED:
return self::STATUS_PROCESSING_RETURN;
}
$orderState = $item->getOrder()->getState();
switch ($orderState) {
case Mage_Sales_Model_Order::STATE_NEW:
return self::STATUS_NEW;
case Mage_Sales_Model_Order::STATE_HOLDED:
return self::STATUS_ON_HOLD;
case Mage_Sales_Model_Order::STATE_COMPLETE:
case Mage_Sales_Model_Order::STATE_CLOSED:
return self::STATUS_COMPLETED;
}
if ($orderState == Mage_Sales_Model_Order::STATE_PROCESSING && $item->getStatus() == Mage_Sales_Model_Order_Item::STATUS_INVOICED) {
return $item->getIsVirtual() ? self::STATUS_PAID : self::STATUS_READY_TO_SHIP;
}
return self::STATUS_NEW;
}
示例6: _loadDefaultAddressForItem
/**
* Get a default address for an item if one exists. For virtual items,
* the default address will be the billing address of the order the item
* belongs to. For non-virtual items, the default address will be the
* primary shipping address of the order the item belongs to. If the
* appropriate default address for the item does not exits, no address
* will be returned.
*
* @param Mage_Sales_Model_Order_Item
* @return Mage_Sales_Model_Order_Address|null
*/
protected function _loadDefaultAddressForItem(Mage_Sales_Model_Order_Item $item)
{
$order = $item->getOrder();
if (!$order) {
return null;
}
$defaultAddress = $item->getIsVirtual() ? $order->getBillingAddress() : $order->getShippingAddress();
// If the appropriate default address did not exist in the order, false
// will have been returned. In such cases, return null to indicate that
// no such address exists.
return $defaultAddress ?: null;
}