Customize WooCommerce Product Search Field

woocommerce-search-field

The WooCommerce Product Search field can be added via a widget and also via a template tag… get_product_search_form() Another option is a filter get_product_search_form() by which you can create your own custom search field including using an icon. The Original Markup View the code on Gist. This will just reproduce the form in it’s original…

Read More

Skip Cart Go Straight to Checkout Page in WooCommerce

WooCommerce workflow can be a little too long for simple products, here’s how to get the product to skip past the cart page and go straight to the checkout page. First uncheck the cart options in WooCommerce Settings -> Products. Then add in your functions.php add_filter(‘woocommerce_add_to_cart_redirect’, ‘themeprefix_add_to_cart_redirect’); function themeprefix_add_to_cart_redirect() { global $woocommerce; $checkout_url = wc_get_checkout_url();…

Read More

What is a reference assignment in PHP?

reference-assignment

A reference assignment in PHP in respect of variables is when a variable references another variable. So for example 2 variables… $a = ‘red’; $b = ‘blue’; echo $a . ‘<br>’; echo $b . ‘<br>’; The first echo output will produce ‘red’ and ‘blue’ Now change $b to reference $a $b =& $a; echo $a…

Read More

What are Classes and Methods in OOP PHP

class-method-oop

This tutorial is a beginners look at OOP(object oriented programming) in PHP and covers what a class, method and variables are as well as how to instantiate a class and add variables to it. a class in OOP Php A class in php is an object in object oriented programming or OOP, the class defines…

Read More