• Resolved valerieskye1

    (@valerieskye1)


    Hello, I would love some help please.

    As the title suggests I have created a child theme for the first time and entered this code into functions.php

    function myfunc_product_img_link_start(){
    	global $product;
    	$link = apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product );
    	echo '<a href="'.esc_url( $link ).'">';
    }
    add_action('woocommerce_before_shop_loop_item_title', 'myfunc_product_img_link_start', 5);
    
    function myfunc_product_img_link_close(){
    	echo '</a>';
    }
    
    add_action('woocommerce_before_shop_loop_item_title', 'myfunc_product_img_link_close', 15);
    
    I then added this to the customise CSS section
    
    li.product .product-thumb-wrap::before {
        display: none !important;
    }
    .custom_item_img_link::before{
        content: " ";
    	position: absolute;
    	height: 100%;
    	width: 100%;
    	background: #fa6161;
        -webkit-transition: 0.4s ease-in-out;
        -moz-transition: 0.4s ease-in-out;
        -o-transition: 0.4s ease-in-out;
        transition: 0.4s ease-in-out;
        opacity: 0;
    }
    li.product:hover .custom_item_img_link::before {
        opacity: 0.8;
    }
    
    

    It has worked my product images are clickable! However when I hover over the image before I click it a pink block appears which is the size of the entire image + writing together but appears starting in the middle of the image and goes to the right. Very odd.

    I know very little so would love it spelling out to me.

    Thanks so much!

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter valerieskye1

    (@valerieskye1)

    Hello, Thank you for your reply. Sorry my reply is late haha had an absaloute nightmare with error after error lol.

    Ahh yeah I thought that may be the case!

    Oo yeah that’s a good point you raise there and I’m glad helping others helps yourself too, and keeps your knowledge base high.

    I will certainly try the plugin you recommend ?? thank you kindly for the thorough details on that.

    So I spoke to the host about 2 issues, server speed and my media thumbnails backend not showing, and that’s where things started going wrong over the last 24 hours. Firstly they say my server speed is fine so that’s great, she clears my cache too on the host end. I go off live chat to find my privacy protection isn’t working think it was the SSL. SO I hop straight back onto LC and they end up having to point my domain name back to the server and say it may take a while for propagation. I go off lc to edit my site but it cant be accessed so I hop back on again and fix that for me and I mention the media thumbnails and they say it should come back when SSL comes back. Well today here I am SSL is back but not the media thumbnails, after speaking to LC she says just put up with it or reupload images. So I decide okay ill put up with it. But I go back to my site and she has installed big image thingy and default to GD plugin, I go to my front end and I have a double image issue which I had weeks ago. Devastated. So I go back into my parent theme and the code that I once changed from ‘.card-product.pop-and-glow .card-image{
    overflow:visible
    }’ to ‘.card-product.pop-and-glow .card-image{
    overflow:visible;
    display: none;
    }’ is back to the original…… very frustrating. So I change it to the code that solved the double image issue the first time. The first time it took an hour until it worked apparently due to browser cache? I have waited an hour and the issue is not solved (Perhaps I also need to edit css in my child theme).

    This is now my main problem. If I can solve this I am sorted and pretty much ready to launch haha (Not slept all night lol).

    Sorry for the long message, basically I wont be going on LC again if I can avoid it as they keep messing about with my plugins and stuff without asking lol.

    Any advice is much appreciated.

    Thank you so so much.

    # Edit I tweaked the code slightly and that issue is solved no more double images lol. Although now front end when someone clicks on a product the subsequent gallery images sometimes appear 10x smaller, ill play about with plugins see if I can sort that haha.

    Thread Starter valerieskye1

    (@valerieskye1)

    So close to launching eeek haha exciting.

    Moderator bcworkz

    (@bcworkz)

    So close to launching…

    Does that mean the issues have been resolved, or that it’s limited to the back end so you’ll just suffer with the issues?

    That was quite the story of your live chat experience. I’m sorry it was so stressful.

    Is there still something I might be able to help you with? I’ll volunteer one thing I’ve noticed:

    I’m sure you’ve also noticed the shop page cards are sometimes not quite aligned in some cases. This is related to product title length. The possible options to resolve this aren’t ideal. One option is to adjust titles so they’re similar length (even if it means adding whitespace). But unless they’re almost all exactly the same, there will always be discrepancies at some screen widths.

    The other option is to force the card height to stay fixed (CSS height rules) regardless of content. It’s difficult to arrive at the right height when the screen widths can be almost anything. You end up with content either being clipped or with excessive whitespace to ensure nothing gets clipped.

    The final option is to let it go. Not much of an option, but one all the same.

    Thread Starter valerieskye1

    (@valerieskye1)

    Hello,

    My apolagies, but yes what it means is I’m almost happy with the visuals of the site and I can therefore just work on the backend. Also, I have an arbitrary goal of launching this weekend maybe Sunday (also in agreement with the gorilla org).

    Haha thank you yeah it was mental.

    Yes please, I would love your advice on my product gallery images. When I click on a product on my store (front end) and swipe through the gallery of images, sometimes (randomly) they will be 1 10th the size and then ill check again a few mins later and its normal size… If you have any ideas I would love to hear them hehe.

    Secondly, I have reached out to the developer of the tp image flipper plugin as they provided me with code to sort out the double image issue but as a result it disables the default image, this is all fine unless I want to have the shop page/products display on my home/front page (where there wont be any accompanying image with the product). We will see if he can help but feel free to offer any advice ?? The code used is the one I posted previously. Basically, I need to enable the product image on the shop page only or something.

    I am currently updating my terms and conditions regarding returns, I may also make a FAQ page.

    Then I will be 100% focussed on improving site speed as well as editing visuals before launch. – I may go through all my product images and re-upload them in JPEG instead of PNG and use tinyjpg to make the file size smaller.

    Then I will email 2 similar sites and ask if they want to collaborate either offering me affiliate links or to integrate their products so I can use them as upsells (bath bombs and such likes).

    Then I launch (basically site map as its already live)

    I will then launch the social media accounts & focus on getting ads on the site (don’t think it will take long as I already set up a google ads account).

    In regards to your advice you volunteered, I totally agree and have also noticed this issue, I have made a note and will probably do the white spaces suggestion thank you. I did struggle with titles…. they are very lengthy but its because I was told not to use the same key word in each product e.g ethical t-shirt so my next one was ethical shirt, then sustainable t-shirt etc etc, it got really tricky considering I had a different product page for each colour variation hahaha.

    Do you think on my homepage all my images should be the same size? Some are landscape some portrait.

    Thanks in advance for any feedback you give, you have been a godsend!

    Thread Starter valerieskye1

    (@valerieskye1)

    I am a bit stuck. on my shop page page 2 first product, I tried editing it because the image behind the front image that you see when you hover your mouse over it was a lot smaller than the one in front (which was also too small compared to the other images) making it not align right. I decided to reupload their images since they arent in my media anymore, first I changed them to JPG and shrank their file size. This may have made it worse but its likely all the image plugins and code I have, I cant seem to get them to align right with the other thumbnails, that all size up right.

    It seems I keep making things worse…. after 12 hours my head is done in for the day haha. I may even end up giving up lol this is crazyness ?? we will see tomorrow though.

    Moderator bcworkz

    (@bcworkz)

    I hope things are looking brighter today. It appears many of the shop page images are different sizes, hence the erratic card sizing. (Title length is still a factor too). I recommend pre-processing images before upload to ensure they are all of the same aspect ratio, if not all of the same size. Depending on how your standard image sizes are set up (usually by your theme or the default ones specified in media settings), WP will crop some sizes to force a certain aspect, but IMO it’s better to upload consistent images to start with.

    With my own images, the originals need to be scaled smaller anyway, plus there are often cropping, levels and color adjustments needed, so ensuring they’re the right size as well isn’t much of an extra task. I’m fussy about cropping and don’t let WP auto-crop anything.

    Seeing as we’ve wandered off the OP topic here and the current issue is more fitting for your image size topic, and that AFAICT this OP topic at least resolved, I’m going to mark this topic as resolved and unsubscribe. See you over at your image size topic ??

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Clickable product thumbnail error’ is closed to new replies.