Damn phishing






“You ordered a brand new phone in a year’s time, right?”

我这时不能确定它的意图,可能是手机公司要给我 upgrade,那就继续听下去。我还是说:



“Can you confirm your name?”


“Why do I need to confirm my name?”


“Because I want to verify your name.”


“Why do you want to verify my name?”


Reinstate Magento order status after upgrade

Recently I upgraded a Magento store from to

Magento has changed order tables from key-value type to flat structure in, which caused a big problem for my upgrade – all orders lost their status and state value.

I have not discovered what exact reason made it happen, but I know it is my store specific, because I have other stores successfully upgraded from 1.3 to without any problems.

Just in case you had the same issue, you can run this mysql query code to reinstate Magento order status(and state as well).

UPDATE magento_sales_flat_order AS o
INNER JOIN (SELECT s1.parent_id, s1.status, c.state
 FROM magento_sales_flat_order_status_history s1
 SELECT parent_id, MAX(entity_id) AS entity_id
 FROM magento_sales_flat_order_status_history
 GROUP BY parent_id) AS s2
 ON s1.parent_id = s2.parent_id AND s1.entity_id = s2.entity_id
 LEFT JOIN magento_sales_order_status_state AS c
 ON s1.status = c.status
) as s3
ON o.entity_id = s3.parent_id, magento_sales_flat_order_grid AS g
SET o.status = s3.status, o.state = s3.state, g.status = s3.status
WHERE g.entity_id = s3.parent_id;





Activate Magento ajax loading graphic using jQuery

I extend Magento js using jQuery.
I need ajax loading mask and grahpic for jQuery ajax request.
I want to achieve consistent look and feel.
I want to activate Magento ajax loading graphic initially used in prototype using jQuery.

Although prototype register global event handlers for ajax create and complete events, the handlers will not fire by jQuery ajax request. For jQuery to activate ajax loading graphic, I manually fire the onCreate event in jQuery function.

var r = {options:{loadArea:''}};

to deactivate


Let me know if you know a better way to tie jQuery and prototype together.

Magento Cush module is about to release

Long long time ago, I installed Customshippingrate module, but never made it work on my site. The module sits on the disk but disabled. Recently I took some trouble and about three days developing my own module Cush for admin panel users to charge special shipping price when creating an order.

Cush module does not override any Magento classes so it is virtually 100% compatible with other modules. Neither does Cush module override any Magento templates so basically it reuses Magento native interface. Cush is not a shipping method so it can work with any Magento shipping methods or 3rd party shipping methods.

Cush module injects customisation logic by javascript. What it actually customise are values in magento_sales_flat_quote_shipping_rate where is pool of shipping quotes. Values customised belong to an individual quote so the customisation hits its point.

When writing Cush module, I found a defect in Magento own code app/design/adminhtml/default/default/template/sales/order/create/shipping/method/form.phtml.

echo $this->getCarrierName($_rate->getCarrier());

The above code reads value from configuration and shows it as carrier title. If I was not injecting shipping method customisation logic, I would not realise it is a defect. Carrier title value, like method title and shipping rate, if read from magento_sales_flat_quote_shipping_rate using $_rate->getCarrierTitle(), will make more sense. Values from configuration will not reflect carrier title changes done by Cush. I respect Magento own templates, especially adminhtml templates. Instead of overriding this template, I wrote some additional javascript in Cush module to correct carrier title. I stick to my green principle although it costs much more time developing.

Upon installing Cush module, I removed all files of Customshippingrate module. A small accident happened – can not create shipment. It turns out during creating shipment, Magento is gathering all config paths start with “carriers/” and working out all carriers between two slashes. It is a bad logic, or I can call it a bug. It does not check whether this carrier exists or is active. So, very bad.

Just add to my Magento caveats: after removing a shipping method, remove all entries of “carriers/CARRIER_CODE/*” in magento_core_config_data.

Godaddy 25% off promo code


At GoDaddy, I can use gdd5013g for 25% off any order above $75.

25% off godaddy orders

25% off godaddy orders

I just want to make a note here for myself instead of every time googling for a code.

Let me know if you know a code for 30%, 35%, … off or even more. My orders are normally above $100 or I can put orders together to be qualified for higher discounts.

欧陆制袋 = Euro Bags

已经不止一次惊奇于 Google 的聪明了。

今天无意中在 Google Translate 中输入申通快递,竟然翻出了 STO。

然后我再想惊喜一下,输入欧陆制袋,很遗憾,没看到 Euro Bags,看到的是 Continental Bag。又试了一下逆向翻译,输入 Euro Bags,看到的是欧元袋。

什么时候能让 Google 认识到 欧陆制袋 就是 Euro Bags 呢?