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 of upsells output. | |
| */ | |
| function wb_change_number_related_products( $args ) { | |
| $args['posts_per_page'] = 1; | |
| $args['columns'] = 4; // change number of upsells here. | |
| return $args; | |
| } | |
| add_filter( 'woocommerce_upsell_display_args', 'wb_change_number_related_products', 20 ); |
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 the placeholder image. | |
| */ | |
| function wb_woocommerce_placeholder_img_src( $src ) { | |
| $upload_dir = wp_upload_dir(); | |
| $uploads = untrailingslashit( $upload_dir['baseurl'] ); | |
| // replace with path to your image. | |
| $src = $uploads . '/2012/07/thumb1.jpg'; | |
| return $src; |
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
| .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; | |
| } | |
| .form-row.woocommerce-validated .chzn-single, | |
| .form-row.woocommerce-validated .chzn-drop, | |
| .form-row.woocommerce-validated input.input-text, | |
| .form-row.woocommerce-validated select { |
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
| if ( ! function_exists( 'is_woocommerce_activated' ) ) { | |
| /** | |
| * Check if WooCommerce is activated. | |
| */ | |
| function is_woocommerce_activated() { | |
| if ( class_exists( 'woocommerce' ) ) { | |
| return true; | |
| } else { | |
| return 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
| <?php | |
| /** | |
| * Create admin product tab at single groups page. | |
| * | |
| * @return void | |
| */ | |
| function wbcom_add_admin_product_nav_at_single_group_page() { | |
| global $bp; | |
| /* Add some group subnav items */ | |
| $user_access = 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
| <?php | |
| /** | |
| * Create a custom url for groups directory. | |
| */ | |
| function wbcom_create_custom_bp_url( $path ) { | |
| $user_ids = get_current_user_id(); | |
| $username = bp_core_get_user_displayname( $user_ids ); | |
| $path = 'members/' . $username . '/groups/'; | |
| return $path; | |
| } |
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 | |
| ** | |
| * Added to group automattic after succesfull user registration. | |
| * | |
| * @param string $user_id Get a user id. | |
| */ | |
| function wbcom_add_user_to_group_after_registration( $user_id ) { | |
| if ( ! function_exists( 'groups_join_group' ) ) { | |
| 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
| <?php | |
| /** | |
| * Woocommerce product count from product archive category page. | |
| * | |
| * @return void | |
| */ | |
| function wbcom_remove_product_result_count_from_category_page() { | |
| if ( is_product_category() ) { | |
| remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); | |
| } |