Author: Ricardo Correia

  • WooCommerce the best solution for eCommerce in 2020

    WooCommerce the best solution for eCommerce in 2020

    In the past month the world has taken a turn due to Covid-19 and the actions taken to fight this pandemic.

    With social isolation, quarantine and all the brick and mortar stores with their doors closed we’ve seen a bigger rise in e-commerce sales across the world. 

    What has been a steady trend already is growing quicker than before escalating even more than 100% in the past 30 days in several categories (source: Aciworldwide)

    Everyday more and more consumers are using online stores in their day to day shopping, a trend that is probably not going to go away any time soon.

    Following this trend, shop owners from all types of business have been hunting for the best solution for their online stores.

    Being a WordPress and WooCommerce expert, I am a little biased :), but let me tell you why I think WooCommerce is the best solution for e-commerce in 2020.

    1. Low startup cost, free and open-source just like WordPress
    2. User Friendly, created with the user in mind, every configuration aims to be simple and easy to use
    3. All basic features are free, unlimited products, unlimited orders, payment gateway plugins, basic reporting are all free features you’ll find in WooCommerce
    4. Huge user base, allowing you to easily find lots of tutorials and guides online
    5. Easy to customize, there are hundreds of plugins on both free and paid repositories
    6. Extensible and open source, if you can’t find a plugin to fit your needs or you need some custom changes, you can hire a developer to create a custom solution

    For instructions in how to setup your WooCommerce shop, you can follow the official documentation in https://woocommerce.com/posts/how-to-set-up-a-new-woocommerce-store/

    Don’t know how to solve a specific issue or you’re needing a custom feature built?

    Schedule a free consultation meeting with me here.

  • WooCommerce and WooCommerce Subscriptions – Automatically set order status to completed

    WooCommerce and WooCommerce Subscriptions – Automatically set order status to completed

    This post is an update onWooCommerce – Automatically set order status after payment is received

    WooCommerce is a great option to sell all type of goods, being it virtual or physical products you’ll quickly add them to your store and start selling to your visitors.

    By default when WooCommerce system processes a payment it’ll set an order with only virtual and downloadable products to completed but sometimes this isn’t enough for your store.

    In this case, the store sells physical products and subscriptions, that can be a physical product sent by mail each month or a virtual product that gives you access to restricted areas of the website, because of that we need to change WooCommerce default behavior and automatically set our virtual subscriptions as completed orders, after the payment is complete.

    For doing this we’re going to use a hook “woocommerce_order_item_needs_processing” and check if the products on the order are only virtual and subscriptions.

    /**
     * Set Orders from Subscriptions marked as Virtual Products Completed Automatically.
     *
     * @param  boolean $virtual_downloadable_item If item is virtual and downloadable.
     * @param  Object  $_product                  Product Object.
     * @param  int     $product_id                Product ID.
     * @return Boolean                            Should not be set to processing.
     */
    function rfvc_set_virtual_subscriptions_completed( $virtual_downloadable_item, $_product, $product_id ) {
    
    	if ( $_product->is_virtual() && is_a( $_product, 'WC_Product_Subscription' ) ) {
    		$virtual_downloadable_item = true;
    	}
    
    	return $virtual_downloadable_item;
    }
    add_filter( 'woocommerce_order_item_needs_processing', 'rfvc_set_virtual_subscriptions_completed', 10, 3 );
    
    

    You can also use this code to change the order status in virtual products, without them being subscriptions, removing the check for a subscription product object && is_a( $_product, 'WC_Product_Subscription' )

  • What WordPress and a broken car have in common

    What WordPress and a broken car have in common

    A few years ago I was leaving my parents driveway in the morning, I get into my car, started it up and started turning the steering wheel when suddenly I heard a crack noise and lost the ability to turn the wheels.

    As my knowledge of car mechanics it’s almost inexistent and one of my father friends is a mechanic, I called him to take a look into it and gone through with my day, knowing I’ll retrieve the car at the mechanic’s garage later.

    At the end of the evening, I went to the mechanic’s, paid him a beer and the part he changed and got into my car to go to the movies with my new girlfriend.

    About 5 minutes driving I heard the crack again and guess what happened, I was without a car for the second time that day. But this time, I had a schedule, I was late for my date and in the middle of the street without my beloved transportation… F*ck.

    I literally ran to the mechanic’s garage again to catch him still there and told him what happened.

    Long story short, the fix didn’t work at first out and the car  has toed there again. I was left with only one solution, a 1 and a half hour of many stops and subway changes trip to the movies, and yes, do the same again to get back home.

    So, what this story got to do with WordPress?

    I’ve done something with my car that I’m totally against in my line of work, opted for the cheapest and quickest fix for my problem, instead of making sure it has “the best” solution and it has going to properly solve my problem.

    When you cut corners, either to save a few bucks or to have a faster turnaround you’re risking your website future.

    When you’re building a website, fixing something in it or expanding its current functionalities you always have a ton of options to choose from. Free or premium plugins and themes, custom development, your cousin friend that understands a little about computers, freelancers, and companies.

    Whatever is your choice you need to be sure, what it means for your website future and for its continued functionality and availability.

    And what should I choose?

    The answer to this question will always be “depends”.

    It depends on :

    1. your budget,
    2. the needed functionality
    3. the turnaround you need for it.

    My advice would be for you to seek someone that understands:

    1. your needs,
    2. your website and business needs,
    3. the platform where you want to build in, WordPress.

    A good professional will be able to tell you what you should do and what would be the best option for your situation.

    It’s not always installing the plugin X or Y and Z, it can be a custom built plugin or/and theme.

    WordPress is more than a simple CMS it’s a framework, totally customizable for your needs.

    You can start small and improve along the way or start with all the bells and whistles. You can even build it yourself, but remember your choices today will impact the way your website works and it’s future.

  • When WordPress caching system makes things slower

    When WordPress caching system makes things slower

    Last week has launch time for my/Samsys latest and last plugin, an internal messaging system for WordPress websites, developed to work together a custom WordPress product for Pre-schools.

    The plugin allows registered users to exchange messages between them using a front-end interface ( non-admin users) and a back-end interface on the wp-admin (users with administrative access).

    Everything was going smoothly until I started testing on a live website with more than 600 registered users. The front-end ran smoothly but the back-end became painfully slow with over 15 seconds of load time.

    After some investigation, I was able to pinpoint the “problem”, multiple databases calls for “update_meta_cache” each call only took milliseconds to process but there were thousands of them and it was slowing down the back-end performance.

    What’s “update_meta_cache” ?

    As it’s name suggests, this functions updates metadata cache on a specified object and runs  everytime you fetch metada from the database.

    “update_meta_cache” is very handy on the front-end where exists a caching mechanism in place but in the back-end, no cache is active and it slowed down the plugin performance painfully. The solution has relatively simple, instead of fetching the users every time I needed them listed I created an object with all the needed user data, saved it using Transients API, and every time a new user it’s added to the website the object it’s re-created with the new data.