Code Snippet

27
Jul

Woocommerce Single Product Thumb Image Click Replace Main Image

I just got some client ask me to make so that on woocommerce single product page, when user click on the thumbnail image, then the main image of the product changed to the thumbnail image. I completed it using jquery as follow: Hope it help if you need it.

20
Jun

Fix WordPress Upload Image HTTP Error

I often encounter error on wordpress image uploader that return http error when I try to upload an image through wordpress default image uploader. This often happen after I migrate from my localhost to the hosting. After consult with the hosting technical team, they suggest this fix and it works. Paste this code on your theme’s functions.php file: If you

Read more

1
Jun

Woocommerce Custom Payment Confirmation Using Gravity Form

Woocommerce doesn’t come with payment confirmation for bank transfer by default. I use gravity form to create a custom payment confirmation form. After customers have submitted the payment confirmation form, then the order status will be changed to ‘payment-confirmed’ (which is a custom status created below). The shop manager¬†should check if the payment confirmation is valid, then change the order

Read more

1
Jun

Woocommerce: Add Customer Orders on My Account Dashboard

Using this code, you can easily add your customers list of orders history to my account dashboard directly. Just paste this code to your theme’s functions.php file.

26
Oct

Load Woocommerce Loop With Custom Arguments

Woocommerce comes with many default shortcode that generally used in e-commerce website. Some of my project required different arguments to be passed on to woocommerce product query. I need to change the woocommerce shortcode behaviour to meet my project needs. I want to display sale products but with offset options. So I create another custom shortcode to add the offset

Read more

24
Oct

Woocommerce: Replace “Sale” with Percentage Discount

Woocommerce is a very powerful e-commerce plugins f0r WordPress. It integrate seamlessly with many plugins, payment gateway, shipping courier, and many more. Sometimes to make the customer of the e-commerce website more willing to check the product is to give a discount price. By Default, woocommerce only show green bubble with a “Sale” text on it. I think its not

Read more

24
Oct

Create Shortcode for Jetpack Social Sharing Buttons

Jetpack have a lot of useful features that we can use on our WordPress powered websites. I usually use the social sharing features to enable my website visitors to share the post / page content to their own social media. By default the social share buttons is placed below the content of the post / page. You can move it

Read more

18
Oct

WordPress Custom Post Type Registration using register_post_type

WordPress provide a way for their developer to add any kind of post type and all available options for it. This features is really handy to improve Backend User Experience so that user can add / update / delete any kind of post type easily. Here is the code snippet I usually use to register a new wordpress custom post

Read more