本文整理汇总了PHP中mage::getModel方法的典型用法代码示例。如果您正苦于以下问题:PHP mage::getModel方法的具体用法?PHP mage::getModel怎么用?PHP mage::getModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mage
的用法示例。
在下文中一共展示了mage::getModel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareCollection
/**
* Charge la collection
*
* @return unknown
*/
protected function _prepareCollection()
{
//Charge la collection
$collection = Mage::getModel('Purchase/StockMovement')->getCollection()->join('Purchase/CatalogProduct', 'sm_product_id=`Purchase/CatalogProduct`.entity_id')->join('Purchase/CatalogProductVarchar', 'sm_product_id=`Purchase/CatalogProductVarchar`.entity_id and store_id=0 and attribute_id = ' . mage::getModel('Purchase/Constant')->GetProductNameAttributeId());
$this->setCollection($collection);
return parent::_prepareCollection();
}
示例2: render
public function render(Varien_Object $row)
{
//get planning
$planning = $row->getPlanning();
//if no planning found, try to load it from order id
if ($planning == null) {
$orderId = $row->getopp_order_id();
$planning = mage::getModel('Purchase/SalesOrderPlanning')->load($orderId, 'psop_order_id');
}
if ($planning) {
$html = '<div class="nowrap" style="text-align: left;">';
if ($planning->getFullstockDate() != '') {
$html .= mage::helper('purchase')->__('Prepare') . ' : <font color="' . $this->getColorForDate($planning->getFullstockDate()) . '">' . mage::helper('core')->formatDate($planning->getFullstockDate(), 'short') . '</font>';
}
if ($planning->getShippingDate() != '') {
$html .= '<br>' . mage::helper('purchase')->__('Ship') . ' : <font color="' . $this->getColorForDate($planning->getShippingDate()) . '">' . mage::helper('core')->formatDate($planning->getShippingDate(), 'short') . '</font>';
}
if ($planning->getDeliveryDate() != '') {
$html .= '<br>' . mage::helper('purchase')->__('Delivery') . ' <font color="' . $this->getColorForDate($planning->getDeliveryDate()) . '">: ' . mage::helper('core')->formatDate($planning->getDeliveryDate(), 'short') . '</font>';
}
$html .= '</div>';
} else {
$html = $this->__('No planning');
}
return $html;
}
示例3: getOrder
public function getOrder()
{
if ($this->_order == null) {
$this->_order = mage::getModel('Purchase/Order')->load($this->getRequest()->getParam('po_num'));
}
return $this->_order;
}
示例4: cleanCanceledOrders
/**
* Set stocks updated to 1 for canceled orders
*
*/
public function cleanCanceledOrders()
{
$collection = mage::getModel('sales/order')->getCollection()->addFieldToFilter('stocks_updated', 0)->addAttributeToFilter('status', 'canceled');
foreach ($collection as $order) {
$order->setstocks_updated(1)->save();
}
}
示例5: _getLevels
protected function _getLevels()
{
if (!$this->_levels) {
$this->_levels = mage::getModel('ebayenterprise_magelog/system_config_source_log_levels');
}
return $this->_levels;
}
示例6: getSupplier
/**
*
*
* @return Mage_Catalog_Model_Product
*/
public function getSupplier()
{
if ($this->_supplier == null) {
$this->_supplier = mage::getModel('Purchase/Supplier')->load($this->getRequest()->getParam('sup_id'));
}
return $this->_supplier;
}
示例7: load
/**
* Load product collection Id(s)
*
*/
public function load()
{
//Charge les commandes fournisseur
$this->_collection = mage::getModel('Purchase/OrderProduct')->getCollection()->join('catalog/product', 'pop_product_id=entity_id')->setOrder('pop_order_num', 'asc');
//Affiche le nombre de commande chargée
$this->addException(Mage::helper('dataflow')->__('Loaded %s rows', $this->_collection->getSize()), Mage_Dataflow_Model_Convert_Exception::NOTICE);
}
示例8: load
/**
* Load product collection Id(s)
*
*/
public function load()
{
$nameAttributeId = mage::getModel('Purchase/Constant')->GetProductNameAttributeId();
$this->_collection = mage::getModel('Purchase/StockMovement')->getCollection()->setOrder('sm_date', 'asc')->join('catalog/product', 'sm_product_id=entity_id');
//Affiche le nombre de commande chargée
$this->addException(Mage::helper('dataflow')->__('Loaded %s rows', $this->_collection->getSize()), Mage_Dataflow_Model_Convert_Exception::NOTICE);
}
示例9: GetOrderPaymentValidatedAttributeId
public function GetOrderPaymentValidatedAttributeId()
{
if ($this->_OrderPaymentValidatedAttributeId == null) {
$this->_OrderPaymentValidatedAttributeId = mage::getModel('eav/entity_attribute')->loadByCode('order', 'payment_validated')->getId();
}
return $this->_OrderPaymentValidatedAttributeId;
}
示例10: load
/**
* Load product collection Id(s)
*
*/
public function load()
{
//Charge les commandes fournisseur
$this->_collection = mage::getModel('Purchase/SupplyNeeds')->getCollection()->setOrder('sn_id', 'asc');
//Affiche le nombre de commande chargée
$this->addException(Mage::helper('dataflow')->__('Loaded %s rows', $this->_collection->getSize()), Mage_Dataflow_Model_Convert_Exception::NOTICE);
}
示例11: getProduct
/**
* Retourne le du produit courant
*
* @return unknown
*/
public function getProduct()
{
if ($this->_product == null) {
$this->_product = mage::getModel('catalog/product')->load($this->_productId);
}
return $this->_product;
}
示例12: render
public function render(Varien_Object $row)
{
//recupere les infos
$orderItem = $row;
$value = $orderItem->getreserved_qty();
//recupere le produit
$product = mage::getModel('catalog/product')->load($orderItem->getproduct_id());
//si le produit ne gere pas les stocks
if ($product->getStockItem()->getManageStock()) {
if ($orderItem->getqty_ordered() - $orderItem->getRealShippedQty() == 0) {
$retour = $this->__('Shipped');
} else {
//si la qté est suffisante pour réserver ou déja réservé
if ($product->CanReserveQty($orderItem->getqty_ordered()) || $value == $orderItem->getqty_ordered()) {
if ($value > 0) {
$checked = " checked ";
} else {
$checked = "";
}
$retour = "<input type=\"checkbox\" name=\"qty_reserved_" . $orderItem->getId() . "\" values=\"1\" {$checked}>";
} else {
$retour = "<font color=\"red\">" . $this->__('Stock Insufficient') . "</font>";
}
}
} else {
$retour = "<font color=\"red\">" . $this->__('No Stock Management') . "</font>";
}
//retourne
return $retour;
}
示例13: load
/**
* Load product collection Id(s)
*
*/
public function load()
{
//Charge les commandes fournisseur
$this->_collection = mage::getModel('Orderpreparation/ordertoprepareitem')->getCollection()->join('sales/order_item', 'order_item_id=item_id');
//Affiche le nombre de commande chargée
$this->addException(Mage::helper('dataflow')->__('Loaded %s rows', $this->_collection->getSize()), Mage_Dataflow_Model_Convert_Exception::NOTICE);
}
示例14: GetLastPriceWithoutFees
/**
* Retourne le dernier prix d'achat sans frais d'approche pour un produit
*
* @param unknown_type $ProductId
*/
public function GetLastPriceWithoutFees($ProductId)
{
$sql = 'select pop_price_ht_base from ' . mage::getModel('Purchase/Constant')->getTablePrefix() . 'purchase_order_product, ' . mage::getModel('Purchase/Constant')->getTablePrefix() . 'purchase_order where pop_order_num = po_num and po_status = \'' . MDN_Purchase_Model_Order::STATUS_COMPLETE . '\' and pop_price_ht_base > 0 and pop_product_id = ' . $ProductId . ' order by po_num DESC LIMIT 1';
$retour = mage::getResourceModel('sales/order_item_collection')->getConnection()->fetchOne($sql);
$retour = number_format($retour, 2);
return $retour;
}
示例15: getProduct
/**
* Retourne le produit concerné
*
* @param unknown_type $value
*/
public function getProduct()
{
if ($this->_product == null) {
$this->_product = mage::getModel('catalog/product')->load($this->getRequest()->getParam('product_id'));
}
return $this->_product;
}