Last active
April 11, 2018 12:58
-
-
Save ejntaylor/10107850 to your computer and use it in GitHub Desktop.
Upsells / Related Product Product Quantity and Columns
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
/* Upsells / Product Columsn | |
* | |
* Delete as per your column amount | |
* | |
*/ | |
/* 3 Columns */ | |
.woocommerce.single-product ul.products li.product,.woocommerce-page.single-product ul.products li.product,.woocommerce.single-product .upsells.products li.product,.woocommerce-page.single-product .upsells.products li.product{width:30.75%} | |
/* 4 Columns */ | |
.woocommerce.single-product ul.products li.product,.woocommerce-page.single-product ul.products li.product,.woocommerce.single-product .upsells.products li.product,.woocommerce-page.single-product .upsells.products li.product{width:22.05%} | |
/* 5 Columns */ | |
.woocommerce.single-product ul.products li.product,.woocommerce-page.single-product ul.products li.product,.woocommerce.single-product .upsells.products li.product,.woocommerce-page.single-product .upsells.products li.product{width:16.9%} | |
/* 6 Columns */ | |
.woocommerce.single-product.details-full-width div.product div.summary,.woocommerce-page.single-product.details-full-width div.product div.summary,.woocommerce.single-product.details-full-width #content div.product div.summary,.woocommerce-page.single-product.details-full-width #content div.product div.summary{width:100%;float:none} |
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
/* Upsells / Related Product Columns */ | |
add_action( 'init', 'raison_product_up_related' ); | |
function raison_product_up_related() { | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); | |
remove_action( 'woocommerce_after_single_product_summary', 'woo_wc_upsell_display', 15 ); | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); | |
remove_action( 'woocommerce_after_single_product_summary', 'woo_wc_related_products', 20); | |
add_action( 'woocommerce_after_single_product_summary', 'raison_woocommerce_output_upsells', 15 ); | |
add_action( 'woocommerce_after_single_product_summary', 'raison_woocommerce_output_related_products', 20); | |
function raison_woocommerce_output_upsells() { | |
woocommerce_upsell_display( 4,4 ); // Display 3 products in rows of 3 | |
} | |
function raison_woocommerce_output_related_products() { | |
woocommerce_related_products(4,4); // 3 products, 3 columns | |
} | |
} // end Upsells/related columns |
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
http://docs.woothemes.com/document/change-number-of-products-per-row/ |
Does this still work for the most recent version of Woo Commerce and WP?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfect!