Title: webdev00's Replies | WordPress.org

---

# webdev00

  [  ](https://wordpress.org/support/users/webdev00/)

 *   [Profile](https://wordpress.org/support/users/webdev00/)
 *   [Topics Started](https://wordpress.org/support/users/webdev00/topics/)
 *   [Replies Created](https://wordpress.org/support/users/webdev00/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/webdev00/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/webdev00/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/webdev00/engagements/)
 *   [Favorites](https://wordpress.org/support/users/webdev00/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/users/webdev00/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/webdev00/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YITH WooCommerce Compare] Don't show "compare" on quotable products](https://wordpress.org/support/topic/dont-show-compare-on-quotable-products/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/dont-show-compare-on-quotable-products/#post-7435438)
 * `return $product->price > 1;`
 * actually.
 * dunno what’s going on. wordpress can’t seem to make up it’s mind which way it
   wants to count.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YITH WooCommerce Compare] Don't show "compare" on quotable products](https://wordpress.org/support/topic/dont-show-compare-on-quotable-products/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/dont-show-compare-on-quotable-products/#post-7435437)
 * Hi maybe I can work this out myself but I don’t see an if condition there.
 * The above code accomplishes the opposite of what I want : the compare button 
   is on the price = 0 products only.
 * I want it to be on the price > 0 products only.
 * Thank you.
 * EDIT :
    `return $product->price < 1;` this did the job
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YITH Essential Kit for WooCommerce #1] Child Theme Intergration](https://wordpress.org/support/topic/child-theme-intergration/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/child-theme-intergration/#post-7439629)
 * ok thank you!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Child Themes and plugins](https://wordpress.org/support/topic/child-themes-and-plugins-1/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/child-themes-and-plugins-1/#post-7457308)
 * ok guys thanks !
 * I’ll just edit the plugin files directly.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YITH WooCommerce Advanced Reviews] Star order from 5 to 1](https://wordpress.org/support/topic/star-order-from-5-to-1/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/star-order-from-5-to-1/#post-7435387)
 * I hacked a way of doing this by editing a Js file
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YITH Essential Kit for WooCommerce #1] Child Theme Intergration](https://wordpress.org/support/topic/child-theme-intergration/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/child-theme-intergration/#post-7439576)
 * yeah that’s it.
 * here as you can see I currently have a working override of my woocommerce plugin
   in my child theme (I deleted the attempt I made at overriding a YITH plugin :
   
   [http://i.imgur.com/ZgQhJQj.png](http://i.imgur.com/ZgQhJQj.png)
 * and here is my YITH essential kit tree:
    [http://i.imgur.com/MnQZ0aO.png](http://i.imgur.com/MnQZ0aO.png)
 * If I try to reproduce this hiarchy in my child theme like I did with woocommerce,
   nothing happens.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Instead of lightbox set main picture to clicked picture in gallery list](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/#post-7419427)
 * wow!
 * I’d love to do that, actually!
 * how would that be done?
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Instead of lightbox set main picture to clicked picture in gallery list](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/#post-7419420)
 * Wow!
 * Holy Moly someone should really pin this thread.
 * I can see it being useful to a lot of people.
 * Thanks man, you’re an angel!
 * I also added this bit of CSS :
 *     ```
       #centralimage{
           min-height: 50vh;
       }
       ```
   
 * to prevent flashing into place of the elements below the central image during
   the time it was empty (a millisecond).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YITH Request a Quote for WooCommerce] Have a resonable ammount of text for quote added](https://wordpress.org/support/topic/have-a-resonable-ammount-of-text-for-quote-added/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/have-a-resonable-ammount-of-text-for-quote-added/#post-7438302)
 * fixed with css :
 *     ```
       .yith_ywraq_add_item_response .yith_ywraq_add_item_response_message,
       .yith_ywraq_add_item_browse-list .yith_ywraq_add_item_browse_message{
           display :none;
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YITH WooCommerce Advanced Reviews] make review stars visible always](https://wordpress.org/support/topic/make-review-stars-visible-always/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/make-review-stars-visible-always/#post-7435759)
 * I found out how to solve my issue.
 * I edited the get_product_rating_html function at line 1499 in class.yith-woocommerce-
   advanced-reviews.php in /wp-content/plugins/yith-essential-kit-for-woocommerce-
   advanced-reviews :
 *     ```
       public function get_product_rating_html ( $rating_html, $rating ) {
                   global $product;
                   $rating_html = '';
   
                   $rating = $this->get_average_rating ( $product->id );
                   $noreview = '';
                   if ( ICL_LANGUAGE_CODE=='en' ){ $noreview = "No reviews yet";}
                   else { $noreview = "Pas encore d'avis";}
   
                   if ( $rating > 0 ) {
   
                       $rating_html = '<div class="star-rating" title="' . sprintf ( __ ( 'Rated %s out of 5', 'yith-woocommerce-advanced-reviews' ), $rating ) . '">';
   
                       $rating_html .= '<span style="width:' . ( ( $rating / 5 ) * 100 ) . '%"><strong class="rating">' . $rating . '</strong> ' . __ ( 'out of 5', 'yith-woocommerce-advanced-reviews' ) . '</span>';
   
                       $rating_html .= '</div>';
                   }else{
                       $rating_html = '<div>'.$noreview.'</div>';
                   }
   
                   return $rating_html;
               }
       ```
   
 * now it shows up necessarily and I have it translated depending on the language.
 * I also added :
 *     ```
       .grid4 .star-rating{
           margin: 0!important;
       }
       .star-rating{
           margin: 0!important;
       }
       ```
   
 * to my CSS file in order for the two cases to occupy the same screen space and
   for everything to be lined up.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Instead of lightbox set main picture to clicked picture in gallery list](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/#post-7419412)
 * Ok, here’s where I’m at : I found out I had messed up the architecture of woocommerce
   in my child theme and anyhow I can’t get the edits to these files to show up 
   from my child theme anymore so I’m editing the raw files for now until I figure
   that out.
 * i’m working with product-thumbnails.php and product-image.php :
 *     ```
       <?php
       /**
        * Single Product Thumbnails
        *
        * This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-thumbnails.php.
        *
        * HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
        * will need to copy the new files to your theme to maintain compatibility. We try to do this.
        * as little as possible, but it does happen. When this occurs the version of the template file will.
        * be bumped and the readme will list any important changes.
        *
        * @see 	    http://docs.woothemes.com/document/template-structure/
        * @author 		WooThemes
        * @package 	WooCommerce/Templates
        * @version     2.3.0
        */
   
       if ( ! defined( 'ABSPATH' ) ) {
       	exit; // Exit if accessed directly
       }
   
       global $post, $product, $woocommerce;
   
       $attachment_ids = $product->get_gallery_attachment_ids();
   
       if ( $attachment_ids ) {
       	$loop 		= 0;
       	$columns 	= apply_filters( 'woocommerce_product_thumbnails_columns', 3 );
       	?>
       	<div class="thumbnails <?php echo 'columns-' . $columns; ?>"><?php
   
       		foreach ( $attachment_ids as $attachment_id ) {
   
       			$classes = array( 'zoom' );
   
       			if ( $loop === 0 || $loop % $columns === 0 )
       				$classes[] = 'first';
   
       			if ( ( $loop + 1 ) % $columns === 0 )
       				$classes[] = 'last';
   
       			$image_link = wp_get_attachment_url( $attachment_id );
   
       			if ( ! $image_link )
       				continue;
   
       			$image_title 	= esc_attr( get_the_title( $attachment_id ) );
       			$image_caption 	= esc_attr( get_post_field( 'post_excerpt', $attachment_id ) );
   
       			$single_img = wp_get_attachment_image( $attachment_id, 'shop_single', 0, $attr = array(
       				'title' => $image_title,
       				'alt'   => $image_title,
       			) );
   
       			$image       = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ), 0, $attr = array(
       				'title'	=> $image_title,
       				'alt'	=> $image_title,
       				'onclick'=> "function(){document.getElementById('centralimage').innerHTML = '<img src=\"'$single_img'\" />';}",
       			) );
   
       			$image_class = esc_attr( implode( ' ', $classes ) );
   
       			echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $image, $attachment_id, $post->ID, $image_class );
   
       			$loop++;
       		}
   
       		?></div>
       	<?php
       }
       ```
   
 * and :
 *     ```
       <?php
       /**
        * Single Product Image
        *
        * This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-image.php.
        *
        * HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
        * will need to copy the new files to your theme to maintain compatibility. We try to do this.
        * as little as possible, but it does happen. When this occurs the version of the template file will.
        * be bumped and the readme will list any important changes.
        *
        * @see 	    http://docs.woothemes.com/document/template-structure/
        * @author 		WooThemes
        * @package 	WooCommerce/Templates
        * @version     2.0.14
        */
   
       if ( ! defined( 'ABSPATH' ) ) {
       	exit; // Exit if accessed directly
       }
   
       global $post, $woocommerce, $product;
   
       ?>
       <div class="images">
       	<?php
       		if ( has_post_thumbnail() ) {
       			$image_caption = get_post( get_post_thumbnail_id() )->post_excerpt;
       			$image_link    = wp_get_attachment_url( get_post_thumbnail_id() );
       			$image         = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array(
       				'title'	=> get_the_title( get_post_thumbnail_id() )
       			) );
   
       			$attachment_count = count( $product->get_gallery_attachment_ids() );
   
       			if ( $attachment_count > 0 ) {
       				$gallery = '[product-gallery]';
       			} else {
       				$gallery = '';
       			}
   
       			echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" id="centralimage" class="woocommerce-main-image zoom" title="%s" data-rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_caption, $image ), $post->ID );
   
       		} else {
   
       			echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="%s" />', wc_placeholder_img_src(), __( 'Placeholder', 'woocommerce' ) ), $post->ID );
   
       		}
       	?>
   
       	<?php do_action( 'woocommerce_product_thumbnails' ); ?>
       </div>
       ```
   
 * in this last file I added `id="centralimage"` and removing the href prevents 
   the image from showing up. I don’t know why but the fact that when you click 
   that zone you’re redirected to the image is annoying.
 * as you can see the function shows up although I’m not sure about the syntaxe :
   
   [http://i.imgur.com/swO4C61.png](http://i.imgur.com/swO4C61.png)
 * and so does the id :
    [http://i.imgur.com/001N4ha.png](http://i.imgur.com/001N4ha.png)
 * I’ve tried all the combos of either `src=\"'$single_img'\"`or `src='$single_img'`
   and `document.getElementById('centralimage').innerHTML =` or `document.getElementById('
   centralimage')[0].innerHTML =`
 * but the error continues to show up and I cannot get the central image to change.
   🙁
 * thank you again!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] [Plugin: WooCommerce] Request a quote show correct button](https://wordpress.org/support/topic/plugin-woocommerce-request-a-quote-show-correct-button/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/plugin-woocommerce-request-a-quote-show-correct-button/#post-7423475)
 * plus what’s this then: [https://wordpress.org/support/topic/how-to-remove-total-column-in-request-quote-page?replies=3](https://wordpress.org/support/topic/how-to-remove-total-column-in-request-quote-page?replies=3)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] [Plugin: WooCommerce] Request a quote show correct button](https://wordpress.org/support/topic/plugin-woocommerce-request-a-quote-show-correct-button/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/plugin-woocommerce-request-a-quote-show-correct-button/#post-7423469)
 * I can’t :
 * [https://i.imgur.com/PJVixbh.png](https://i.imgur.com/PJVixbh.png)
 * YITH comes free and but as you can see they deny support to any other than people
   who have purchased their themes not even their plugins.
 * So basically you’re telling me noone will help me.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Instead of lightbox set main picture to clicked picture in gallery list](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/#post-7419390)
 * Hi!
 * Wow I’ve gotta say you’ve been really helpful!!
 * I think we’re really scratching the surface now.
 * I noticed the main image was a Class rather than an id so after testing your 
   code as-is I replaced the onclick with :
    `'onclick'=> "function(){document.getElementsByClassName('
   attachment-shop_single').innerHTML = '<img src=\"$single_img\" />';}",`
 * this did not help much however. in both cases the images show an onclick in the
   chrome dev tools but do not have the “clickable” cursor when hovered and don’t
   do anything when clicked apart for undeclared errors :
    [https://i.imgur.com/d9j6txu.png](https://i.imgur.com/d9j6txu.png)
 * [https://i.imgur.com/UnY6o3k.png](https://i.imgur.com/UnY6o3k.png)
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Instead of lightbox set main picture to clicked picture in gallery list](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/)
 *  Thread Starter [webdev00](https://wordpress.org/support/users/webdev00/)
 * (@webdev00)
 * [10 years ago](https://wordpress.org/support/topic/instead-of-lightbox-set-main-picture-to-clicked-picture-in-gallery-list/#post-7419344)
 * alright!
 * looking better : [https://i.imgur.com/zDi3V2O.png](https://i.imgur.com/zDi3V2O.png)
 * I’m supposing nothing extra would be required in this process if I apply it straight
   to my child theme rather than my theme?
 * I’m going to edit my copied “product-image.php” and “product-thumbnails.php”
   
   to have the onclick attribute.
 * I’ll update to say how it goes.
 * EDIT::
 * I’m supposing that the gallery file is the file I should add the js in :
 *     ```
       <?php
       /**
        * Single Product Thumbnails
        *
        * This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-thumbnails.php.
        *
        * HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
        * will need to copy the new files to your theme to maintain compatibility. We try to do this.
        * as little as possible, but it does happen. When this occurs the version of the template file will.
        * be bumped and the readme will list any important changes.
        *
        * @see 	    http://docs.woothemes.com/document/template-structure/
        * @author 		WooThemes
        * @package 	WooCommerce/Templates
        * @version     2.3.0
        */
   
       if ( ! defined( 'ABSPATH' ) ) {
       	exit; // Exit if accessed directly
       }
   
       global $post, $product, $woocommerce;
   
       $attachment_ids = $product->get_gallery_attachment_ids();
   
       if ( $attachment_ids ) {
       	$loop 		= 0;
       	$columns 	= apply_filters( 'woocommerce_product_thumbnails_columns', 3 );
       	?>
       	<div class="thumbnails <?php echo 'columns-' . $columns; ?>"><?php
   
       		foreach ( $attachment_ids as $attachment_id ) {
   
       			$classes = array( 'zoom' );
   
       			if ( $loop === 0 || $loop % $columns === 0 )
       				$classes[] = 'first';
   
       			if ( ( $loop + 1 ) % $columns === 0 )
       				$classes[] = 'last';
   
       			$image_link = wp_get_attachment_url( $attachment_id );
   
       			if ( ! $image_link )
       				continue;
   
       			$image_title 	= esc_attr( get_the_title( $attachment_id ) );
       			$image_caption 	= esc_attr( get_post_field( 'post_excerpt', $attachment_id ) );
   
       			$image       = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ), 0, $attr = array(
       				'title'	=> $image_title,
       				'alt'	=> $image_title
       				) );
   
       			$image_class = esc_attr( implode( ' ', $classes ) );
   
       			echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', sprintf( '<a href="%s" class="%s" title="%s" data-rel="prettyPhoto[product-gallery]">%s</a>', $image_link, $image_class, $image_caption, $image ), $attachment_id, $post->ID, $image_class );
   
       			$loop++;
       		}
   
       	?></div>
       	<?php
       }
       ```
   
 * but as you can see, instead of an “img” there’s an “a” contaning some sort of
   shortcode : `<a href="%s" class="%s" title="%s" data-rel="prettyPhoto[product-
   gallery]">%s</a>`
 * what do I do?

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/users/webdev00/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/webdev00/replies/page/2/?output_format=md)