This file contains 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
/* | |
1 - modify your theme functions file | |
2 - modify the 'loop-shop.php' file | |
You need to set the 'Product List' value to suit your layout. You will also need to look at changing the CSS if you change from the default WooCommerce values. | |
1 : Add this to your theme functions file | |
*/ | |
add_filter('loop_shop_columns', 'wc_product_columns_frontend'); | |
function wc_product_columns_frontend() { | |
global $woocommerce; |
This file contains 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 | |
add_filter( 'request', 'custom_product_filter' ); | |
function custom_product_filter( $vars ) { | |
global $wpdb, $pagenow, $typenow, $wp_query, $woocommerce; | |
$product_check = ''; | |
$product_check = $_GET['product_check']; | |
if ( $typenow == 'shop_order' && isset($product_check) && $product_check > 0 ) : |
This file contains 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( 'woocommerce_get_catalog_ordering_args','custom_query_sort_args' ); | |
function custom_query_sort_args() { | |
// Sort by and order | |
$current_order = ( isset( $_SESSION['orderby'] ) ) ? $_SESSION['orderby'] : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); | |
switch ( $current_order ) { | |
case 'date' : | |
$orderby = 'date'; | |
$order = 'desc'; |
This file contains 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 | |
/** | |
* Loop Add to Cart | |
*/ | |
global $product; | |
if( $product->get_price() === '' && $product->product_type != 'external' ) return; | |
?> |
This file contains 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 | |
add_filter( 'woocommerce_is_sold_individually', 'cj_woocommerce_is_sold_individually', 10, 2 ); | |
function cj_woocommerce_is_sold_individually( $value, $product ) { | |
$isi = get_post_meta( $product->id, '_custom_sell_individually', TRUE ); | |
if ( $isi == 'individual' ) : | |
$return = true; | |
endif; |
This file contains 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 | |
add_action( 'init', 'custom_ppp_filter' ); | |
function custom_ppp_filter() { | |
add_filter( 'loop_shop_per_page','custom_query_ppp_args' ); | |
} | |
// Posts Per Page Args | |
function custom_query_ppp_args() { | |
// Posts Per Page |
This file contains 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 | |
add_action( 'woocommerce_after_shop_loop_item','show_rating_stars' ); | |
add_action( 'woocommerce_single_product_summary','show_rating_stars',15 ); | |
function show_rating_stars() { | |
global $woocommerce,$post, $wpdb; | |
if ( comments_open() ) : | |
$count = $wpdb->get_var(" |
This file contains 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 | |
// Single Product | |
add_filter( 'single_add_to_cart_text', 'custom_single_add_to_cart_text' ); | |
function custom_single_add_to_cart_text() { | |
return 'Add to cart'; // Change this to change the text on the Single Product Add to cart button. | |
} | |
// Variable Product | |
add_filter( 'variable_add_to_cart_text', 'custom_variable_add_to_cart_text' ); |
This file contains 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 | |
// Edit wp-content/themes/whitelight-commerce/functions.php | |
// Find this on or around line 60 | |
$new_options[] = array( "name" => "Number of Products", | |
"desc" => "Select the number of products that should appear in the shop area on the home page.", | |
"id" => $shortname."_shop_area_entries", | |
"std" => "3", | |
"class" => "hidden", | |
"type" => "select", | |
"options" => $other_entries); |
This file contains 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
/**** | |
* Paste this into your custom functions file | |
* 100% should work but you may need to adjust for each browser seperately | |
*/ | |
function customloadcss() { | |
$return .= "<!-- Loading CSS -->" . "\r\n"; | |
$return .= "<!--[if IE 7]>" . "\r\n"; | |
$return .= "<style>" . "\r\n"; |
OlderNewer