How much is WooCommerce slowing down your WordPress site?
June 2, 2023 in Blog
If you are thinking about installing WooCommerce on your WordPress site you might want to think first about how it will affect to your website performance.
Read More →June 2, 2023 in Blog
If you are thinking about installing WooCommerce on your WordPress site you might want to think first about how it will affect to your website performance.
Read More →June 2, 2023 in Blog
In the previous article we have found out that BuddyPress and bbPress took a hefty performance toll on the backend of your website. This is how we fixed it.
Read More →June 2, 2023 in Blog
How much will BuddyPress and bbPress affect performance of your WordPress site? We have conducted some quick tests on the website with 1k users.
Read More →June 2, 2023 in Blog
In this particular benchmark test we will look into performance for Bookly, Events Manager, Booking Calendar on PageSpeed Insights, Pingdom and admin area.
Read More →May 30, 2023 in Blog
In this article we will explain in detail how we increased PageSpeed Insights score of the WooCommerce store with 10k products and 1k customers to 99 Performance score on PageSpeed Insights and 98 Performance grade on Pingdom.
Read More →December 4, 2021 in Code Snippets
The following useful function is found in the includes/wc-core-functions.php and can be used by themes and plugins. Trims and strips tags from a string ($var). wc_clean( $var )
Read More →December 1, 2021 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. Disable all stylesheets WooCommerce enqueues 3 […]
Read More →November 25, 2021 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Change the default state […]
Read More →November 4, 2021 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Custom currency and currency […]
Read More →October 13, 2021 in Code Snippets
$customer = new WC_Customer( $user_id ); $email = $customer->get_email(); $address = $customer->get_billing_address(); $name = $customer->get_first_name() . ' ' . $customer->get_last_name();
Read More →October 5, 2021 in Code Snippets
As ‘clothing’ is an example in the snippet below, be sure to use a product category slug that exists in your WooCommerce store. Note that this will only work when you have your “Shop Page Display” option set to ‘Show Products’ under your Customizers’ WooCommerce > Product catalog settings. Add this code to your child […]
Read More →September 30, 2021 in Code Snippets
This code can be used as a base to create your own simple custom payment gateway for WooCommerce. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php […]
Read More →September 4, 2021 in Code Snippets
Let’s add a new field to checkout, after the order notes, by hooking into the following. /** * Add the field to the checkout */ add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' ); function my_custom_checkout_field( $checkout ) { echo '<div id="my_custom_checkout_field"><h2>' . __('My Field') . '</h2>'; woocommerce_form_field( 'my_field_name', array( 'type' => 'text', 'class' => array('my-field-class form-row-wide'), 'label' => __('Fill […]
Read More →July 7, 2021 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. add_filter( 'woocommerce_billing_fields', 'wc_npr_filter_phone', 10, 1 ); […]
Read More →June 5, 2021 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Show product categories in […]
Read More →May 9, 2021 in Code Snippets
function mytheme_add_woocommerce_support() { add_theme_support( 'woocommerce' ); } add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
Read More →May 3, 2021 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Hide loop read more […]
Read More →May 2, 2021 in Code Snippets
The following useful function is found in the includes/wc-core-functions.php and can be used by themes and plugins. Takes a weight ($weight) weighed in WooCommerce’s weight unit and converts it to the target weight unit ($to_unit). wc_get_weight( 10, 'lbs' )
Read More →April 23, 2021 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. Useful if you want to change […]
Read More →April 7, 2021 in Code Snippets
When registering taxonomies for your custom attributes, WooCommerce calls the following hook: $show_in_nav_menus = apply_filters('woocommerce_attribute_show_in_nav_menus', false, $name); So, for example, if your attribute slug was ‘size’ you would do the following to register it for menus: add_filter('woocommerce_attribute_show_in_nav_menus', 'wc_reg_for_menus', 1, 2); function wc_reg_for_menus( $register, $name = '' ) { if ( $name == 'pa_size' ) $register […]
Read More →March 13, 2021 in Code Snippets
Currently, when using the Checkout block from the WooCommerce Blocks plugin, there’s no check if the billing or shipping address field contains a house number. The following code snippets allow to check if these fields contain a number. To check if both the billing and the shipping address contain a house number, please use the […]
Read More →March 11, 2021 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10); remove_action( 'woocommerce_after_main_content', […]
Read More →March 5, 2021 in Code Snippets
<ul class="products"> <?php $args = array( 'post_type' => 'product', 'posts_per_page' => 12 ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { while ( $loop->have_posts() ) : $loop->the_post(); wc_get_template_part( 'content', 'product' ); endwhile; } else { echo __( 'No products found' ); } wp_reset_postdata(); ?> </ul><!–/.products–>
Read More →February 17, 2021 in Code Snippets
If you’re building a theme which supports but doesn’t require WooCommerce, you may want to wrap WooCommerce functionality (think cart links etc) inside a conditional query. That way, if WooCommerce isn’t activated, the functionality is simply ignored instead of producing fatal errors. Add this code to your child theme’s functions.php file or via a plugin […]
Read More →January 15, 2021 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Set a minimum order […]
Read More →December 28, 2020 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Allow shortcodes in product […]
Read More →December 27, 2020 in Code Snippets
You would now just use your newly created settings like you would any other WordPress / WooCommerce setting, through the get_option function and the defined ID of the setting. For example, to use the wcslider_auto_insert option from previous snippet, simply use the following code. get_option( 'wcslider_auto_insert' );
Read More →December 5, 2020 in Code Snippets
This snippet sends by email the list of coupons used in an order. You can customize the $to variable and define your own email address, and the $message to have your own text. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as […]
Read More →October 5, 2020 in Code Snippets
By default, if a Variable product has fewer than 30 variations, the dropdowns for selecting variations on the frontend will be dynamic. For example, with a T-shirt that has “Size” and “Color” attributes, after the customer selects a Size, the Color dropdown will be updated via AJAX to only display options that are available with […]
Read More →September 2, 2020 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. Enqueue your own stylesheet like this: […]
Read More →August 18, 2020 in Code Snippets
You need to filter the output of woocommerce_get_sections_products (or similar). For example, let’s add the sample settings we discussed above to the new wcslider section we just created. /** * Add settings to the specific section we created before */ add_filter( 'woocommerce_get_settings_products', 'wcslider_all_settings', 10, 2 ); function wcslider_all_settings( $settings, $current_section ) { /** * Check […]
Read More →August 16, 2020 in Code Snippets
To display quantity input fields for simple products within your shop archive pages, use the following code. /** * Override loop template and show quantities next to add to cart buttons */ add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 ); function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) { if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() […]
Read More →August 9, 2020 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Automatically add product to […]
Read More →July 31, 2020 in Code Snippets
The code snippet below allows you to: Show a notice on the cart and checkout page, reminding customers that they get a discount if spending more than a minimum amount. Automatically apply a discount and show a notice that the discount was applied when the cart total is more than a minimum amount. Add this […]
Read More →July 30, 2020 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Add a new country […]
Read More →July 17, 2020 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. Use the following snippet to remove […]
Read More →June 28, 2020 in Code Snippets
Defines where ‘first’ and ‘last’ classes are applied in product archives. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely […]
Read More →June 15, 2020 in Code Snippets
You need to add this CSS to your child theme’s style.css file or to your customizers’ “Additional CSS” section. Please don’t add custom code directly to your parent theme’s style.css file as this will be wiped entirely when you update the theme. .form-row.woocommerce-invalid .chzn-single, .form-row.woocommerce-invalid .chzn-drop, .form-row.woocommerce-invalid input.input-text, .form-row.woocommerce-invalid select { border:1px solid red; } […]
Read More →June 10, 2020 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Hide category product count […]
Read More →June 1, 2020 in Code Snippets
To execute your own code, you hook in by using the action hook do_action(‘action_name’);. Here is where to place your code: add_action( 'action_name', 'your_function_name' ); function your_function_name() { // Your code }
Read More →May 20, 2020 in Code Snippets
The following code will remove product images on single product pages within the ‘Cookware’ category. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this […]
Read More →April 22, 2020 in Code Snippets
$coupon = new WC_Coupon( $coupon_id ); $coupon->set_discount_type( 'percent' ); $coupon->set_amount( 25.00 ); $coupon->save();
Read More →March 18, 2020 in Code Snippets
Display WooCommerce product attribute archive links on the product page, right below the add to cart button. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file […]
Read More →March 12, 2020 in Code Snippets
Currently, when using the Checkout block from the WooCommerce Blocks plugin, there’s no check if the billing or shipping address field contains a house number. The following code snippets allow to check if these fields contain a number. To check if the shipping address contains a house number, please use the following code snippet: add_action( […]
Read More →March 11, 2020 in Code Snippets
Let us change the placeholder on the order_comments fields. We can change this by adding a function to our theme functions.php file: // Hook in add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); // Our hooked in function – $fields is passed via the filter! function custom_override_checkout_fields( $fields ) { $fields['order']['order_comments']['placeholder'] = 'My new placeholder'; return $fields; } […]
Read More →March 6, 2020 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. Use the following snippet to add […]
Read More →February 28, 2020 in Code Snippets
Use the following code to change the number of WooCommerce products displayed per page. This requires you to have your shop page display, which can be found in customizer view under WooCommerce > Product catalog set to “Show products”. Add this code to your child theme’s functions.php file or via a plugin that allows custom […]
Read More →February 1, 2020 in Code Snippets
$product = new WC_Product_Simple(); $product->set_name( 'My Product' ); $product->set_slug( 'myproduct' ); $product->set_description( 'A new simple product' ); $product->set_regular_price( '9.50' ); $product->save(); $product_id = $product->get_id();
Read More →January 11, 2020 in Code Snippets
Please note that it may not work for all themes because of the way they are coded. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file […]
Read More →December 23, 2019 in Code Snippets
December 19, 2019 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Change number of upsells […]
Read More →November 5, 2019 in Code Snippets
The option to show trailing zeros on your prices has been removed in favor of a filter, as of WooCommerce 2.2x. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your […]
Read More →November 3, 2019 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Add a standard $ […]
Read More →July 29, 2019 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /* * goes in theme functions.php […]
Read More →July 24, 2019 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Notify admin when a […]
Read More →June 21, 2019 in Code Snippets
Most WooCommerce plugins do not need to run unless WooCommerce is already active. You can wrap your plugin in a check to see if WooCommerce is installed: // Test to see if WooCommerce is active (including network activated). $plugin_path = trailingslashit( WP_PLUGIN_DIR ) . 'woocommerce/woocommerce.php'; if ( in_array( $plugin_path, wp_get_active_and_valid_plugins() ) || in_array( $plugin_path, wp_get_active_network_plugins() […]
Read More →June 20, 2019 in Code Snippets
Display different content for different categories. if ( is_product_category() ) { if ( is_product_category( 'shirts' ) ) { echo 'Hi! Take a look at our sweet tshirts below.'; } elseif ( is_product_category( 'games' ) ) { echo 'Hi! Hungry for some gaming?'; } else { echo 'Hi! Check our our products below.'; } }
Read More →June 16, 2019 in Code Snippets
Please note that the “Additional Information” tab will only show if the product has weight, dimensions or attributes (with “Visible on the product page” checked). If you try to apply a change to that tab and if the product does not have weight, dimensions or attribute, you will get an error message. In that case, […]
Read More →June 12, 2019 in Code Snippets
To enable the product gallery in your theme, you can declare support like this. add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' );
Read More →June 1, 2019 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Change a currency symbol […]
Read More →April 8, 2019 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Auto Complete all WooCommerce […]
Read More →March 28, 2019 in Code Snippets
The following useful function is found in the includes/wc-core-functions.php and can be used by themes and plugins. Formats a passed price with the correct number of decimals and currency symbol. wc_price( $price, $args = array() )
Read More →March 2, 2019 in Code Snippets
Download this script and save it to the JS folder in your theme directory. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will […]
Read More →February 13, 2019 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. Don’t forget to add your own […]
Read More →January 18, 2019 in Code Snippets
Please note that for this code to work you’ll need to have the “Account creation” settings for customers checked, in “Accounts & Privacy”. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly […]
Read More →November 24, 2018 in Code Snippets
If you need more control over thumbnail sizes here is a hook available to you. add_filter( 'woocommerce_get_image_size_gallery_thumbnail', function( $size ) { return array( 'width' => 150, 'height' => 150, 'crop' => 0, ); } );
Read More →October 26, 2018 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Add a custom field […]
Read More →October 17, 2018 in Code Snippets
Try to prevent direct access data leaks. Add this line of code after the opening PHP tag in each PHP file. if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly }
Read More →October 10, 2018 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. WooCommerce 3.0+ /** * Show product […]
Read More →October 4, 2018 in Code Snippets
Display WooCommerce product dimensions on archive pages, below the title of the product. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be […]
Read More →August 3, 2018 in Code Snippets
These are optional theme settings that you can set when declaring WooCommerce support. function mytheme_add_woocommerce_support() { add_theme_support( 'woocommerce', array( 'thumbnail_image_width' => 150, 'single_image_width' => 300, 'product_grid' => array( 'default_rows' => 3, 'min_rows' => 2, 'max_rows' => 8, 'default_columns' => 4, 'min_columns' => 2, 'max_columns' => 5, ), ) ); } add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
Read More →July 12, 2018 in Code Snippets
Displays a link to the user account section. If the user is not logged in the link will display ‘Login / Register’ and take the use to the login / signup page. If the user is logged in the link will display ‘My account’ and take them directly to their account. <?php if ( is_user_logged_in() […]
Read More →June 27, 2018 in Code Snippets
Hook in your own functions to display the wrappers your theme requires. Make sure that the markup matches that of your theme. If you’re unsure of which classes or IDs to use, take a look at your theme’s page.php for guidance. add_action('woocommerce_before_main_content', 'my_theme_wrapper_start', 10); add_action('woocommerce_after_main_content', 'my_theme_wrapper_end', 10); function my_theme_wrapper_start() { echo '<section id="main">'; } function […]
Read More →April 30, 2018 in Code Snippets
Hides everything but free_shipping if it’s available and is compatible with Shipping Zones. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be […]
Read More →March 1, 2018 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. Set the starting value, maximum value, […]
Read More →February 19, 2018 in Code Snippets
The following useful function is found in the includes/wc-core-functions.php and can be used by themes and plugins. Gets a WooCommerce page ID by name, e.g. thankyou wc_get_page_id( $page )
Read More →January 8, 2018 in Code Snippets
This snippet is for adding tracking for a separate piece of analytic software you may have installed. The order object contains all the order data you should need, including line items. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky […]
Read More →January 6, 2018 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Display category image on […]
Read More →January 2, 2018 in Code Snippets
This code allows you to unhook and remove the default WooCommerce emails. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten […]
Read More →December 31, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. // Change add to cart text […]
Read More →December 11, 2017 in Code Snippets
You can disable product gallery features with the code below. remove_theme_support( 'wc-product-gallery-zoom' ); remove_theme_support( 'wc-product-gallery-lightbox' ); remove_theme_support( 'wc-product-gallery-slider' );
Read More →December 2, 2017 in Code Snippets
By default, WordPress strips HTML from category descriptions. This code will prevent that from happening. The first part prevents HTML from being stripped from term descriptions. The second part prevents HTML being stripped out when using the term description function. Add this code to your child theme’s functions.php file or via a plugin that allows […]
Read More →October 16, 2017 in Code Snippets
The following useful function is found in the includes/wc-core-functions.php and can be used by themes and plugins. Takes a measurement (dim) measured in WooCommerce’s dimension unit and converts it to the target unit ($to_unit). wc_get_dimension( 10, 'lbs' )
Read More →October 10, 2017 in Code Snippets
The following useful function is found in the includes/wc-core-functions.php and can be used by themes and plugins. Used to send an email using the WooCommerce email templates. wc_mail( $to, $subject, $message, $headers = "Content-Type: text/htmlrn", $attachments = "" )
Read More →September 29, 2017 in Code Snippets
Currently, when using the Checkout block from the WooCommerce Blocks plugin, there’s no check if the billing or shipping address field contains a house number. The following code snippets allow to check if these fields contain a number. To check if the billing address contains a house number, please use the following code snippet: add_action( […]
Read More →September 9, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Add a 1% surcharge […]
Read More →September 7, 2017 in Code Snippets
add_theme_support( 'woocommerce', array( 'thumbnail_image_width' => 200, 'gallery_thumbnail_image_width' => 100, 'single_image_width' => 500, ) );
Read More →August 29, 2017 in Code Snippets
This snippet adds UK postal counties to WooCommerce’s list of states. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely […]
Read More →August 20, 2017 in Code Snippets
The placeholder image can now be set at: WooCommerce > Settings > Products as of version 3.5x. WooCommerce 3.4x or earlier Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your […]
Read More →July 13, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Add a 1% surcharge […]
Read More →May 29, 2017 in Code Snippets
Filter hooks are called throughout are code using apply_filter( ‘filter_name’, $variable );. To manipulate the passed variable, you can do something like the following. add_filter( 'filter_name', 'your_function_name' ); function your_function_name( $variable ) { // Your code return $variable; } With filters, you must return a value.
Read More →May 21, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Prevent PO box shipping […]
Read More →May 16, 2017 in Code Snippets
This example code shows how you can add an order option for ‘random’, but this also works in similar ways for other ways to order your products on the catalog page. Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky […]
Read More →May 13, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. To display the cart contents and […]
Read More →May 5, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. By default, WooCommerce blocks non-admin users […]
Read More →April 27, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. The following snippet will replace the […]
Read More →April 20, 2017 in Code Snippets
To add a custom field value to WooCommerce emails use the following snippet. /* To use: 1. Add this snippet to your theme's functions.php file 2. Change the meta key names in the snippet 3. Create a custom field in the order post – e.g. key = "Tracking Code" value = abcdefg 4. When next […]
Read More →February 20, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. Use the following snippet to change […]
Read More →January 22, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. add_filter( 'woocommerce_enqueue_styles', '__return_false' );
Read More →January 15, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. /** * Rename a country */ […]
Read More →January 10, 2017 in Code Snippets
Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Dessky Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be overwritten completely when you update the theme. Use the following snippet to rename […]
Read More →January 3, 2017 in Code Snippets
We’ll go over doing this through individual functions, but you should probably create a Class that stores all of your settings methods. The first thing you need to is add the section, which can be done like this by hooking into the woocommerce_get_sections_products filter: /** * Create the section beneath the products tab **/ add_filter( […]
Read More →December 8, 2015 in Code Snippets
What if you just want to automatically complete all of the orders that come in? The following code snippet will do just that!
Read More →December 7, 2015 in Code Snippets
If you want people to see the shipping fields by default, you want that section ALWAYS visible. Here’s how you do it.
Read More →December 7, 2015 in Code Snippets
Sometimes client will ask you to promptly add some text at the top of cart page and they will have to change this text often.
Read More →December 7, 2015 in Code Snippets
Below is a quick snippet on how to change link on the “Continue Shopping” button in cart. Hope you will find it helpful.
Read More →December 7, 2015 in Code Snippets
You will usually find one or more menu items that you don’t want to show to your guest posters. How do you hide them?
Read More →December 7, 2015 in Code Snippets
Sometimes you’ll need to automatically check the payment status and mark an order as completed.
Read More →December 6, 2015 in Collections
This is collection of the best Ecommerce WordPress Themes on the market. Themes are specially handpicked and tested by our development team and you can not make any mistake by choosing any of them for your online store.
Read More →June 27, 2014 in Themes
Yolee is a Flat Responsive Multi-Purpose WooCommere Theme with many layout options and unlimited color variations.
Read More →May 5, 2014 in Code Snippets
May 5, 2014 in Code Snippets
This code snippet lets you change the main label for either the Billing Address section or Shipping Address section.
Read More →January 9, 2014 in Themes
NanoShop is a Responsive Multi-Purpose WooCommere Theme with many layout options and unlimited color variations.
Read More →December 19, 2013 in Themes
NanoShop Lite is FREE version of the Premium NanoShop Theme and it offers lightweight yet powerful functionality.
Read More →November 5, 2013 in Themes
MiniMart is a unique eCommerce theme with flat and metro elements built specifically for WooCommerce.
Read More →July 8, 2013 in Blog
A new version of our WooCommerce Theme – WooShop – Version 2.0 – has been released. Theme improvements include: WordPress 3.5.2 Ready, WooCommerce 2+ Ready
Read More →May 3, 2013 in Blog, Code Snippets
The beauty of code snippets is their ability to save you time when developing a site. If you are a WooCommerce developer you may find this snippet usefull for Coupons listing.
Read More →