This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define( 'WOOCOMMERCE_USE_CSS', false ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Change number or products per row to 3 | |
| add_filter('loop_shop_columns', 'loop_columns'); | |
| if (!function_exists('loop_columns')) { | |
| function loop_columns() { | |
| return 3; // 3 products per row | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 ); | |
| function new_loop_shop_per_page( $cols ) { | |
| // $cols contains the current number of products per page based on the value stored on Options -> Reading | |
| // Return the number of products you wanna show per page. | |
| $cols = 9; | |
| return $cols; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .onecol, .twocol, .threecol, .fourcol, .fivecol, .sixcol, .sevencol, .eightcol, .ninecol, .tencol, .elevencol { | |
| margin-right:3.8%; | |
| } | |
| .onecol { | |
| width: 4.85%; | |
| } | |
| .twocol { | |
| width: 13.45%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hook in on activation | |
| */ | |
| /** | |
| * Define image sizes | |
| */ | |
| function yourtheme_woocommerce_image_dimensions() { | |
| global $pagenow; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * This code should be added to functions.php of your theme | |
| **/ | |
| add_filter( 'parse_query', 'custom_parse_query' ); | |
| function custom_parse_query( $q ) { | |
| if ( !$q->is_post_type_archive() ) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global $woocommerce; | |
| if ( sizeof( $woocommerce->cart->cart_contents) > 0 ) : | |
| echo '<a href="' . $woocommerce->cart->get_checkout_url() . '" title="' . __( 'Checkout' ) . '">' . __( 'Checkout' ) . '</a>'; | |
| endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if ( is_user_logged_in() ) { ?> | |
| <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','woothemes'); ?>"><?php _e('My Account','woothemes'); ?></a> | |
| <?php } | |
| else { ?> | |
| <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login / Register','woothemes'); ?>"><?php _e('Login / Register','woothemes'); ?></a> | |
| <?php } ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php global $woocommerce; ?> | |
| <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a> | |
| // Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php) | |
| add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment'); | |
| function woocommerce_header_add_to_cart_fragment( $fragments ) { | |
| global $woocommerce; | |
| ob_start(); |
OlderNewer