jQuery函数 - 左右抖动效果,用于提示 13 May 2011 13:50 Friday by 小屋 浏览(589)

Wordpress博客后台登录输入错误的话登录窗口有左右抖动的效果。弄成jQuery函数方便调用(前提已载入jQuery包)

function shake(o){
    var $panel = $("#"+o);
    box_left = ($(window).width() -  $panel.width()) / 2;
    $panel.css({'left': box_left,'position':'absolute'});
    for(var i=1; 4>=i; i++){
        $panel.animate({left:box_left-(40-10*i)},50);

阅读全文>>

Magento错误-Call to undefined method Mage_Adminhtml_Block_Widget::getrowurl() in app\code\core\Mage\Adminhtml\Block\Widget\Grid.php on line 1607 03 January 2011 17:30 Monday by小屋 浏览(1946)

Fatal error: Call to undefined method Mage_Adminhtml_Block_Widget::getrowurl() in [magentohome]/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php on line 1607

从Magento 1.4.0.1导出产品csv文件后,要导入到Magento 1.4.2.0的时候,在上传csv文件,保存提交后报这错误。

解决办法:修改 app/code/core/Mage/Core/Block/Template.php 这个文件,在319行后面加入函数getRowUrl,如:

public function getRowUrl($row)
{
return $this->getUrl(’*/*/edit’, array(’i

阅读全文>>

Magento报错:Call to a member function extend() on a non-object in app\code\core\Mage\Core\Model\Mysql4\Config.php on line 115 28 December 2010 15:03 Tuesday by小屋 浏览(1671)

遇到报错:Fatal error: Call to a member function extend() on a non-object in \app\code\core\Mage\Core\Model\Mysql4\Config.php on line 115

错误原因及解决办法参见:

Magento错误 - Notice: Undefined index:***app\code\core\Mage\Core\Model\Mysql4\Config.php on line 92的解决办法

里的

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_CHEC

阅读全文>>

Magento Paypal支付接口无法传递运费 22 December 2010 15:29 Wednesday by小屋 浏览(1652)

尽管Magento1.5已经出来了。。但现在大部分站还是继续1.4.0.1的。

Magento官方也公布了这个版本的多个 BUG,其中一个是Magento1.4.0.1使用Paypal支付接口 的时候,如果客户先注册再放入购物车结算, 一切正常。 如果游客身份先放入购物车,然后再注册,去结算,就会在支付的时候 少算运费,后台的一切数值都正常,都是带运费的。但是就是Paypal收到的是不带运费的。

对着BUG修复文档处理了一下,问题可以解决。 记录一下。。

app/code/core/Mage/Paypal/Helper/Data.php

         $shippingDescription = '';
-        if ($salesEntity instanceof Mage_Sales_Model_Order) {
-            $discountAmount = abs(1 * $salesEntity->getBaseDiscountAmount());
-            $shippingDescription = $salesEntity->getShippingDescription();
-            $totals = array(
-                'subtotal' => $salesEntity->getBaseSubtotal() - $discountAmount,
-                'tax'      => $salesEntity->getBaseTaxAmount(),

阅读全文>>

又一枚iframe高度自适应代码 - (兼容FF,Opera,Safari多浏览器) 05 October 2010 15:38 Tuesday by小屋 浏览(1469)

  1. <script type="text/javascript">
  2. function  SetCwinHeight(iframeObj){  
  3. if  (document.getElementById){   
  4.    if  (iframeObj){  
  5.      if  (iframeObj.contentDocument && iframeObj.contentDocument.body.offsetHeight){  
  6.       iframeObj.height = iframeObj.contentDocument.body.offsetHeight;  
  7.       }  else   if  (document.frames[iframeObj.name].document && document.frames
  8. [iframeObj.name].document.body.scrollHeight){  iframeObj.height = document.frames
  9. [iframeObj.name].docum

阅读全文>>