<?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. Generic泛型

    1.问题 未使用泛型时,元素的类型不安全:操作麻烦,可能需要强制转换import java.util.ArrayList;import java.util.List;import org.junit. ...

  2. cl.exe

    http://blog.csdn.net/happyanger6/article/details/7589016

  3. BZOJ1722 [Usaco2006 Mar] Milk Team Select 产奶比赛

    直接树形dp就好了恩 令$f[i][j][t]$表示以$i$为根的子树,选出来的点存在$j$对父子关系,$t$表示$i$这个点选或者没选,的最大产奶值 分类讨论自己和儿子分别有没有选,然后转移一下就好 ...

  4. java之代理模式

    静态代理: java代理是一种模式--代理模式.采用代理模式,可以在不改变目标类代码的基础上,通过代理对象,来增加额外的功能(比如增加日志检测等)或者只需要目标对象的部分行为. java中,代理分为静 ...

  5. treap codevs 4543普通平衡树

    #include<cstdio>#include<ctime>#include<cstdlib>struct shu{ int l,r,sum1,zhi,dui,s ...

  6. 利用dispatch_once创建单例

     无论是爱还是恨,你都需要单例.实际上每个iOS或Mac OS应用都至少会有UIApplication或NSApplication. 什么是单例呢?Wikipedia是如此定义的: 在软件工程中,单例 ...

  7. excel的变量

    因需要定制游戏的公式,公式是以一个系数乘以等级,我想达到修改系数,每个等级对应的值就立即显示出来, 但把系数写在一个单元格,一拉,系数单元格也会跟着增长行数--不是我想要的: 但只要把系数单元格改成变 ...

  8. Java中断言的使用(转)

    相信学过c,c++的朋友一定不会对断言感到陌生.下面介绍一下断言在JAVA中的使用,JAVA是从JDK1.4才开始支持断言的(添加了关键字assert),请注意老版的JRE不支持. 断言概述 编写代码 ...

  9. 类成员函数作为pthread_create函数参数

    from:http://www.cnblogs.com/shijingxiang/articles/5389294.html 近日需要将线程池封装成C++类,类名为Threadpool.在类的成员函数 ...

  10. matlab 画框(一)

    matlab进行图像处理之后,很多时候需要在图像上画出矩形框:如,调用matlab的某个检测函数,得到结果之后,往往需要将检测结果的矩形框画在图像上,直观.方便的进行查看:下面的代码就是这个目的: f ...