Posts

Woocommerce how to get order status?

If you are writing plugin (like me) under Woocommerce 2.0 to get a list of order of particular order status, you will find that it does not exists in wp_posts and wp_postmeta. Simply put: All order status strings (e.g. completed, failed, on-hold etc) are stored in wp_terms Using wp_terms.term_id, you can find your order ID in wp_term_relationships.  In this table, order ID is called "object_id" You can now do a search on wp_posts using wp_term_relationships.object_id (wp_term_relationships.object_id is now post_id) You don't need to write SQL to do the above 3 steps, Wordpress has already provided similar functions to do this.  They are  get_term_by and get_objects_in_term .  Sample code below: $status = get_term_by( 'slug', sanitize_title( $_POST['order_status'] ), 'shop_order_status' ); $s = get_objects_in_term($status->term_id, 'shop_order_status'); var_dump($s); It will return order IDs in array, like: array ...

MaryEllen Tribby 10 Keys To A Great Offer

Some notes from this podcast in ILoveMarketing.com .  The 10 keys to a GREAT OFFER by MaryEllen Tribby : Ask yourself, is your offer: Specific Exclusive Valuable Unique Useful Relevant Possible Easy to acquire Urgent Guarantee If your offer matches all 10 keys here, you have a great offer. Always write your copy first, write all your ideas down, and create your product.

[Repost] The PCAT Formula for Helping People Make Changes with Hypnosis

Source:  http://conversational-hypnosis.com/articles/a69.html Conversational Hypnosis is an art for helping others to live happier, healthier and overall better lives.  One of the tools that you can use to help people to do this is called the PCAT Formula.  The PCAT Formula is a simple formula that you can use in any conversation to assist in making a change in the person you are talking to.  It is used for many different reasons but the base of those reasons is to overcome a hard time, or get past a hurdle in their lives. One of the most convenient aspects of the PCAT Formula is that it can be used in almost any conversation.  It is very simple to transition from a normal everyday conversation into the PCAT Formula.  This is helpful in that many times in normal everyday conversations you will be talking to a friend, client or family member and they will automatically tell you about what it is that is limiting them in their lives and then you can go to...

Application Loader doesn't let me choose my app to upload??

My config: XCode Version 4.6 (4H127) Mac OSX: 10.7.5 (Lion) GameSalad: 0.10.2 If you found that, you cannot select your exported app and upload it using Application Uploader, here is the trick: When you export, it should probably be a gray "ban" icon that cannot be opened.   You just need to zip it and make your app a ZIP file, and you upload that zip file in Application Uploader, and you should be fine. Don't complicate things: Right click the gray app icon and click "Compress <your_app_file>".  That's it! Then you upload the zip file instead of the app file.

Wordpress Custom Post Type created post not found?

If you use custom_post_type in wordpress, and you find that you can successfully create a custom post type in your back-end admin area, while you can also create a custom post in back-end  but you cannot see your created post, please check the following: In your  register_post_type  function, there is an argument called " publicly_queryable ", if you set it to false, you will find that you cannot see your page (return 404 not found). So set it to true to see your post. Update: It seems that another reason of 404 error is because of the permalink problem.  Please use register_activation_hook and register_deactivation_hook to call the function: flush_rewrite_rules(), it will help. Reference:  http://wordpress.org/support/topic/permalinks-404-with-custom-post-type?replies=40

host file windows 7

Here it is: C:\Windows\System32\drivers\etc or %systemroot%\system32\drivers\etc\ File name is: hosts You need to open notepad first and then choose the "hosts" file in order to edit it.

javascript check valid date (Pure javascript)

If you want to use pure javascript to check a date, here it is: The idea is coming from this post . Date.isValidDate= function(y,m,d){ if(typeof y != 'number') y = new Date().getFullYear(); if(typeof m != 'number') m = new Date().getMonth(); if(typeof d != 'number') d = new Date().getDate(); switch(m){ case 0: case 2: case 4: case 6: case 7: case 9: case 11: return new Date(y, m, d).getDate() <= 31; break; case 3: case 5: case 8: case 10: return new Date(y, m, d).getDate() <= 30; break; case 1: return new Date(y, m, d).getDate() <= 29; break; default: return false; break; } } Usage: Date.isValidDate(2012, 1, 29) => True    //Feb 29, 2012 Date.isValidDate(2012, 0, 31) => True    //Jan 31, 2012 Date.isValidDate(2013, 1, 29) => False    //Feb 29, 2013 Date.isValidDate(2012, 3, 31) => False    //Apr 31, 2013 Remind: m - Month i...

