Woo Commerce Snippets

Featured Image - WooCommerce

Woo Commerce Snippets

Oct 19, 2018

8月份因為時間緊迫,為了做這頁WooCommerce捐款,不懂程式,前後請了一位印度工程師幫我做弊寫了四次的程式,共花了US$90。現在要解碼了,還真痛苦,希望能看得懂,別再花錢了。

1- Remove Product Image 用CSS就好了:

Appearance > Customize >

.woocommerce-product-gallery {
display:none;
}

2- Change Button Color

Appearance > Customize > Color > Woo Commerce

3- Change Text-Name Your Price/Add to Cart

  • WooCommerce > Settings > Name Your Price

Change the following:

  • Minimum Price Text
  • Name Your Price Text
  • Add to Cart Button Text for Single Product

4-Change Add to Cart Text

https://www.isitwp.com/change-default-add-to-cart-button-text-in-woocommerce/

1
2
3
4
5
add_filter('single_add_to_cart_text', 'woo_custom_cart_button_text');
  
function woo_custom_cart_button_text() {
    return __('Donate Now', 'woocommerce');
}

This snippet didn’t work on me.

Used the plugin: https://wordpress.org/plugins/wc-custom-add-to-cart-labels/

 

Multilingual Plugin – WPML

Multilingual Plugin - WPML

October 19, 2018

文化節網站時,常常因為翻譯頁出現問題,本可以在15-20分鐘完成一頁卻因為翻譯plugin多花的時間,真是欲哭無淚呀!今天要做WACT網站-捐款頁時,又發現法文翻譯頁也出現同樣問題,不該再拖延找出問題的根源了。(哭)

這些問題,可能是Elementor還沒和WPML完全相容,也可能是我沒跟上WPML的更新技術,做文化節網站時是沒時間多研究的,現在把WPML相關資訊收集在這,希望可以解決問題。

Translating Images with Media Translation

10/19 WPML TicketAfter updating from WPML Multilingual CMS 3.9.4 to 4.0.7, the images on the translated French page won’t show, but you can still see the images on the backend. Please see attached 3 screen shots.

WPML Ticket - Images shown on backend
Images shown on the backend – translated page
WPML Ticket - Images not shown on frontend - translated page
Images not shown on frontend – translated page
Images shown on the original page
Images shown on the original page

10/22 WPML Reply

Are you using the WPML Media Translator?

We’ve released a new version of WPML and extensions. Please update all to the lastest versions. You can download here: https://wpml.org/account/downloads/

After that, please go to WPML > Settings > Post Types Translation and check if the “Media (attachment)” post type is set as “Translatable – only show translated items”. Then scroll down to Media Translation apply the settings for the future media and run the scan for the existing content.

10/22 Steps:

When you need to show images with content that you translated using WPML’s Translation Management, you should never edit that content manually using the WordPress “post editor.” If you do, your edits will be lost the next time you update this content using Translation Management.

WPML Media Translation

有時真是蠻挫折的,一整早上找一個以前不曾是問題的問題答案,還是找不到,只好再寄一次求救信。10/22 12:27pm

Gravity Forms

米蠍屋筆記

Gravity Forms

April 6, 2018

做捐款或是Booking都要用到的Gravity Forms.

  • Notes:  1. Stripe Add-on

Setup the Form

  • From Advanced Fields – Add Name, Email, Address, etc
  • From Pricing Fields – Add Product
  • From Pricing Fields – Add a Credit Card
  • Save the form
  • Setup Stripe

Setup Stripe

  • Connect the Stripe Add-On to the Stripe account via the Stripe’s API
  • Go WP Datashboard > Forms > Settings > Stripe
  • Enter Test or Live Secret Key and Publishable Key for the Stripe account
  • Enable Webhooks 
  • Setup Stripe Feeds

Setup Stripe Feeds

  • WP Datashboard > Forms > Select the form > Settings  > Stripe
  • Name each Stripe Feed
  • Select the Stripe Transaction Type: either Products and Services or Subscription
About the Credit Card Field
  • The Credit Card Field is in the Pricing Fields
  • This field doesn’t actually store the Credit Card data, neither our site , server or database. The payment gateway, Stipe Add-On does.
  • If the page is unsecured, the Credit Card Field will be highlighted with a red warning.  However, with a valid SSL certificate, the warning won’t be displayed.

Stripe Subscription Cancellations

  • The only way to cancel a Stripe Subscription is thru WordPress Dashboard or the Stripe admin.

Stripe Add-On Hooks: https://docs.gravityforms.com/category/stripe/

Add-On Framework Hooks: the Stripe Add-On is built using the Add-on Framework.

 

Learning Woo Commerce

Featured Image - WooCommerce

Learning WooCommerce

1/32 Installing WooCommerce – Setup Wizard

 

