<?php echo $this->getStoreUrl('checkout/cart');?>

获取结账页面的url:<?php echo $this->getUrl('checkout/cart');?>

magento的常用函数:

    1. //Get the path of your magento page.
    2. echo $this->getUrl('mypage');
    3. //Get the path of the image in your skin folder.
    4. echo $this->getSkinUrl('images/yourimage.gif');
    5. //Get the product link.
    6. echo $this->getProductData()->getProductUrl();
    7. //Get the product name.
    8. echo $this->htmlEscape($this->getProductData()->getName());
    9. //Call a static block in .phtml file.
    10. echo $this->getLayout()->createBlock('cms/block')->setBlockId('YOURBLOCKID')->toHtml();
    11. //Get Image url of current category.
    12. echo $this->getCurrentCategory()->getImageUrl();
    13. //Check whether the current category is Top category.
    14. echo $this->IsTopCategory();
    15. //Get description of current category.
    16. echo $this->getCurrentCategory()->getDescription();
    17. //Display products list page (list.phtml).
    18. echo $this->getProductListHtml();
    19. //Display CMS block page.
    20. echo $this->getCmsBlockHtml();
    21. //Get current store id.
    22. echo $storeId = Mage::app()->getStore()->getId();
    23. //Get current store name.
    24. echo $storeName = Mage::app()->getStore()->getName();
    25. //Get current store code.
    26. echo $storeCode = Mage::app()->getStore()->getCode();
    27. //Get website name.
    28. echo $websiteName = Mage::app()->getWebsite()->getName();
    29. //Get session id.
    30. echo $sessionId = Mage::getModel('core/session')->getSessionId();
    31. //Get customer id.
    32. echo $customerId = Mage::getModel('customer/session')->getCustomerId();
    33. //Get guest id.
    34. echo $vistitorId = Mage::getModel('core/session')->getVisitorId();
    35. Mage::getSingleton('customer/session')->isLoggedIn();
    36. Mage::getModel('coredate')-timestamp(time());
    37. //get Parent's Ids
    38. Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild( $childid );
    39. // 返回Ip地址的字符串格式:127.0.0.1
    40. echo Mage::helper('core/http')->getRemoteAddr();
    41. // 返回Ip地址的数值格式:2130706433
    42. echo Mage::helper('core/http')->getRemoteAddr(true);

magento获取页面url的办法还有magento的常用函数的更多相关文章

  1. js获取页面url的方法

    我们可以用javascript获得其中的各个部分 1, window.location.href 整个URl字符串(在浏览器中就是完整的地址栏) 本例返回值: http://ifisker.com/b ...

  2. js获取页面url中的各项值

    一. 通过window.location获取各项参数 1.获取页面完整的url url = window.location.href; 2.获取页面的域名 host = window.location ...

  3. Javascrip获取页面URL信息

    使用Javascript可以方便获得页面的参数信息,常用的几种如下: 设置或获取对象指定的文件名或路径 window.location.pathname   设置或获取整个 URL 为字符串 wind ...

  4. JS获取页面URL信息

    下面我们举例一个URL,然后获得它的各个组成部分: http://i.cnblogs.com/EditPosts.aspx?opt=1 window.location.href (设置或获取整个 UR ...

  5. 获取页面URL两种方式

    以请求http://localhost:8080/doctor/demo?code=1为例 一:用java代码获取 //获取URL中的请求参数.即?后的条件 code=1 String querySt ...

  6. js获取页面url

    设置或获取对象指定的文件名或路径. window.location.pathname例:http://localhost:8086/topic/index?topicId=361alert(windo ...

  7. jq获取页面url后边带的参数

    //获取url后边的参数 $.getUrlParam = function (name) {                  var reg = new RegExp("(^|&) ...

  8. 获取页面url信息

    方法: window.location.href = prefixURL+'webstatic/messageAnalysis/datadetail.html?id=' + num + "& ...

  9. 通过window.location.search获取页面url传递的参数

    function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&] ...

随机推荐

  1. Bag of mice(CodeForces 148D )

    D. Bag of mice time limit per test 2 seconds memory limit per test 256 megabytes input standard inpu ...

  2. BZOJ2708 [Violet 1]木偶

    首先想到的是贪心...肯定不对嘛...T T 然后发现其实是可以DP的...不过我们要先排序 令f[i]表示前i个木偶最坏要丢掉几个,则 f[i] = max(f[j] + calc(j + 1, i ...

  3. POJ 3660

    233333... Description: 就是说呢.牛是的实力室友大小之分的.然后呢.告诉你很多pair 表示任意两头牛之间的实力大小.按实力排序之后.问你一共有多少只牛的排名是确定了的. T_T ...

  4. SendMessage函数的常用消息及其应用大全

    来源:http://www.360doc.com/content/09/0814/10/19147_4907488.shtml,非常全面的解释. 文本框控件通常用于输入和编辑文字.它属于标准 Wind ...

  5. 绑定本地Service并与之通信-----之一

    import android.app.Service;import android.content.Intent;import android.os.Binder;import android.os. ...

  6. GFS: Evolution on Fast-forward

    GFS: Evolution on Fast-forward by Marshall Kirk McKusick, Sean Quinlan | August 7, 2009 A discussion ...

  7. InLineHookSSDT

    //当Ring3调用OpenProcess //1从自己的模块(.exe)的导入表中取值 //2Ntdll.dll模块的导出表中执行ZwOpenProcess(取索引 进入Ring0层) //3进入R ...

  8. 小记:利用递归调用循环寻找MP3文件的方法。

    private void findMp3Data(File mp3file) { File[] filelist = mp3file.listFiles(); if (filelist != null ...

  9. 知名杀毒软件Mcafee(麦咖啡)个人版 资源汇总兼科普(来自卡饭)

    虽然早已不是用咖啡了,但我也实时关注的咖啡的一举一动,潜水看帖日久,发现小白众多,好多有价值的帖子淹没于帖海当中,甚是惋惜.     我有如下建议      1.咖啡区管理层,能否吧一些优秀的资源教程 ...

  10. Phonegap hello world 不容易啊~!

    今天一个项目要用phonegap,当初就是觉得phonegap配置太tmd的麻烦了,所以转头appcan,但今天项目必须用-- 先是看到官方说用nodejs装,tmd的,总是重复同一个错误,安装不起, ...