Shopify Product.Gift_Card attribute boolean check

Tonight being bothered by a Shopify attribute weird syntax.

Having a Gift Card product page, I want to show different UI vs normal product. I user product.gift_card and try to obtain the boolean value for the different UI. But I keep receive nothing.

Normally I try look up the product.json by adding .js at the end of the product URL. And I find there isn’t.

I have use line_item.gift_card for similar purpose, which give me expected value, so I am surprised I cannot get the expected value upon calling product.gift_card.

I connect with Shopify Plus support, and they typically say it should be my theme related rather than any regression in the system. Fair-enough~

Until a moment, I spot the product.gift_card in the developer doc has a Questionmark, i.e. product.gift_card? where that questionmark sounds to me to be a typo. But honestly not! It is the killer character that cause me fail to get the expected boolean. I cannot find another attribute has such un-usual suffix character. And I hope you didn’t struggle too long like me.

Related links:

https://shopify.dev/api/liquid/objects/product#product-gift_card
https://shopify.dev/api/liquid/objects/line_item#line_item-gift_card

看「民王」的共鳴感

Tamiou

這是一齣你可以當政治片來看時,他是一齣無里頭笑片;
當你當他是無里頭笑片來看時,他瞬時道出滿帶義理的政治論說。
當領導不再是領導本身,身份被人替換了,這會是一個什麼境況?這就是編劇想營造的一個局面,將一個對政治不敏感的個體,與在政壇上滿有抱負的新上任總理之身份對調,從對調過程中娓娓道出領導者應有的角色責任。

從第一集起,一句典型的「我跟你不一樣」帶出總理跟其兒子之間的矛盾。兒子離家凄身一間將近倒閉的民間食店埋首其自身興趣,遠離身為一國之首的父親。但暗黑勢力將他們身份對調使,讓一個不黯政事的兒子當上了政壇領導。正因著這樣的經歷,兒子領會到父親在政壇上面對的各種難題。然而對比父親的強硬政治野心,在忠心耿耿的助手幫協助之下,父親以為能讓兒子替代自己來執行自己的政事險境之時,兒子卻以自己的心態,以另一種總理意料之外的方式將種種險境化解。

說實,故事路線是大路的。你大概猜想得到總理作為父親由兒子角度出發,兒子又體會父親更多而冰釋前嫌。然後廿土木山調魔咒化解,得出大團圓結局。這些,留待大家細看。然而我欣賞這套電視劇,要拍案叫絕的位置,隨了每集在兒子身上的總理,於不同場合爆Seed位,還有演員的演技。

單看宣傳圖像,遠藤憲一是個「鱷魚面」的老練政客款。要是這是政治片,這個嘴面最切合不過。然而這故事要他扮演廿多歲的爛泥青年,既怯懦又行為閃縮,這綠葉派的演技讓人絕大部份時間都代入了其替掉的身份。實在,單看他不斷扮演「怯懦閃縮」與「政壇霸者」這兩種身份的交替經已劇集的精華。相對地,菅田將暉要由廢青扮演成政壇老手的能力相對較易,而難度在於他如何「繼承」父親說話的霸氣。

故事討論過金融體系與中小企業作為經濟重振中該扮演的位置;替單親母親道出在職場上面對的處境及至作為公司領導者應如對待下屬員工這份最重要的資產這經營之道;在上市公司為盈利遺忘初衷時論及企業理念和個人志向;與及總理與國會在民生方面應負擔的責任。這些命題,不單發生在日本,在香港也是適用。這亦是我一直看著一直響出共鳴感。(待續)

Happy New Year @ 2012

Happy New Year @ 2012

It is a difficult year, no matter to the world or to me. There are too many disasters, the financial crisis, making lots of people die or poor. And for my job, we finally make out company site launch. We got too many to work out in order to meet numerous deadline: Launch date, pre-sale, etc. But no matter what, this 2012 I am preparing for my new era. I hope to work our our future with my love. And I wish I can share my skills to help more people to work out more great sites.

Wish you all best in 2012!

IE6 Countdown

http://ie6countdown.com/