Open file selection box when click a link or an image

Sometimes you will meet requirements like this: I want someone to click on a link/an image and the file selection box will open immediately.  Then user can upload an image through AJAX.  (Think Facebook cover photo upload) At first, it seems that it is easy.  Here is what I did: <input type="file" id="file1" name="file1" style="display:none;" /> <a href="javascript:;" onclick="$('#file1').click()">Some link text</a> It seems perfect when you combined it with  jQuery upload .  But I was wrong.  As of this writing, the above lines work in FF v.17 and Chrome v.23, but it does not work in IE9.  It will prompt: SCRIPT5: Access is denied It is definitely NOT cross domain problem.  It turns out that it is a bug in IE  ( Original link ). So, how to solve this: The answer is quite counter-intuitive.  Here are the steps to do so: Create an <input type="file" /> tag, but this...

How to display HTML in Blogspot/Blogger, without converting HTML?

Image
Certain bloggers (like BlogKori and Gordon's Blog ) claims that, in order to show HTML in blogspot/blogger.com, they need to first convert their HTML code to entities, then paste them back to blogger. I found that this is not the best method.  Actually inside blogger, there is an option that allow you to paste HTML directly without converting.  Here is how: While you are editing, on the right hand side there is a list of options: Click Options, and you will be presented with a list of options: The original option is "Interpret typed HTML", select "Show HTML literally" and "Done". Then paste your HTML directly and see preview, you should be able to see the HTML nicely. By the way, the font-size in your pasted HTML may be very big, you can simply resize it to "smallest" to show it more nicely.

PHP Paypal SOAP SetExpressCheckout Request Message Example

This Paypal SOAP API operation page  and this Paypal SOAP API Basic page  are developed by paypal.com in order to tell us how to use SetExpressCheckOut Request message in SOAP way. However, the page does not tell us "EXACTLY HOW" to write the XML because they do not provide any exact example on how to format the XML (It only mention a little bit in the soap api basic page, but I get little value from reading this...). I personally think that this document is badly written, because you still don't know how to get start by reading that.  Therefore, I test a lot of things in this poorly written documentation, and supplement it by an example here. If you want to find out how do you format your XML correctly, here is the example. Attention This example DOES NOT CONTAIN ALL options.  It covers around 60 - 70% options in the page.  But you should be comfortable on how to make use of that Paypal documentation easily. If you define a list of items in XML, b...

PHP file upload data not post

If you use the normal PHP POST file upload method mentioned in official PHP page, chances are you may get empty $_POST or $_FILES array. In my case, I am creating a page that allow people to upload a CSV file (can be a very large file, e.g. >10M), then everything is following what is mentioned in the official PHP page.  However, the $_POST and $_FILES do not have any data when I print_r() it. Probably it is the main reason: your upload file size is too big , a.k.a: Size matters . Here are some suggestions: 1. Make your MAX_FILE_SIZE bigger: <input type="hidden" name="MAX_FILE_SIZE" value="9000000000" /> 2. In your PHP code, add this: ini_set('upload_max_filesize', '128M'); ini_set('post_max_size', '128M'); If it does not work, add these in your php.ini file instead of inside your PHP code. post_max_size = 128M upload_max_filesize = 128M  Hope it helps someone, and for my reference.

PHP error_reporting exclude notice and deprecated

For information to anyone who want to exclude more than one option of  error_reporting in PHP, use this: error_reporting(E_ALL ^ (E_NOTICE | E_DEPRECATED | E_USER_DEPRECATED)); Use () and | to pick errors that you DON'T want to show. Source:  http://stackoverflow.com/questions/2803772/turn-off-deprecated-errors-php-5-3
Google Places: Getting Found Easily By Customers In No Time On The Internet http://ping.fm/137E4
How To Use Google Adwords To Drive Laser Targeted Traffic At Low Cost http://ping.fm/FqenQ
SEO Marketing Proof http://ping.fm/ixAzg

“港版三中三”背後的市場營銷智慧 - 理論篇

平心而論,從市場學(尤其是直銷 - Direct Marketing)的角度看,港版3中3的確做得不錯,因為很多優秀的市場推廣策略都在裏面出現。而作為一位市場顧問, 即使明知道這是一個騙局,我還是會讚嘆這些市場策略。 如果只因為它是一個世紀最攪笑的騙局而笑笑就算的話,你或許會錯過一些基本的,卻十分重要的市場推廣策略。如果你能運用這些策略,它能輕易地讓你的生意利潤提升25% - 50%。現在讓我帶你看一下港版3中3究竟用了些什麼市場推廣策略: - Video(短片):看一下你周遭的,做小生意的人,有哪一位真正利用了短片去推廣產品呢?短片的價值在於它能在某程度上讓觀看影片的人和拍片的人互動,而不是單純的用一些艷麗的圖片或者性感的女人去吸引眼球。片中用新聞報道的手法,令我們覺得在接收信息(看新聞),而不是賣東西給你,因為他們知道很多人會抗拒“被銷售”,卻不介意看新聞。 片中的記者會場(國務院於人民大會堂)和訪問都讓我們感到正在參與一個新聞發佈會/記者會,所以你是在接收”新聞“,這些做法都可以減低你正在“被銷售”的警戒心。 - 權威(Authority)和可信性(Authenticity): 權威能增加信任感。如果有一位陌生人向你說:“買這個,買這個能讓你變有錢”,你可能當他是瘋子。但如果這一位陌生人是某某局長/署長的話,可信性(至少看起來可信,因為是局長說的)就會不知不覺提高。片中充份利用這種權威,所以你會看到很多所謂“高官名流”聚首一堂,為你帶來一些“重要消息”。而且還怕你們不相信,甚至憑空”創造“一些權威出來:香港政府特別參議員,亞洲博彩娛樂投資有限公司副總裁,香港六合彩推廣中心,香港博彩娛樂應用研究中心,香港慈善基金會副會長。如果對香港的政府架構沒什麼概念的話,還真的會相信呢。 還有,片中有來自世界各地(那一長串的地方就不說了。。)的記者“雲集”在這個記者會。既然各地記者對此也“大表興趣”(這麼多人。。。),這該是很重要旳東西/產品/服務。 - 準確的,有效率的標題(Headline):標題是客戶最初見到的文字。包含優點,簡短卻”給力“的標題能引起大多數人的興趣。港版三中三的標題是:一夜致富不是夢。細看這個標題,你就會發現這個標題擬得有多好:夠簡短,容易勾起好奇心,引起絕大多數人的潛在慾望(致富,而且是短時間之內),而且這並不困難(不是夢)。這夠...

市場推廣策略:給所有老闆們的市場推廣策略

向整個世界促進您的業務,特別是賣給你想要的目標顧客,並不如你所想的那樣困難。 就像 Frank Kern 所說,營銷是一個三個步驟的過程:確定市場,獲得潛在顧客(prospects)和把他們變成實際顧客。並在這些簡單的三步驟過程中,根據傑。亞伯拉罕( Jay Abraham ),你只有三種方式可以為您的企業賺錢:獲得更多的客戶,讓現有客戶更頻繁地向你購買,向現有客戶銷售價格高的東西。 如何形成自己的營銷戰略,最大限度地優化你的業務,是非常重要的。而你將看到如何更簡單和有效率地完成以上事情。 在下面的說明,我假設你已經有了一個市場,並且你已經在賣你的東西了。 獲得潛在顧客 獲得潛在顧客並不像你想像的難。為了讓人們自發地成為您的潛在客戶,你需要想出一個辦法,可以幫助在你的市場的人們。它可以是一個免費的電子書,免費錄製的消息,免費優惠券或免費視頻系列。你把那些免費的東西放在你的網站,郵件或者小冊子上,遊客需要以他們的名字和電子郵件地址來換取這些免費物品。訂閱您的網站的人們就會變成一個您的目標市場的快照。然後通過經常與您的用戶溝通,了解他們需要的是什麼,你將在很短的時間內,在你的市場建立自己的聲譽。你也將很快被視為一位專家。 變成實際顧客 變成實際顧客意味著賣東西給你的潛在客戶,讓他們變成真正的客戶。基本的概念是,人們將按照他們信任的人的說明行事。如果他們相信你,他們會做任何你希望他們做的。這也是為什麼你需要與你的潛在客戶頻繁的溝通的一個重要原因。你是在利用你在潛在客戶腦內對你的善意和信用。如果他們已經知道你,信任你,有機會(他們很可能)會向你購買,或照你的意願去做。這是從您的業務賺錢的最佳方法。 進階營銷策略 為了進一步利用上述策略,這裡有三種方式獲得從您的業務獲取最大的結果 - 獲得越來越多的客戶 :這大概是多數企業主在做的戰略。最常見的策略是電視廣告,電台廣告,黃頁,分類廣告,電子郵件廣播或使用直接郵件。然而,企業主可能不知道,得到一個新客戶的成本更為高於銷售給現有客戶。這就是為什麼我們強烈建議您使用接下來的兩個戰略。 - 頻繁地銷售給現有客戶 :讓現有客戶向你一次又一次地購買被認為是比起獲得新客戶容易得多。不幸的是許多企業主不知道此事。他們有一大堆的發票,包括名稱,地址,電話和電子郵件,靜靜地坐在文件櫃。這是大部分企業忽視的...
Marketing Strategies For All Businesses http://ping.fm/EGWDa

如何尋找新客戶?

Lead Generation是一個營銷術語,簡單來說就是獲得新的潛在顧客,並把他們變成客戶。然而這樣做是非常不同於“傳統”方式的營銷,大概像這樣: 1. 找到一個大眾媒體,如黃頁,報紙,廣告牌,電台,網站橫幅或電子郵件列表 2. 創建一個廣告,並將其發送給傳媒 3. 希望有人會看到廣告並買下產品(或服務) 4. 重複 1 這是一種“希望”行銷,企業主“希望”他們的廣告有效,使他們賺很多錢。但在這裡有一些大問題。 “傳統”營銷的問題 其中一個主要問題是,這種營銷不完全可以衡量的和有效的。企業主只是想創建一個廣告,把它交給不同的媒體然後“希望”其中一個媒體能為他們帶來利潤。如果幸運的其中一個有效,他們繼續投放廣告就可以了。如果沒有一個有用,他們會抱怨說:我的生意是如此特別,沒有任何營銷方式是有效的。 據 Dan Kennedy 所說,營銷有三個部分:信息,市場和媒體。但大多數企業主只注重最後一個,這就是“媒體”,然後他們降低價格,在市場中競爭。他們很少注意他們提供什麼(信息),而且他們也不太明白誰是他們的購買者(市場)。這就是為什麼大部分的生意失敗,即使他們得到了最好的產品,然後這東西解決世界上所有問題。 企業主的營銷解決方案 如果你已經有了一個企業,或者你是專家,但不知道如何獲得客戶並賺錢,這裡有三個步驟可以作為你的參考: 了解你的市場 :想想誰是你的理想客戶。記住不是所有的人都是你的客戶。這是違背傳統的營銷理念是:把你的名字放出去,然後便有人會來。要知道你的市場,主要是找出誰是你的理想客戶。例如,如果你是一個健康飲食書的作者,你的理想客戶可能是一個超過 200磅的婦女,已婚,40歲以上,有2名兒童。這位女士有時因為她有心臟問題需要去醫院等。透過清晰界定你的目標理想的客戶,您可以起草您的營銷信息,而這些信息對那些人最有可能有反應,並擺脫那些已經夠苗條,只是想減去最後2磅的人。 編寫您的信息 :您的信息應該是“直接”針對在上一步定義的理想客戶。現在,因為你已經知道你對誰說話,寫這個信息應該不會太困難。您需要知道的是找出你的理想客戶的最重要的問題,並創建一個能夠解決這些問題的方案/方法。無論你是從事哪些業務,您的方案也應該回答這個問題:為什麼我要與你做生意,而不是別人?回答這個問題得當可以在很短的一段時間提高你的業務利潤。 ...
Lead Generation – How To Get New Customers? http://ping.fm/j4NXH