Everything posted by jlaks
- Columns For Review Section Of Product Page
-
Columns For Review Section Of Product Page
I was afraid someone was going to say that. But, looking at the single-product-reviews.php file. I see a <div id= > for each. id="reviews" and id="review_form_wrapper". I am hoping something like this would work <?php function my_multi_col { $columns = explode("reviews"); $i = 0; foreach ($columns as $column) { if (($i % 2) == 0) { $return .= '<div id="comments">'; $return .= $column; $return .= '</p></div>'; } if(isset($columns[1])) { $return .= '<div id="review-form-wrapper">'; } } ?>
-
Columns For Review Section Of Product Page
Hi All, Trying to split the review section of my Product Description into 2 columns. It is nested just below the Product Description. The actual reviews in one column and the Add Review form in another column along side it. Site is Wordpress with Woocommerce. To date I have moved the Reviews out of the Tabs and just below the Product Description. Look here https://www.boatpartsforless.com/shop/marpac-fuelwater-separator-filter-7-0860/. So that the page is not so long and I feel looks better in the Reviews I would like to display as mentioned above in Columns. Any push in the right direction will be much appreciated.
-
I want to be seeing review stars
Figured it out. Added: <?php echo comments_template('woocommerce/single-product-reviews'); ?> to Woo's description.php file and only used function remove_woocommerce_product_tabs( $tabs ) { unset( $tabs['reviews'] ); return $tabs; } add_filter( 'woocommerce_product_tabs', 'remove_woocommerce_product_tabs', 98 ); in function.php
- I want to be seeing review stars
-
I want to be seeing review stars
Hi, Found a piece of code and modified it to remove Woo's review tab and then set under the product description. This is what I am using /** * Remove existing tabs from single product pages. */ function remove_woocommerce_product_tabs( $tabs ) { unset( $tabs['reviews'] ); return $tabs; } add_filter( 'woocommerce_product_tabs', 'remove_woocommerce_product_tabs', 98 ); /** * Hook in each tabs callback function after single content. */ add_action( 'woocommerce_after_single_product_summary', 'comments_template' ); Worked like a charm except for one thing which is now driving me crazy to try and figure out. Only in the ADD A REVIEW/YOUR RATE section it has removed Stars for rating system and implemented a number system 12345. Which looks like crap and don't think anyone will know what it is. If I remove my code and reviews go back to the review tab Stars are back for the YOUR RATE. Page example: https://www.boatpartsforless.com/shop/sei-mercruiser-alpha-1-gen-ii-omc-cobra-complete-conversion-kit/ Any help on showing the Stars for YOUR RATE when moved out of tabs will be much appreciated. Joe
-
Product Search Feature for Woocommerce in Wordpress Admin BAr
Lucky_hunter figured it out for me on another Forum. Adding code here for anyone who is looking for something like this. //Add Search To Admin Bar function boatparts_admin_bar_form() { global $wp_admin_bar; $search_query = ''; if ( $_GET['post_type'] == 'product' ) { $search_query = $_GET['s']; } $wp_admin_bar->add_menu(array( 'id' => 'boatparts_admin_bar_form', 'parent' => 'top-secondary', 'title' => '<form method="get" action="'.get_site_url().'/wp-admin/edit.php?post_type=product"> <input name="s" type="text" value="' . $search_query . '" style="height:20px;margin:5px 0;line-height:1em;"/> <input type="submit" style="padding:3px 7px;line-height:1" value="Search Products"/> <input name="post_type" value="product" type="hidden"> </form>' )); } add_action('admin_bar_menu', 'boatparts_admin_bar_form'); Enjoy! Consider this topic closed
-
Product Search Feature for Woocommerce in Wordpress Admin BAr
Hi All, Been trying to do this for awhile with not luck. Came across this piece of code that really looks promising to accomplish what I am looking for. //Add Search To Admin Bar function trazab_admin_bar_form() { global $wp_admin_bar; $wp_admin_bar->add_menu(array( 'id' => 'trazab_admin_bar_form', 'parent' => 'top-secondary', 'title' => '<form method="get" action="'.get_site_url().'/wp-admin/edit.php?post_type=product"> <input name="s" type="text" style="height:20px;margin:5px 0;line-height:1em;"/> <input type="submit" style="height:18px;vertical-align:top;margin:5px 0;padding:0 2px;" value="Search Products"/> </form>' )); } add_action('admin_bar_menu', 'trazab_admin_bar_form'); The rub is it is very close to working as I would like. Except it is to look for posts while anywhere in backend of Wordpress. I need it for products. I did change get_site_url to reflect post_type=product. But it reverts to looking for posts. Any help on this would be much appreciated. BTW: This is were I got the code from http://blog.calcatraz.com/improving-the-wordpress-admin-bar-2048#comment-183329
-
Having Trouble With Function Command Wordpress Retrieving New ID Property
Consider this request closed. Finally figured it out when I simplified it. Here is the code that fixed it. add_action( 'woocommerce_single_product_summary', 'wc_brand_show', 5 ); function wc_brand_show() { $brand = get_post_meta( $product->id, 'brand_field', true ); _e( 'Brand: ', 'woocommerce' ); echo get_post_meta( get_the_ID(), 'brand_field', true ); } Thanks to anyone who was taking a crack at it
-
Having Trouble With Function Command Wordpress Retrieving New ID Property
Hi All, Having a bit a trouble with this code added to themes functions.php file. Trying to add a new Custom Field Wordpress/Woocommerce, in Admin Panel Product>General>Sku and also show it on Single Product Page front end just under the SKU. The Field being added is "Brand". Everything I have so far is working as expected. Field "Brand" has been created and it will save the inputed text. Also The Heading Brand is showing on Frontend. The Problem is retrieving the inputed text. Can not figure out correct call function and keep getting a Fatal error at that line. I am including the code below I am using and Highlighting the line I am having trouble with. // Display Fields add_action( 'woocommerce_product_options_sku', 'wc_brand_product_field' ); function wc_brand_product_field() { woocommerce_wp_text_input( array( 'id' => 'brand_field', 'class' => 'wc_input_sku short', 'label' => __( 'Brand', 'woocommerce' ) ) ); } // Save Fields using WooCommerce Action Hook add_action( 'save_post', 'wc_brand_save_product' ); function wc_brand_save_product( $product_id ) { if ( isset( $_POST['brand_field'] ) ) { if ($_POST['brand_field'] ) if ( $_POST['brand_field'] ) update_post_meta( $product_id, 'brand_field', $_POST['brand_field'] ); } } add_action( 'woocommerce_single_product_summary', 'wc_brand_show', 5 ); function wc_brand_show() { global $product; Do not show this on variable products if ( $product->product_type <> 'variable' ) { $brand = get_post_meta( $product->id, 'brand_field', true ); echo '<div class="woocommerce_brand">'; _e( 'Brand: ', 'woocommerce' ); echo '<span class="woocommerce_brand_field_sku-wrapper">' . woocommerce_product_meta_sku_wrapper( $brand ) . '</span>'; echo '</div>'; } } I have highlighted the line above I am having trouble with. I know I am not pointing to correct ID class. I just can't figure out. If I point it to _price class it works without error but forces numeric layout. Any help on this would be much appreciated. Thanks in advance. Joe
-
Help with h4 Wordpress Theme
Hi Troll Hunter, Worked PERFECTLY!!!!!! THANK YOU! THANK YOU! Web Guru, needed the importants to over-ride a theme function.
-
Help with h4 Wordpress Theme
Hi All, Require a bit of help with h4 headings in my theme. Website:boatpartsforless.com Theme: Yithemes/Regency The problem is, on my shop pages for category headings the theme uses h4. Easily fixed using div.category-name, h4 { text-align: center !important; color: #1C357D !important; font-weight: bold !important; font-size: 20px !important; } to the style preferred. Problem, this is also over-riding h4's through-out theme. I only want to use the style above for Category Page categories. Can I do that with a heading that is used through-out the theme?