本文整理汇总了PHP中Varien_Object::getCustomerId方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Object::getCustomerId方法的具体用法?PHP Varien_Object::getCustomerId怎么用?PHP Varien_Object::getCustomerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Object
的用法示例。
在下文中一共展示了Varien_Object::getCustomerId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* @param Varien_Object $row
*
* @return mixed
*/
public function render(Varien_Object $row)
{
if ($row->getCustomerId() && Mage::getSingleton('admin/session')->isAllowed('customer/manage')) {
$customerEditUrl = $this->getUrl('*/customer/edit', array('id' => $row->getCustomerId()));
return sprintf('<a href="%s">%s</a>', $customerEditUrl, parent::render($row));
}
return parent::render($row);
}
示例2: render
public function render(Varien_Object $row)
{
$customer = Mage::getModel('customer/customer')->load($row->getCustomerId());
if ($customer) {
return sprintf('<a target="_blank" href="%s">%s</a>', $this->getUrl('adminhtml/customer/edit', array('id' => $customer->getId())), $customer->getName());
}
return $row->getCustomerId();
}
示例3: render
public function render(Varien_Object $row)
{
if ($row->getCustomerId()) {
return sprintf('
<a href="%s" title="%s">%s</a>', $this->getUrl('adminhtml/customer/edit/', array('_current' => true, 'id' => $row->getCustomerId())), Mage::helper('catalog')->__('View Customer Detail'), $row->getCustomerEmail());
} else {
return sprintf('%s', $row->getCustomerEmail());
}
}
示例4: render
public function render(Varien_Object $row)
{
$links = '';
if ($row->getCustomerId()) {
$links .= '<a href="' . $this->getUrl('adminhtml/customer/edit', array('id' => $row->getCustomerId())) . '" title="' . $this->__('View Customer') . '">' . $this->__('View Customer') . '</a><br/>';
}
$links .= '<a href="' . $this->getUrl('adminhtml/sales_order/view', array('order_id' => $row->getOrderId())) . '" title="' . $this->__('View Order') . '">' . $this->__('View Order') . '</a>';
return $links;
}
示例5: render
/**
* @param Varien_Object $row
* @return string
*/
public function render(Varien_Object $row)
{
if ($row->getCustomerId()) {
$name = $row->getFirstname() . ' ' . $row->getLastname();
$result = sprintf('<a href="%s">%s</a>', Mage::getUrl('adminhtml/customer/edit', array('id' => $row->getCustomerId())), $name);
} else {
$result = 'Guest';
}
return $result;
}
示例6: render
public function render(Varien_Object $row)
{
if (is_null($row->getCustomerId())) {
return Mage::helper('review')->__('Guest');
} elseif ($row->getCustomerId() == 0) {
return Mage::helper('review')->__('Administrator');
} elseif ($row->getCustomerId() > 0) {
return Mage::helper('review')->__('Customer');
}
// return ($row->getCustomerId() ? Mage::helper('review')->__('Customer') : Mage::helper('review')->__('Guest'));
}
示例7: render
public function render(Varien_Object $row)
{
if (is_null($row->getCustomerId())) {
if ($row->getStoreId() == Mage_Core_Model_App::ADMIN_STORE_ID) {
return Mage::helper('review')->__('Administrator');
} else {
return Mage::helper('review')->__('Guest');
}
} elseif ($row->getCustomerId() > 0) {
return Mage::helper('review')->__('Customer');
}
// return ($row->getCustomerId() ? Mage::helper('review')->__('Customer') : Mage::helper('review')->__('Guest'));
}
示例8: render
/**
* Renders grid column
*
* @param Varien_Object $row
* @return string
*/
public function render(Varien_Object $row)
{
$id = $row->getCustomerId();
if (!$id) {
return ' ';
}
return sprintf('<a href="%s">%s</a>', $this->getUrl('*/catalog_product_review', array('customerId' => $id)), AO::helper('adminhtml')->__('Show reviews'));
}
示例9: _getCustomerEmail
private function _getCustomerEmail(Varien_Object $row)
{
$email = $row->getData($this->getColumn()->getIndex());
if (!$email) {
$email = trim(Mage::getModel('customer/customer')->load($row->getCustomerId())->getEmail());
}
return $email;
}
示例10: render
/**
* Renders grid column
*
* @param Varien_Object $row
* @return string
*/
public function render(Varien_Object $row)
{
$id = $row->getCustomerId();
if (!$id) {
return Mage::helper('Mage_Adminhtml_Helper_Data')->__('Show Reviews');
}
return sprintf('<a href="%s">%s</a>', $this->getUrl('*/catalog_product_review', array('customerId' => $id)), Mage::helper('Mage_Adminhtml_Helper_Data')->__('Show Reviews'));
}
示例11: render
/**
* Render customer info to grid column html
*
* @param Varien_Object $row
*/
public function render(Varien_Object $row)
{
$actionName = $this->getRequest()->getActionName();
if (strpos($actionName, 'export') === 0) {
return $row->getCustomerEmail();
}
return sprintf('<a target="_blank" href="%s">%s</a>', $this->getUrl('adminhtml/customer/edit', array('id' => $row->getCustomerId())), $row->getCustomerEmail());
}
示例12: validate
/**
* Validate Customer Rule Condition
*
* @param Varien_Object $object
*
* @return bool
*/
public function validate(Varien_Object $object)
{
$customer = Mage::getModel('customer/customer')->load($object->getCustomerId());
if (!$customer->getId()) {
return false;
}
return Mage_Rule_Model_Condition_Product_Abstract::validate($customer);
}
示例13: render
public function render(Varien_Object $recurring)
{
$customer = Mage::getModel('customer/customer')->load($recurring->getCustomerId());
// $name = $customer->getFirstname().' '.$customer->getLastname();
// var_dump($row->getData());
$html = '<a ';
$html .= 'id="customer_' . $this->getColumn()->getId() . '" ';
$html .= 'href="' . Mage::helper("adminhtml")->getUrl("adminhtml/customer/edit/id/" . $customer->getId() . "/") . '"/>';
$html .= $recurring->getShippingAddressObj()->format('html');
$html .= '</a><br/>';
return $html;
}
示例14: validate
/**
* Validate Address Rule Condition
*
* @param Varien_Object|Mage_Sales_Model_Order|Mage_Sales_Model_Quote $object
* @return bool
*/
public function validate(Varien_Object $object)
{
/* @var $object Mage_Sales_Model_Order|Mage_Sales_Model_Quote */
//Get infos from billing address
$toValidate = new Varien_Object();
$customer_id = $object->getCustomerId();
$orders_count = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('customer_id', $customer_id)->count();
$toValidate->setOrdersCount($orders_count);
$toValidate->setCustomerIsGuest(is_null($object->getCustomerIsGuest()) ? 0 : $object->getCustomerIsGuest());
$toValidate->setDiffAddresses($this->_addressesesAreDifferent($object));
$toValidate->setCustomerGroup($object->getCustomerGroupId());
return parent::validate($toValidate);
}
示例15: _afterSave
protected function _afterSave(Varien_Object $address)
{
if ($address->getId() && ($address->getIsDefaultBilling() || $address->getIsDefaultShipping())) {
$customer = Mage::getModel('customer/customer')->load($address->getCustomerId());
if ($address->getIsDefaultBilling()) {
$customer->setDefaultBilling($address->getId());
}
if ($address->getIsDefaultShipping()) {
$customer->setDefaultShipping($address->getId());
}
$customer->save();
}
return $this;
}