Skip to main content

Posts

Easily include Seller Bank details in On-hold Order Email WCFM

Do you have a scenario when using WCFM , you would want to allow buyer to directly pay to seller bank account by bank transfer? Well I do. This is due our Marketplace offered free service to sellers. At the beginning we charge them some commission fees, but that does not really work. As the job to handle the delivery is more troublesome with our limited resources and our sellers are not coming from big companies who are willing to pay higher commission fees. I'm going to share with you how easily you can add the Seller account details on the Customer on-hold order email template. I'm adding this in an extended child-theme ..okay. Never write in the original Woocommerce plugin module, nor the parent theme module. That is 100% wrong, as LATER on, you will have trouble to manage and upgrade the theme and plugins to the latest version. Add the Woocommerce template directory in child theme Create the directory for Woocommerce emails and copy the file over. Update the c...

The right way to load Javascript and CSS files in Wordpress.

The way we load Javascript and CSS files in Wordpress is different from the normal HTML way. First of all, we need to identify where do we want to load the scripts. Is it in our theme or plugin?. Lets say we want to load it to  our theme, we can easily create a new folder in our child theme and place the scripts in it. for example Then we can load it in our child theme functions.php file. Ok when we load, we need to understand the parameters that we want to pass in... for wp_enqueue_styles is quite straight forward. but for wp_enqueue_script.. Pay attention on deps parameter. whether the script that we want to load has dependencies with other scripts / jquery. Same goes to in_footer parameter, do we want to load in header or before the body closing tag. If we do not define properly. Our scripts might not be loaded properly. Pay attention on those two parameters.

Get all meta keys of wp_usermeta using sql query

To get all meta keys of wp_usermeta we can easily group field of meta_key and meta_value. For example: select group_concat(meta_key) as meta_keys from wp_usermeta group by user_id limit 1 \G; Results: *************************** 1. row *************************** meta_keys: nickname,first_name,last_name,description,rich_editing,syntax_highlighting,comment_shortcuts,admin_color,use_ssl,show_admin_bar_front,locale,wp_capabilities,wp_user_level,dismissed_wp_pointers,show_welcome_panel,wp_dashboard_quick_press_last_post_id,wc_last_active,wp_user-settings,wp_user-settings-time,_previous_login,_current_login...

Get the last active time from users in woocommerce using sql query

To easily get the last active time from users (under Woocommerce extended plugin) we can easily query from database using the meta_key of "wc_last_active" example query: select user_id, meta_value from wp_usermeta where meta_key= "wc_last_active" and user_id in (11111,112222); results: +-------------+------------------+ | user_id    | meta_value | +-------------+-------------------+ |   11111   | 1556755200 | |   112222 | 1566518400 |

How to easily parse PHP array to Javascript Array

Hi All, how are you doing? Stucked? Haa. Today i'm going to share with you how to easily parse a PHP array to Javascript array! Let's say we have a php array with key pair values defined. Example We want to change it to javascript object. first we will need to parse the array to json format Then we can use in javascript, either tru api or directly Same goes if we have an array of objects in PHP example Then we parse to json And access it in Javascript Hope this helps! Please leave some comment so that i can help it out~

hiddenInput issue when integrating intl-tel-input in Woocommerce custom gateway plugin

Checkout my full post here.. on the workaround. If you have any question. please drop a comment, i ll will reply https://github.com/jackocnr/intl-tel-input/issues/1020 for those who are having issue on woocommerce ajax checkout update call, **i faced this when using Woocommerce deposit, i updated to check if there's any post data on form initialization, if yes, i will reassigned the variable value. Example:

Never write long post title! Here's why

Guys! I'm writing blog post on daily basis, and doing some experiment. Every morning after i woke up and booted my laptop, the first thing that i will do is actually checking my blog traffics. After disappointed with the number of traffic. Previously what i always tried to do is adding more post and more keywords. but that's not just it! The title must be attractive and clean enough! Why. I discovered that when using "queries" by visitors of my blog that i get from google search console , i noticed that..my post title is toooooooooooo long. and google result cut off the most important word !! as below example, google result cut off the total price of the 12 days  trip to 6 Europe countries !which is the highlight of the post! Example: Ok. knowing this... i want to share with all of you. Always keep you title simple and attractive but do not exceed the 50-56 characters limits! You can use a word processor software to count the total of characters, or can...