<?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. vs版本与.net framework 版本对应

    vs2002  .net framework 1.0 vs2003 版本号:7.x  .net framework 1.1   window server 2003 vs2005 版本号:8.x  . ...

  2. JSP中,当页面为404或者500时。设置跳转到错误提示页面

    最好的就是在WEB.XML文件中配置错误代码的跳转页面,首先建立个 出现500错误的页面,提示出错了,然后再WEB.XML文件中配置,配置如下 一. 通过错误码来配置error-page <er ...

  3. Android Fragment完全解析,关于碎片你所需知道的一切 (转)。

    我们都知道,Android上的界面展示都是通过Activity实现的,Activity实在是太常用了,我相信大家都已经非常熟悉了,这里就不再赘述. 但是Activity也有它的局限性,同样的界面在手机 ...

  4. Oracle练习题20~33

    20.查询score中选学多门课程的同学中分数为非最高分成绩的记录. 21. 查询成绩高于学号为“109”.课程号为“3-105”的成绩的所有记录. 22.查询和学号为108的同学同年出生的所有学生的 ...

  5. 采用EntLib5.0(Unity+Interception+Caching)实现项目中可用的Caching机制

    看了园子里很多介绍Caching的文章,多数都只介绍基本机制,对于Cache更新和依赖部分,更是只简单的实现ICacheItemRefreshAction接口,这在实际项目中是远远不够的.实际项目中, ...

  6. "琳琅满屋"调查问卷 心得体会及结果分析

    ·关于心得体会       当时小组提出这个校园二手交易市场的时候,就确定了对象范围,仅仅是面向在校大学生,而且在我们之前就已经有了很多成功的商品交易的例子可以让我们去借鉴,再加上我们或多或少的有过网 ...

  7. ios 常用的小框架

    在ios开发中,一些请求 kvc 下拉列表  图片请求等等自己手写代码的话非常麻烦,还容易出现一系列的问题,现在整理了一些常用的一些小框架. 其中MJExtension 和 MJRefresh 这两个 ...

  8. Flux Demo解析

    最近学习了阮一峰老师的博文 "Flux入门教程",博文中详细介绍了Flux框架和Controller view模式,并提供了Demo,受益匪浅. 现特参考阮老师的Demo,绘制了一 ...

  9. 《day18_String练习_基本类型包装类_集合入门》

    package cn.itcast.api.String.test; public class StringTest_1 { public static void main(String[] args ...

  10. hdu4283 区间dp

    //Accepted 300 KB 0 ms //区间dp //dp[i][j] 表示i到j第一个出场的最小diaosizhi //对于i到j考虑元素i //(1)i第一个出场,diaosizhi为 ...