3/32 General Settings-

  • Sell to Canada & U.S.
  • Geolocate
  • Enable Taxes / CAD $
 
 
 
 

5/32 Tax Settings

2/32 WooCommerce.com Subscriptions

  • Connect with WordPress.com account

4/32 Products Settings

  • Product Images: Catalog Image /  Single Product Image / Product Thumbnails
  • Astra Theme > Customize > WooCommerce > Product Images
  • Astra Theme > Main Image Width: 600 > Thumbnail Width: 300 > 1:1 or Custom Cropped
  • Tutorial: Fixing Blurry Product Image https://youtu.be/9wte-83NSnI
  • Tutorial: https://youtu.be/j9REmMPJt2U

Non Profit Donation Plugins

Featured Image - Computer

Photo by malawiheiko on Pixaby

Non Profit Donation Plugins

March 21, 2018

貨比三家真的是沒錯,原本以為網站捐款就是用WP Give這個Plugin就可以了,但是若需要將捐款像慈際那樣公開的話,需要的好像不一樣。雖然找功課很耗時,今天算是有點頭緒。

先來看看Give的功能和成本:

Pro: 

    • Keep our own data
    • PayPal or Stripe fee: 2.9% +$0.30 vs GoFundMe 3% – 5% 
    • CanadaHelps.org charges 4.0% for One Time Donations & 3.5% for Monthly Donations
    • Free Plugin – able to do Multi-Level Donations
Con:
    • Need Add-On for PDF Receipt, MailChimp, Stripe (Basic $15/month)
    • Need Add-On for Recurring Donations, Form Field Manager, Currency Switcher (Plus $25/month)
 

Anywhere Elementor Pro

Plugin Research: Anywhere Elementor Pro

看了幾次Dave Foy這個教學影片How to Design a WordPress Single Post Template with Elementor (2017.7.1發佈)一直想要買來試試看!這個Plugin能做Post Template,應該也是應用Custom Post Types原理,是不是買這個就不需要 CPT了嗎?

今天就來做點功課吧!

怎麼看了官網後,有不放心的感覺呀?
Personal: $25/year – 1 site
Business: $49/year – 3 sites
Unlimited: $99/year – unlimited sites

WPCrafter.com 這篇評論 Anywhere Elementor Pro Review And Comparison To Beaver Themer (2017.6.27發佈) 解釋了為什麼我會不放心!
1. Weak Documentation
2. 使用AE Pro讓原始的Elementor Pro受限了,失去了主功能.

 

Custom Post Types & Custom Fields

Custom Post Types & Custom Fields

2017.12.6

在做文化節網站時,老闆對Event Schedule Plugin做出來的節目內頁格式不滿意,所以我只用了Plugin來做Schedule,節目內頁自己做,沒有充份利用Plugin整體的效用,文化節有上百個節目,在極短時間內要完成,壓力之大,真的是只有我這種白癡菜鳥才會願意做的.俗話說,人笨事情就多,真的是就是如此.我告訴老闆,如果沒有研究出來解決方式,就不接這份工作了.

WordPress有兩種Post格式:Pages 和 Posts.我想Plugin是利用Custom Post Types的方式來設計 Event Calendar/Schedule的.那我就應該學Custom Post Types,自己來設計老闆要的格式嚕!

Tut #1 先從這個教學網站學起:

這個教學影片有1:05:25這麼長,剛開始看時覺得好棒,找到需要的工具了,但是到了33:42時,才知道這個對我太難了,太多php coding的背景,雖然我這菜鳥已進步不少,不過此時還不是時後學這些,只好暫停,繼續找尋適合我程度的工具.

不過這影片提到的兩個Plguin:
1. Custom Post Types UI by  Web Dev Studio
2. Advanced Custom Fields by Elliot Condon
我應該確定那是我要的方向,只要找到簡單一點的工具來配合使用,才能讓我在短時間內達到老闆要的標準. 繼續向前走了….

其實此時的心情,又開始緊張了,回到開始做這份工作的不安,沒有經驗和背景又開始自卑起來…怎樣能克服不再害怕?

Tut #2 下一個教學影片只有11分鐘,也許有用??

看完 Bjorn 的教學影片,再讀讀他的文字教學:https://wplearninglab.com/wordpress-custom-post-type/

Tut #3 Neil Curtis的教學影片,讓我確定Custom Post Types是我需要的,卻連結到別的地方去了!完成這個目標後再回頭讀他的網站吧!

 

2:19pm 暫停一下了,快要爆炸了….

 

2017.12.29

Tut #4 How to Extend Word Press With Custom Post Types & Custom Fields Using PODS by WPCrafter.com (2017.11.9 發佈 1:04:09)

用Elementor要搭配Anywhere Elementor Pro會限制了Elementor的主功能.看來又要回到Beaver Builder,又要買Beaver Themer,又回到零點了!