Top Banner
Customizing WooCommerce #wpm013
31

Customizing Your WooCommerce Store

Jul 16, 2015

Download

Technology

Barry Kooij
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Customizing Your WooCommerce Store

Customizing WooCommerce

#wpm013

Page 2: Customizing Your WooCommerce Store

Customizing WooCommerce

#wpm013

Page 3: Customizing Your WooCommerce Store

Hallo, met Barry

WooCommerce developer @ WooThemes

Related Posts for WordPressDownload MonitorPost ConnectorWhat The File

Page 4: Customizing Your WooCommerce Store

Picking the right Theme

Maintained

No bloat

Easily customizable

Page 5: Customizing Your WooCommerce Store

Storefront

Created by WooThemes

It’s free

Build for WooCommerce

http://www.woothemes.com/storefront/

Page 6: Customizing Your WooCommerce Store
Page 7: Customizing Your WooCommerce Store
Page 8: Customizing Your WooCommerce Store
Page 9: Customizing Your WooCommerce Store

Child Theme It

Extend the power of your theme

Override only that what’s needed

Keep your theme updatable

This is where your custom CSS goes!

Page 10: Customizing Your WooCommerce Store

Plugins

Page 11: Customizing Your WooCommerce Store

Storefront Designer

Change without coding:

- Header- Layout- Buttons- Typography

Page 12: Customizing Your WooCommerce Store

Storefront WC Customizer

Change without coding:

- Header- Product archive page - Product detail page - Homepage

Page 13: Customizing Your WooCommerce Store

On wordpress.org

WooCommerce Product Archive Customiserhttps://wordpress.org/plugins/woocommerce-product-archive-customiser/

WooCommerce Product Details Customiserhttps://wordpress.org/plugins/woocommerce-product-details-customiser/

WooCommerce Customizerhttps://wordpress.org/plugins/woocommerce-customizer/

Page 14: Customizing Your WooCommerce Store

Custom Code

Page 15: Customizing Your WooCommerce Store

Custom Code

Filters

Actions

Template overrides

Page 16: Customizing Your WooCommerce Store

Code Location

Shop related code -> custom plugin

Theme related code -> theme

Page 17: Customizing Your WooCommerce Store

Filters

Change something

879 filters

Page 18: Customizing Your WooCommerce Store

Checkout fields

function dlm_checkout_fields( $fields ) { unset( $fields['billing']['billing_phone'] ); unset( $fields['billing']['billing_address_2'] ); return $fields; } add_filter( 'woocommerce_checkout_fields', ‘dlm_checkout_fields’ );

Page 19: Customizing Your WooCommerce Store

No Order Notes Field

add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );

Page 20: Customizing Your WooCommerce Store

Change ATC Label

function wpm_change_adc_text( $text, $product ) { return 'Yeah Buddy!'; } add_filter( 'woocommerce_product_add_to_cart_text', 'wpm_change_adc_text', 10, 2 );

Page 21: Customizing Your WooCommerce Store

Personalize Thank Youfunction dlm_title_order_received( $title, $id ) { if ( is_order_received_page() && get_the_ID() === $id ) { global $wp; $order_id = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) ); $order_key = apply_filters( 'woocommerce_thankyou_order_key', empty( $_GET['key'] ) ? '' : wc_clean( $_GET['key'] ) ); if ( $order_id > 0 ) { $order = wc_get_order( $order_id ); if ( $order->order_key != $order_key ) { unset( $order ); } } if ( isset ( $order ) ) { $title = sprintf( "Thank you, %s!", esc_html( $order->billing_first_name ) ); } } return $title; } add_filter( 'the_title', 'dlm_title_order_received', 10, 2 );

Page 22: Customizing Your WooCommerce Store

Actions

Do something

486 actions

The power of removing hooks

Page 23: Customizing Your WooCommerce Store

What Happens Next?

function dlm_what_happens_next() { ?> <div class="dlm-what-happens-next"> <strong>What happens next?</strong> <p>After you've completed your payment you'll receive an email containing your license keys and a download links.</p> </div><?php} add_action( 'woocommerce_after_checkout_form', 'dlm_what_happens_next' );

Page 24: Customizing Your WooCommerce Store

Removing Result Count

remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );

Page 25: Customizing Your WooCommerce Store

Template Overrides

Override a template in your theme

105 overridable templates

WooCommerce scans theme for /woocommerce/

Page 26: Customizing Your WooCommerce Store

Template Overrides

For HTML structure changes

Safe but last resort

Template overrides bring maintenance

Page 27: Customizing Your WooCommerce Store

Template Overrides

Find original template

Customize it to your liking

Path in theme:/woocommerce/path_of_original_template

Page 28: Customizing Your WooCommerce Store

Product Short Description

<?phpglobal $post; if ( ! $post->post_excerpt ) return; ?> <div itemprop="description"> <?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?></div>

single-product/short-description.php

Page 29: Customizing Your WooCommerce Store

Product Short Description

<?phpglobal $post; if ( ! $post->post_excerpt ) return; ?> <p itemprop="description"> <?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ) ?></p>

single-product/short-description.php

Page 30: Customizing Your WooCommerce Store

WC System Status

Page 31: Customizing Your WooCommerce Store

Barry Kooij

@CageNL

barrykooij.com