本文整理汇总了PHP中AO::getUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP AO::getUrl方法的具体用法?PHP AO::getUrl怎么用?PHP AO::getUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AO
的用法示例。
在下文中一共展示了AO::getUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _toHtml
protected function _toHtml()
{
$storeId = $this->_getStoreId();
$newurl = AO::getUrl('rss/catalog/new');
$title = AO::helper('rss')->__('New Products from %s', AO::app()->getStore()->getGroup()->getName());
$lang = AO::getStoreConfig('general/locale/code');
$rssObj = AO::getModel('rss/rss');
$data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8', 'language' => $lang);
$rssObj->_addHeader($data);
/*
oringinal price - getPrice() - inputed in admin
special price - getSpecialPrice()
getFinalPrice() - used in shopping cart calculations
*/
$product = AO::getModel('catalog/product');
$todayDate = $product->getResource()->formatDate(time());
$products = $product->getCollection()->setStoreId($storeId)->addStoreFilter()->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))->addAttributeToFilter(array(array('attribute' => 'news_to_date', 'date' => true, 'from' => $todayDate), array('attribute' => 'news_to_date', 'is' => new Zend_Db_Expr('null'))), '', 'left')->addAttributeToSort('news_from_date', 'desc')->addAttributeToSelect(array('name', 'short_description', 'description', 'price', 'thumbnail'), 'inner')->addAttributeToSelect(array('special_price', 'special_from_date', 'special_to_date'), 'left');
AO::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
AO::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);
//echo $products->getSelect();
/*
using resource iterator to load the data one by one
instead of loading all at the same time. loading all data at the same time can cause the big memory allocation.
*/
AO::getSingleton('core/resource_iterator')->walk($products->getSelect(), array(array($this, 'addNewItemXmlCallback')), array('rssObj' => $rssObj, 'product' => $product));
return $rssObj->createRssXml();
}
示例2: redirectAction
/**
* When a customer chooses iDEAL Advanced on Checkout/Payment page
*
*/
public function redirectAction()
{
$order = AO::getModel('sales/order');
$order->load($this->getCheckout()->getLastOrderId());
if ($order->getId()) {
$advanced = $order->getPayment()->getMethodInstance();
$issuerId = $order->getPayment()->getIdealIssuerId();
$response = $advanced->sendTransactionRequest($order, $issuerId);
if ($response) {
$order->getPayment()->setTransactionId($response->getTransactionId());
$order->getPayment()->setLastTransId($response->getTransactionId());
$order->getPayment()->setIdealTransactionChecked(0);
if ($response->getError()) {
$this->getCheckout()->setIdealErrorMessage($response->getError());
$this->_redirect('*/*/failure');
return;
}
$this->getResponse()->setBody($this->getLayout()->createBlock('ideal/advanced_redirect')->setMessage($this->__('You will be redirected to bank in a few seconds.'))->setRedirectUrl($response->getIssuerAuthenticationUrl())->toHtml());
$order->addStatusToHistory($order->getStatus(), $this->__('Customer was redirected to iDEAL'));
$order->save();
$this->getCheckout()->setIdealAdvancedQuoteId($this->getCheckout()->getQuoteId(true));
$this->getCheckout()->setIdealAdvancedOrderId($this->getCheckout()->getLastOrderId(true));
return;
}
}
$this->getResponse()->setBody($this->getLayout()->createBlock('ideal/advanced_redirect')->setMessage($this->__('Error occured. You will be redirected back to store.'))->setRedirectUrl(AO::getUrl('checkout/cart'))->toHtml());
}
示例3: _toHtml
protected function _toHtml()
{
//store id is store view id
$storeId = $this->_getStoreId();
$websiteId = AO::app()->getStore($storeId)->getWebsiteId();
//customer group id
$custGroup = $this->_getCustomerGroupId();
$newurl = AO::getUrl('rss/catalog/salesrule');
$title = AO::helper('rss')->__('%s - Discounts and Coupons', AO::app()->getStore($storeId)->getName());
$lang = AO::getStoreConfig('general/locale/code');
$rssObj = AO::getModel('rss/rss');
$data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8', 'language' => $lang);
$rssObj->_addHeader($data);
$now = date('Y-m-d');
$_saleRule = AO::getModel('salesrule/rule');
$collection = $_saleRule->getResourceCollection()->addFieldToFilter('from_date', array('date' => true, 'to' => $now))->addFieldToFilter('website_ids', array('finset' => $websiteId))->addFieldToFilter('customer_group_ids', array('finset' => $custGroup))->addFieldToFilter('is_rss', 1)->addFieldToFilter('is_active', 1)->setOrder('from_date', 'desc');
$collection->getSelect()->where('to_date is null or to_date>=?', $now);
$collection->load();
$url = AO::getUrl('');
foreach ($collection as $sr) {
$description = '<table><tr>' . '<td style="text-decoration:none;">' . $sr->getDescription() . '<br/>Discount Start Date: ' . $this->formatDate($sr->getFromDate(), 'medium') . ($sr->getToDate() ? '<br/>Discount End Date: ' . $this->formatDate($sr->getToDate(), 'medium') : '') . ($sr->getCouponCode() ? '<br/> Coupon Code: ' . $sr->getCouponCode() . '' : '') . '</td>' . '</tr></table>';
$data = array('title' => $sr->getName(), 'description' => $description, 'link' => $url);
$rssObj->_addEntry($data);
}
return $rssObj->createRssXml();
}
示例4: _toHtml
protected function _toHtml()
{
$descrpt = AO::helper('core')->urlDecode($this->getRequest()->getParam('data'));
$data = explode(',', $descrpt);
$cid = (int) $data[0];
$rssObj = AO::getModel('rss/rss');
if ($cid) {
$customer = AO::getModel('customer/customer')->load($cid);
if ($customer && $customer->getId()) {
$wishlist = AO::getModel('wishlist/wishlist')->loadByCustomer($customer, true);
$newurl = AO::getUrl('wishlist/shared/index', array('code' => $wishlist->getSharingCode()));
$title = AO::helper('rss')->__('%s\'s Wishlist', $customer->getName());
$lang = AO::getStoreConfig('general/locale/code');
$data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8', 'language' => $lang);
$rssObj->_addHeader($data);
$collection = $wishlist->getProductCollection()->addAttributeToSelect('url_key')->addAttributeToSelect('name')->addAttributeToSelect('price')->addAttributeToSelect('thumbnail')->addAttributeToFilter('store_id', array('in' => $wishlist->getSharedStoreIds()))->load();
$product = AO::getModel('catalog/product');
foreach ($collection as $item) {
$product->unsetData()->load($item->getProductId());
$description = '<table><tr>' . '<td><a href="' . $item->getProductUrl() . '"><img src="' . $this->helper('catalog/image')->init($item, 'thumbnail')->resize(75, 75) . '" border="0" align="left" height="75" width="75"></a></td>' . '<td style="text-decoration:none;">' . $product->getDescription() . '<p> Price:' . AO::helper('core')->currency($product->getPrice()) . ($product->getPrice() != $product->getFinalPrice() ? ' Special Price:' . AO::helper('core')->currency($product->getFinalPrice()) : '') . ($item->getDescription() && $item->getDescription() != AO::helper('wishlist')->defaultCommentString() ? '<p>Comment: ' . $item->getDescription() . '<p>' : '') . '</td>' . '</tr></table>';
$data = array('title' => $product->getName(), 'link' => $product->getProductUrl(), 'description' => $description);
$rssObj->_addEntry($data);
}
}
} else {
$data = array('title' => AO::helper('rss')->__('Cannot retrieve the wishlist'), 'description' => AO::helper('rss')->__('Cannot retrieve the wishlist'), 'link' => AO::getUrl(), 'charset' => 'UTF-8');
$rssObj->_addHeader($data);
}
return $rssObj->createRssXml();
}
示例5: _toHtml
protected function _toHtml()
{
$rssObj = AO::getModel('rss/rss');
$order = AO::registry('current_order');
$title = AO::helper('rss')->__('Order # %s Notification(s)', $order->getIncrementId());
$newurl = AO::getUrl('sales/order/view', array('order_id' => $order->getId()));
$data = array('title' => $title, 'description' => $title, 'link' => $newurl, 'charset' => 'UTF-8');
$rssObj->_addHeader($data);
$resourceModel = AO::getResourceModel('rss/order');
$results = $resourceModel->getAllCommentCollection($order->getId());
$entityTypes = $resourceModel->getEntityTypeIdsToTypes();
$incrementIds = $resourceModel->getEntityIdsToIncrementIds();
if ($results) {
foreach ($results as $result) {
$urlAppend = 'view';
$type = $entityTypes[$result['entity_type_id']];
if ($type && $type != 'order') {
$urlAppend = $type;
}
$title = AO::helper('rss')->__('Details for %s #%s', ucwords($type), $incrementIds[$result['parent_id']]);
$description = '<p>' . AO::helper('rss')->__('Notified Date: %s<br/>', $this->formatDate($result['created_at'])) . AO::helper('rss')->__('Comment: %s<br/>', $result['comment']) . '</p>';
$url = AO::getUrl('sales/order/' . $urlAppend, array('order_id' => $order->getId()));
$data = array('title' => $title, 'link' => $url, 'description' => $description);
$rssObj->_addEntry($data);
}
}
$title = AO::helper('rss')->__('Order #%s created at %s', $order->getIncrementId(), $this->formatDate($order->getCreatedAt()));
$url = AO::getUrl('sales/order/view', array('order_id' => $order->getId()));
$description = '<p>' . AO::helper('rss')->__('Current Status: %s<br/>', $order->getStatusLabel()) . AO::helper('rss')->__('Total: %s<br/>', $order->formatPrice($order->getGrandTotal())) . '</p>';
$data = array('title' => $title, 'link' => $url, 'description' => $description);
$rssObj->_addEntry($data);
return $rssObj->createRssXml();
}
示例6: indexAction
public function indexAction()
{
$this->loadLayout();
$this->getLayout()->getBlock('contactForm')->setFormAction(AO::getUrl('*/*/post'));
$this->_initLayoutMessages('customer/session');
$this->_initLayoutMessages('catalog/session');
$this->renderLayout();
}
示例7: _afterModuleMatch
/**
* checking if we installed or not and doing redirect
*
* @return bool
*/
protected function _afterModuleMatch()
{
if (!AO::isInstalled()) {
AO::app()->getFrontController()->getResponse()->setRedirect(AO::getUrl('install'))->sendResponse();
exit;
}
return true;
}
示例8: postDispatch
/**
* Postdispatch: should set last visited url
*
* @return Mage_Core_Controller_Front_Action
*/
public function postDispatch()
{
parent::postDispatch();
if (!$this->getFlag('', self::FLAG_NO_START_SESSION)) {
AO::getSingleton('core/session')->setLastUrl(AO::getUrl('*/*/*'), array('_current' => true));
}
return $this;
}
示例9: addRssFeed
/**
* Add new rss feed
*
* @param string $url
* @param string $label
* @return Mage_Core_Helper_Abstract
*/
public function addRssFeed($url, $label, $param = array(), $customerGroup = false)
{
$param = array_merge($param, array('sid' => $this->getCurrentStoreId()));
if ($customerGroup) {
$param = array_merge($param, array('cid' => $this->getCurrentCustomerGroupId()));
}
$this->_rssFeeds[] = new Varien_Object(array('url' => AO::getUrl($url, $param), 'label' => $label));
return $this;
}
示例10: getRemoveUrl
/**
* Get url for remove item from filter
*
* @return string
*/
public function getRemoveUrl()
{
$query = array($this->getFilter()->getRequestVar() => $this->getFilter()->getResetValue());
$params = $query;
$params['_current'] = true;
$params['_use_rewrite'] = true;
$params['_query'] = $query;
return AO::getUrl('*/*/*', $params);
}
示例11: indexAction
public function indexAction()
{
$url = AO::getBaseUrl('web') . 'downloader/?return=' . urlencode(AO::getUrl('adminhtml'));
$this->getResponse()->setRedirect($url);
return;
$this->loadLayout();
$this->_setActiveMenu('system/extensions/local');
$this->_addContent($this->getLayout()->createBlock('adminhtml/extensions_local'));
$this->renderLayout();
}
示例12: getTagFeedUrl
public function getTagFeedUrl()
{
$url = '';
if (AO::getStoreConfig('rss/catalog/tag') && $this->_getRequest()->getParam('tagId')) {
$tagModel = AO::getModel('tag/tag')->load($this->_getRequest()->getParam('tagId'));
if ($tagModel && $tagModel->getId()) {
return AO::getUrl('rss/catalog/tag', array('tagName' => $tagModel->getName()));
}
}
return $url;
}
示例13: addReviewItemXmlCallback
public function addReviewItemXmlCallback($args)
{
$rssObj = $args['rssObj'];
$reviewModel = $args['reviewModel'];
$row = $args['row'];
$productUrl = AO::getUrl('catalog/product/view', array('id' => $row['entity_id']));
$reviewUrl = AO::helper('adminhtml')->getUrl('adminhtml/catalog_product_review/edit/', array('id' => $row['review_id'], '_secure' => true, '_nosecret' => true));
$storeName = AO::app()->getStore($row['store_id'])->getName();
$description = '<p>' . $this->__('Product: <a href="%s">%s</a> <br/>', $productUrl, $row['name']) . $this->__('Summary of review: %s <br/>', $row['title']) . $this->__('Review: %s <br/>', $row['detail']) . $this->__('Store: %s <br/>', $storeName) . $this->__('click <a href="%s">here</a> to view the review', $reviewUrl) . '</p>';
$data = array('title' => $this->__('Product: "%s" review By: %s', $row['name'], $row['nickname']), 'link' => 'test', 'description' => $description);
$rssObj->_addEntry($data);
}
示例14: getContinueShoppingUrl
public function getContinueShoppingUrl()
{
$url = $this->getData('continue_shopping_url');
if (is_null($url)) {
$url = AO::getSingleton('checkout/session')->getContinueShoppingUrl(true);
if (!$url) {
$url = AO::getUrl();
}
$this->setData('continue_shopping_url', $url);
}
return $url;
}
示例15: getClearUrl
/**
* Retrieve Clear Filters URL
*
* @return string
*/
public function getClearUrl()
{
$filterState = array();
foreach ($this->getActiveFilters() as $item) {
$filterState[$item->getFilter()->getRequestVar()] = $item->getFilter()->getResetValue();
}
$params = $filterState;
$params['_current'] = true;
$params['_use_rewrite'] = true;
$params['_query'] = $filterState;
return AO::getUrl('*/*/*', $params);
}