International e commerce development company

Maishen technologies

Welcome visitor! You canlogin orcreate an account.

Hot Line:+86-0532-58973093

麦神电子商务
Myod Technologies

Official Certified Developer

在支付页面把单选框改为下拉菜单

Thursday, February 28, 2013 10:11:30 AM Asia/Shanghai

在支付页面把单选框改为下拉菜单样式

Read More
0 Comments | Posted in magneto学习 By lei sheng

搜索框与浏览器兼容性

Wednesday, January 23, 2013 4:07:21 PM Asia/Shanghai

今天发现了一个关于IE浏览器的问题。测试发现搜索框在输入关键字之后,按回车键,Firefox, Chrome, Opera均会提交表单并跳转,但IE并不跳转,需要手动单击搜索按钮,因此添加了如下代码于productsearch/form.mini.phtml文件。

...
<input id="search" type="text"  ...  onkeyup="javascript:enterHandle(event.keyCode);" type="text" />
...
<script type="text/javascript">
function enterHandle(keyCode){
    if(window.ActiveXObject){
        if (keyCode == 13) {
            searchsubmit();
        }
    }
}
function searchsubmit(){
    ...
    if(window.ActiveXObject)
        document.location.href=actions;
    jQuery('#search_mini_form').attr('action',actions);
    this.form.submit();
}

首先对文本框加入事件侦听(down, press, up都可以),然后如果按下回车键(ASCII CR 13),则调用提交方法。由于我们只针对IE浏览器,所以加了一个类似XMLHttpRequest的判断window.ActiveXObject。在提交的时候,我挑选了一个比较便捷的方法——修改URL,但修改URL貌似会是Chrome, Opera浏览器失效,所以果断又加了一次判断。

最后,友情提供一个比较少用,但我个人比较喜欢的标签,<pre>预处理标签,用来输出代码很好用哦,详情参见本博文中的代码段。

0 Comments | Posted in magneto学习 By lei sheng

cms page 调用自建模板

Friday, January 18, 2013 3:59:23 PM Asia/Shanghai

对于后台中的CMS(Content Management System, 网站内容管理系统)建立的page,是存储在数据库的,那么,如果要在这样的页面中使用PHP代码,也就是说,需要使用<?php  ?>标签对,直接在content书写代码是无法实现的。

我们可以创建模板.phtml文件,保存在base/default/template文件夹下的某个位置(建议由自己新建目录),然后在后台CMS_PAGE页面中,建立静态页。在design选项卡中填写XML格式的布局内容,以调用我们所创建的模板文件。以此方法,我们也可以创建不同主题的页面,即在Custom Design中填写限时使用的布局。

注意:CMS_PAGE中所读取的模板是从base/default/template读取的,而不是从其他包中,同时也会加重万恶的数据库负担,所以不建议用这种方法大量创建页面。

0 Comments | Posted in magneto学习 By lei sheng

进入数据库,执行如下代码

SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;

0 Comments | Posted in magneto学习 By lei sheng

在支付页面的底部的订单详情中添加产品图片

Friday, June 22, 2012 9:09:28 AM Asia/Shanghai

magento的订单页面的最后一步,显示的订单的详情,只显示了产品名字,价格,等3-4个选项,现在我们希望把产品图片显示出来!

步骤如下:

1.

frontend/{your_theme}/decault/template/checkout/onepage/review/info.phtml

找到代码

 <table class="data-table" id="checkout-review-table">
   
<?php if ($this->helper('tax')->displayCartBothPrices()): $colspan = $rowspan = 2; else: $colspan = $rowspan = 1; endif; ?>
   
<col />
   
<col width="1" />
   
<col width="1" />
   
<col width="1" />
   
<col width="1" /> <
加入一个新行
2.
下面加入产品图片的列
  <thead>
       
<tr>
            <th rowspan="
<?php echo $rowspan ?>">&nbsp;</th> <!-- Here's the empty col for the image -->
            <th rowspan="
<?php echo $rowspan ?>"><?php echo $this->__('Product Name') ?></th>
            <th colspan="
<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Price') ?></th>
3
frontend/{your_theme}/decault/template/checkout/onepage/review/item.phtml

<?php $_item = $this->getItem()?>
<tr>
    <!-- Product Image Here -->
    <td><img src="<?php echo $this->getProductThumbnail()->resize(75); ?>" width="75" height="75" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /
></td>
   
<td><h3 class="product-name"><?php echo $this->htmlEscape($this->getProductName()) ?></h3>
加到想要显示的地方就可以了!!
然后在支付页面的底部的订单详情中就会显示出来产品图片!
0 Comments | Posted in magneto学习 By terry water
 
  • Mygod Technologies
  • A3001 Qingdao Center,
  • Qingdao, CHINA, 266000,
  • + 86 0532-5897-3093

Subscribe

We will respect your privacy.

Follow Us

2018 Mygod Technologies. All rights reserved. Privacy Policy