WooCommerce : Disable Autofocus on the First Name field

August 23, 2017 in Code Snippet

Today I was dealing with a “little but annoying” thing. I found that there is an autofocus function on the First Name field under WooCommerce billing and shipping address. In a normal condition, maybe it’s not a problem. But when you did a customisation, for example : Re-order the fields, add some custom fields on the top and put the First Name to the middle or to the bottom, it doesn’t make sense to have the autofocus active.

As usual, I went to Uncle Google and found some threads. I found this and this. But unfortunately, all of those solutions are didn’t work for me. I guess because both of them are using woocommerce_checkout_fields hook to call their function. Continue reading »

Create AfterShip Webhook on WordPress

August 8, 2017 in Code Snippet

On my recent project, I work with AfterShip to track the shipment status of WooCommerce order. If you try to find it on Google, you will find this plugin :

Aftership – WooCommerce Tracking

That plugin is pretty cool, you can input the tracking number from wp-admin area and also put the Track button on the order details page so that your customer will be able to track their package with just single click.

But my challenge was bigger than that. I had to find a way to track the shipment automatically, so every time our customer open their order, they will see the latest status of their package, for example : In Transit, Delivered, etc. Continue reading »