本文整理汇总了PHP中Varien_Object::getProductId方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Object::getProductId方法的具体用法?PHP Varien_Object::getProductId怎么用?PHP Varien_Object::getProductId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Object
的用法示例。
在下文中一共展示了Varien_Object::getProductId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render(Varien_Object $row)
{
$collection = Mage::getModel('catalog/product')->getCollection();
$model = Mage::getModel('catalog/product')->load($row->getProductId());
$product = Mage::getModel('catalog/product')->loadByAttribute('entity_id', $row->getProductId())->getName();
return $product;
}
示例2: refreshDeal
public function refreshDeal(Varien_Object $_deal)
{
//verify if product is enabled for at least one website
$productStatus = 2;
$storeIds = explode(',', $_deal->getStores());
foreach ($storeIds as $storeId) {
$product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($_deal->getProductId());
if ($product->getStatus() == 1) {
$productStatus = 1;
break;
}
}
//verify if product is in stock and if deal qty is higher than 0
$product = Mage::getModel('catalog/product')->load($_deal->getProductId());
$stockItem = $product->getStockItem();
$inStock = $stockItem->getIsInStock() ? true : false;
if ($attributesArray = $this->checkDealStatus($_deal, $productStatus, $inStock, $product->getTypeId())) {
if ($attributesArray['disable_product']) {
//foreach ($storeIds as $storeId) {
if (Mage::helper('multipledeals')->getMagentoVersion() >= 1324) {
Mage::getSingleton('catalog/product_action')->updateAttributes(array($product->getId()), array('status' => 2), 0);
} else {
Mage::getModel('catalog/product_status')->updateProductStatus($product->getId(), 0, 2);
}
//}
}
$_deal->setStatus($attributesArray['status'])->save();
Mage::app()->getCacheInstance()->cleanType('collections');
if (Mage::getConfig()->getModuleConfig('Enterprise_Enterprise')) {
Mage::getSingleton('enterprise_pagecache/cache')->getCacheInstance()->cleanType('full_page');
}
}
}
示例3: render
/**
* Return the product named URL
*
* @param Varien_Object $row
* @return string
*/
public function render(Varien_Object $row)
{
if ($row->getProductId()) {
$url = Mage::getModel('adminhtml/url')->getUrl('*/catalog_product/edit', array('id' => $row->getProductId()));
return sprintf('<a href="%s">%s</a>', $url, $row->getProductName());
}
return 'NA';
}
示例4: render
public function render(Varien_Object $row)
{
$product_id = $row->getProductId();
return '
<p style="text-align:center"><input type="text" name="qty_' . $row->getProductId() . '" id="qty_' . $row->getProductId() . '" size="15" style="text-align:center" onchange="supplyNeedsGrid.logChange(this.name,\'\')"/></p>
<p style="text-align:center">
<button type="button" name="maxButton" size="7" onclick="calMax(' . $product_id . ')">Auto Fill</button>
</p>
';
}
示例5: render
public function render(Varien_Object $row)
{
$productId = $row->getProductId();
$stockHistoryUrl = $this->getUrl('inventoryreportsadmin/adminhtml_product/chart', array('id' => $productId));
$html = "<a href='' onclick='window.open( " . "\"" . $stockHistoryUrl . "\"" . "," . "\"" . $this->__('Inventory History') . "\"" . "," . "\"" . 'scrollbars=yes, resizable=yes, width=520, height=540, top=50, left=300' . "\"" . "); " . "return false;' target='_blank'>" . $this->__('Inventory History') . '</a> <br/>';
return $html;
}
示例6: render
/**
* Renders grid column
*
* @param Varien_Object $row
* @return string
*/
public function render(Varien_Object $row)
{
$value = '';
if ($barcodeProducts = Mage::getModel('admin/session')->getData('barcode_product_import')) {
foreach ($barcodeProducts as $barcodeProduct) {
if ($barcodeProduct['PRODUCT_ID'] == $row->getProductId()) {
if (isset($barcodeProduct['BARCODE']) && $barcodeProduct['BARCODE']) {
$value = $barcodeProduct['BARCODE'];
}
}
}
}
$checked = 'checked="checked"';
if ($value) {
$checked = '';
}
$html = Mage::helper('inventorybarcode')->__('Auto') . ': <input onclick="setBarcodeAuto(this,\'barcode-' . $row->getId() . '\')" type="checkbox" name="barcode_auto" ' . $checked . ' value="">';
$html .= '<input type="text" ';
$html .= 'id="barcode-' . $row->getId() . '" ';
$html .= 'name="' . $this->getColumn()->getId() . '" ';
$html .= 'value="' . $value . '"';
$html .= 'class="input-text' . $this->getColumn()->getInlineCss() . '" readonly />';
// $html .= '<p class="note" id="note_barcode"><span>'.Mage::helper('inventory')->__('Just [A-Z][a-z][0-9] are allowed').'</span></p>';
return $html;
}
示例7: renderConfigureResult
/**
* Prepares and render result of composite product configuration request
*
* $configureResult holds either:
* - 'ok' = true, and 'product_id', 'buy_request', 'current_store_id', 'current_customer' or 'current_customer_id'
* - 'error' = true, and 'message' to show
*
* @param Mage_Adminhtml_Controller_Action $controller
* @param Varien_Object $configureResult
* @return Mage_Adminhtml_Helper_Catalog_Product_Composite
*/
public function renderConfigureResult($controller, Varien_Object $configureResult)
{
try {
if (!$configureResult->getOk()) {
Mage::throwException($configureResult->getMessage());
}
$currentStoreId = (int) $configureResult->getCurrentStoreId();
if (!$currentStoreId) {
$currentStoreId = Mage::app()->getStore()->getId();
}
$product = Mage::getModel('catalog/product')->setStoreId($currentStoreId)->load($configureResult->getProductId());
if (!$product->getId()) {
Mage::throwException($this->__('Product is not loaded.'));
}
Mage::register('current_product', $product);
Mage::register('product', $product);
// Prepare buy request values
$buyRequest = $configureResult->getBuyRequest();
if ($buyRequest) {
Mage::helper('catalog/product')->prepareProductOptions($product, $buyRequest);
}
$isOk = true;
$productType = $product->getTypeId();
} catch (Exception $e) {
$isOk = false;
$productType = null;
Mage::register('composite_configure_result_error_message', $e->getMessage());
}
$this->_initConfigureResultLayout($controller, $isOk, $productType);
$controller->renderLayout();
}
示例8: render
public function render(Varien_Object $row)
{
$columnName = $this->getColumn()->getName();
$columnName = explode('_', $columnName);
if ($columnName[1]) {
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$installer = Mage::getModel('core/resource');
$warehouseId = $columnName[1];
$purchase_order_id = $this->getRequest()->getParam('id');
$sql = 'SELECT qty_delivery from ' . $installer->getTableName("erp_inventory_delivery_warehouse") . ' WHERE (purchase_order_id = ' . $purchase_order_id . ') AND (product_id = ' . $row->getProductId() . ') AND (warehouse_id = ' . $warehouseId . ') AND (sametime = ' . $row->getSametime() . ')';
$results = $readConnection->fetchAll($sql);
$haveDelivery = 0;
foreach ($results as $result) {
if ($result['qty_delivery']) {
$haveDelivery = 1;
echo $result['qty_delivery'];
}
}
if ($haveDelivery == '0') {
echo 0;
}
} else {
parent::render($row);
}
}
示例9: validate
public function validate(Varien_Object $object)
{
$product = Mage::getModel('catalog/product')->setStoreId($object->getStoreId())->load($object->getProductId());
$this->_entityAttributeValues[$product->getId()][$product->getStoreId()] = $product->getData($this->getAttribute());
// Required since 1.8.0.0 // Old: $this->getValue() //
#var_dump($this->getAttribute(), $product->getData($this->getAttribute()), parent::validateAttribute($product));
return parent::validate($product);
}
示例10: render
public function render(Varien_Object $row)
{
$product_id = $row->getProductId();
$product = Mage::getModel('catalog/product')->load($product_id);
if ($product->getId()) {
return $product->getName();
} else {
return $row->getProductName();
}
}
示例11: render
public function render(Varien_Object $row)
{
$productId = $row->getProductId();
$product = Mage::getModel('catalog/product')->load($productId);
if (!$product->getId()) {
return $row->getProductName() . '<br/><p class="item-msg error">* This product is not in stock!</p>';
} else {
return parent::render($row);
}
}
示例12: validate
/**
* Validate Product Rule Condition
*
* @param Varien_Object $object
*
* @return bool
*/
public function validate(Varien_Object $object)
{
/** @var Mage_Catalog_Model_Product $product */
$product = $object->getProduct();
if (!$product instanceof Mage_Catalog_Model_Product) {
$product = Mage::getModel('catalog/product')->load($object->getProductId());
}
$product->setQuoteItemQty($object->getQty())->setQuoteItemPrice($object->getPrice())->setQuoteItemRowTotal($object->getBaseRowTotal());
return parent::validate($product);
}
示例13: validate
/**
* Validate Product Rule Condition
*
* @param Varien_Object $object
*
* @return bool
*/
public function validate(Varien_Object $object)
{
$product = false;
if ($object->getProduct() instanceof Mage_Catalog_Model_Product && $object->getData($this->getAttribute()) !== null) {
$product = $object->getProduct();
} else {
$product = Mage::getModel('catalog/product')->load($object->getProductId());
}
$product->setQuoteItemQty($object->getQty())->setQuoteItemPrice($object->getPrice())->setQuoteItemRowTotal($object->getBaseRowTotal());
return parent::validate($product);
}
示例14: render
public function render(Varien_Object $row)
{
$str = '';
$productId = $row->getProductId();
$product = Mage::getModel('catalog/product')->load($productId);
if (!$productId) {
$str = 'There is not product available !';
} else {
$str .= '<a href="' . $this->getUrl('adminhtml/catalog_product/edit', array('id' => $product->getEntityId())) . '">' . $product->getName() . '</a></br>';
}
return $str;
}
示例15: render
public function render(Varien_Object $row)
{
$dealId = $row->getProductId();
$str = '';
$deal = Mage::getModel('dailydeal/dailydeal')->load($dealId);
if (!$dealId) {
$str = $this->__('There is no daily deal available!');
} else {
$str .= '<a href="' . $this->getUrl('dailydealadmin/adminhtml_dailydeal/edit/', array('id' => $dealId)) . '">' . $deal->getTitle() . '</a></br>';
}
return $str;
}