<?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. 快速将excel数据保存到Oracle数据库中【转】

    我们在工作中,也许会碰到以下情况,客户或者同事发来需要调查的数据,并不是dmp文件,而是excel文件,此时通常是一张表,少量几条记录.最近我恰好碰到了这种情况,所以做了些调查,不敢藏私,拿出来跟大家 ...

  2. [整理]Svn常见问题汇总。

    1.’.’ is not a working copy.Can’t open file‘.svn/entries’: 系统找不到指定的路径. 解答:原因是输入的访问路径不正确,如svn://192.1 ...

  3. [转]C# 应用程序安装部署步骤,安装前操作,先退出程序后卸载。

    1. 点击[文件]-[新建]-[项目]-其他项目类型-安装和部署,选择安装项目,在下面的名称栏填写SetupTest(或者选择安装向导,一直点击[下一步])2. 安装项目----六个子项依次为:文件系 ...

  4. POJ 3687 逆序拓扑

    额.题目大意:有N个球.编号和重量都是唯一不重复的.然后.给你m个pair a和b,表示编号为a的点一定比编号为b的点轻.然后捏.输出每个点对应的重量.关键是要求.如果有多种可能性的话,输出让序号小的 ...

  5. 作用域闭包、预解释和this关键字综合题目

    var number = 2; var obj = {number : 5, fn1 : ( function() { this.number *= 2; number=number*2; var n ...

  6. UVa 10870 - Recurrences

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...

  7. CSU 1111 D(Contest #3)

              有三户人家共拥有一座花园,每户人家的太太均需帮忙整理花园.A 太太工作了5 天,B 太太则工作了4 天,才将花园整理完毕.C 太太因为正身怀六甲无法加入她们的行列,便出了90元.请 ...

  8. ClassLoader相关内容

    1.什么叫做bootstrap?作为形容词有依靠自己力量的:自己做的等意思,在我们计算机世界里,一般指的是自举,引导,引导程序. 那什么是bootstrapClassLoader呢?它是引导加载器,也 ...

  9. JSON.parse()和eval()区别

    JSON.parse()只会将标准的Json字符串(key和value都由双引号引起来,最外面用单引号括住)转为JSON对象. eval()在转换字符串的时候是比较松的,即使不是标准的Json字符串也 ...

  10. Linux下screen命令

    //1.列出当前的screenscreen -ls //2.新建一个screen,直接在命令行键入screen命令 screen -S [会话名称][root@www.lnuxidc.com ~]# ...