Skip to main content

Posts

Showing posts with the label woocommerce

Populate Whatsapp Link Based on Seller Phone Number WCFM

Hi all, Image from Pexels Today I'm going to share, how to populate WhatsApp link based on the seller number. My example today is based on Malaysia's phone number. The registration input doesn't have an input validator for the phone number, however, these are the most common number registered by users. 1) starting with 6 at front 2) starting with +6 at front 3) normal number without country code eg : 014xxxxxx Full code on how to populate whatsapp link for seller number basically, I introduced a simple pattern that has 2 groups. "#(^[6]\w*$)|(^[+][6]\w*$)#"; The patterns must have a delimeter added for PHP, in my case i use a `#`. You can use other delimiter that supported by PHP . The first pattern (^[6]\w*$) Checks whether the seller phone number starts with number 6 and followed with other characters. If it is matched, do nothing as the format is already correct. The second pattern (^[+][6]\w*$) Checks whether the seller phone ...

Adding Custom Field for Vendor Settings in WCFM

Hi all, just a quick sharing. How to add Custom Field for Vendor Settings in WCFM Image by Clker-Free-Vector-Images from Pixabay I wanted to add a custom field for Vendor Settings in WCFM . The field will be a checkbox with a label of "Verified". This field can only be filled by an admin. The purpose tells is to tell whether this vendor is verified or not and data is stored in `wp_usermeta` table. Okay, of course, if I use the paid extension for WCFM plugin this feature already included. But come on! I just want to add this simple function without paying any penny :P Thus I decided to DIM (Do it Myself). I was lucky that previously other WCFM users did a custom field for Vendor Settings and shared his solution on the WCFM forum. Aha. So I tested out, in the beginning, it was not working. The working code I included here for your reference. I also added the admin user check to ensure the field is only loaded for admin view :D. This code needed to be in...

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...

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 |

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: