'; } /** * Change the size of the "add to cart" button. * @return string Can be 'btn-xs', 'btn-sm', or 'btn-lg'. */ function shop_add_to_cart_button_size() { return 'btn-lg'; } /** * Change the type of the "add to cart" button. * @param string $type The current button type * @return string Can be 'btn-default', 'btn-primary', 'btn-success', 'btn-info', 'btn-warning', 'btn-danger', or 'btn-link'. */ function shop_add_to_cart_button_type( $type ) { return 'btn-primary'; } /** * Change the URL of the login from the traditional WP * Login page to the WC My Account page instead. * @param string $url The current URL used for logging in * @return string The desired URL used for logging in */ function shop_change_login_url( $url ) { $page = get_page_by_path( 'my-account' ); if ( !empty( $page ) ) { return $page->guid; } return $url; } /** * Change the tab title text that appears directly on the description tab. * @param string $text The current text used for the title * @return string The desired text used for the title */ function shop_change_product_description_tab_title( $text ) { return __( 'More Details', 'bpq' ); } /** * Change the heading text that appears in the description tab pane. * @param string $text The current text used for the heading * @return string The desired text used for the heading */ function shop_change_product_description_heading( $text ) { return __( 'Detailed Description', 'bpq' ); } /** * Change the size of various headings found within the shop. * @param array $size The current heading size (e.g. 'h1', 'h2', etc) * @param string $context Some text that describes which heading is being queried * @return array The desired heading size. */ function shop_change_product_subheadings_size( $size, $context ) { switch ( $context ) { case 'upsell': return 'span'; } return 'h4'; } /** * Change the arguments used for displaying related products. * @param type $args Can update 'posts_per_page', 'columns', or 'orderby' * @return array The desired arguments */ function shop_change_related_product_args( $args ) { $args['posts_per_page'] = 4; $args['columns'] = 4; return $args; } /** * Displays the disclaimer under the single-product page's image. * Typically, this will include a note about the image being "stock". */ function shop_display_image_disclaimer() { // OPTION: Stock image $opt_stock_image = get_theme_mod( 'bpq_opt_shop_display_stock_image_disclaimer', 0 ); if ( empty( $opt_stock_image ) ) return; // Making it here means it is fine to display the disclaimer. echo '
'.__( 'Stock Image', 'bpq' ).'
'; } /** * Based on the BPQ setting, this function could remove the * result count from the catalog page. */ function shop_display_result_count() { // OPTION: Display $opt_display = get_theme_mod( 'bpq_opt_shop_display_result_count', 1 ); if ( empty( $opt_display ) ) { remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); } } /** * Based on the BPQ setting, this function could remove the * sort options from the catalog page. */ function shop_display_sort_options() { // OPTION: Display $opt_display = get_theme_mod( 'bpq_opt_shop_display_sort_options', 1 ); if ( empty( $opt_display ) ) { remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); } } /** * Displays the current stock level of a product on the catalog/archive pages. * @global WC_Product $product * @link http://envy.krolyn.com/tutorial/stock-status-shop-catalog/ */ function shop_display_stock() { // OPTION: Display $opt_display = get_theme_mod( 'bpq_opt_shop_display_catalog_stock_status', 0 ); if ( empty( $opt_display ) ) return; // Assume out of stock with the defaults to help increase efficiency. $stock_class = 'outofstock'; $msg = __( 'Out of stock', 'bpq' ); // The product could be in-stock, which will require change. global $product; if ( $product->is_in_stock() ) { $stock_class = 'instock'; $msg = __( 'In stock', 'bpq' ); if ( $product->managing_stock() ) $msg = sprintf( __( '%d in stock', 'bpq' ), $product->get_stock_quantity() ); } // Display the markup. echo ''. $msg. ''; } /** * Changes the icon for WC products from a pencil (or whatever * the default BPQ post icon is) to shopping tags. * @param string $icon The FA markup that represents the current icon * @return string The FA markup for the desired icon */ function shop_icon( $icon ) { if ( get_post_type() == 'product' ) { return ''; } return $icon; } /** * Identifies the location, in the parent/child theme, of template * files that override WC template files. * @return string The desired path location off of a parent/child theme */ function shop_template_path() { return 'templates/woo/'; } ?>