It is too good to hear news from Microsoft take the active step in enforcing the development of web by putting off IE6. For normal web surfer they may not know why having such act, but for web developer it is really a gospel. IE6 brings us a lot of hard time during web development due to its non-web standard interpretation of web page, pool JavaScript engine, lack for developer-friendly debugging tools and poor handling for image, CSS.

Having IE6 to share smaller portion of the web market help business decision-maker no longer thinking ‘we should support IE6 for our company’ web page meanwhile aim at applying fancy effect to their website while IE can hardly run them perfect.

Well, it is actually not only IE6, but some other browser which also not following web standard for web page rendering should also be put off from the market gradually in he future. So that let more fancy web effects to be executed on best performing browsers.

 

 

牛刀小試 iPhone Obj-C programming

從聽聞寫 iPhone app 來賺錢有可為之後,便期待盡可能找來一台 Mac 機開展 iPhone app 的開發之路。然而,一台 Mac 機的價值不斐,直到轉了新工作,因應工作需要,被賞賜了一台 MacBook Pro,並且得到允許,借回家使用。

星期天花了大半天,在網上網羅了許多不同的教學文件、免費電子書,圖文並茂,有一點眼花瞭亂。幸好自問還算有點編程底子,看著看著把以往編程的概念轉個角度看看、想想,還算能應付理解。

手上第一個 iPhone App 並不是由零開始編寫,而是由外判公司為公司所製作的 iPhone prototype 副本,嘗試進行些小改和 bug fixing。藉這一過程,初嘗了使用 XCode,改動 Objective C 的程式碼、編譯和運行 iPhone Simulator。當看到程式被我改動後仍然「生還」,在simulator中呈現,心底無限亢奮。

當然,這一編程路的故事只是開始。對 Obj C 的認知仍然只屬皮毛。這一初試其實還得感謝一位同事的一些起始指導,還有上司提供機會讓我去作出這一嘗試。真的希望一天不只有二十四小時,能給我多點時間和精神,讓我鑽研這一技能多好呢~

網上有一個港人的網誌有一些其開發 iPhone app 的分享,是一個對 iPhone App 編程有好奇的人來說一份不錯的起始指導:http://eddyl.com/blog/

An evolution of Gordon Chan

How often do you concern about your name or brand nam ethat you own? Have you ever check your name in some search engine so as to know who call the same?

Just a search with a keyword “Gordon Chan”, a name that followed me at least 15 years from my primary school, is not that simple:

  • Gordon Chan is a famious Hong Kong film director, 陳嘉上
  • Gordon Chan is a real estate agent in Canada
  • Gordon Chan is an academic staff/doctor/PhD belong to the department of oncology in the University of Alberta in Canada
  • Gordon Chan is the Principal of FCGA in Canada
  • Gordon Chan is also an artistic hair designer, etc.

Wow, and now, I would like to introduce myself into the world of Gordon Chan:
Gordon Chan is a Web Developer who keen on exploring the possibility of web authoring with passion on making the world of website to be better suit for various clients and visitors’ need.

For the last 12 years, I start building website using FrontPage Express, FrontPage, and later on using Adobe Dreamweaver, or even just Notepad2 for web authoring, I can see how the world of web development change. I cannot say I can bring any new technology advance, I can at least make use of new techniques with standard code style so as to make good works and let visitors to have fun in my works. And now it comes to the time that I start using my name as the brand for my works, and hope in the up-coming future people will know more about me, not a film director/doctor/agent or designer, but a specialist, web developer.

Welcome to GC Log

Keep opening and closing numerious blog, starting from today, with lots of work done just for rebuilding the status of mine in the Internet. GC Log, the log of Gordon Chan, I wish to keep my sharing, my learning and knowledge here. I will try to post back some useful blog that I wrote in the past.

Currently besides this new blog, I have 2 ancient blogs that did not update for long time but they worth to be kept forever providing some necessary information:

Gordon @ Kr : http://kr.snap-ustar.net
T-Log : http://snap-ustar.net/blog/
(I disconnect my snap-ustar.net / snap-f.net domain, from now on, gordon-chan.net )

And please don’t forget my personal webpage: http://gordon-chan.net

You may access my personal webpage through http://gordon-chan.info and http://snap-ustar.net