-
AuthorPosts
-
August 23, 2023 at 7:24 am #1416910
Hello, support team,
Can you help me? I am having a few problems on my woocommerce productpage: https://irisdepasse.nl/inschrijven/
1. the layout of page looks no good on tablet or mobile
2. one of the product images (herfstcursus) keep showing up in a different size
3. at the end of the page are results of some search, how can I remove these?I hope you can help me out. Tried all different kind of things to get these things fixed, but nothing seems to help…
Thanks a lot.
IrisAugust 23, 2023 at 9:50 am #1416925Hey IrisDepasse,
Thank you for the inquiry.
1.) You can add this css code to correct the layout of the product grid on smaller screens.
@media only screen and (max-width: 768px) { /* Add your Desktop Styles here */ .responsive #top .products .product:nth-child(odd) { clear: none !important; } }
2.) What is the aspect ratio of the product image? Most of the items in the grid have a featured image with an aspect ratio of 16:9.
3.) The “no-products-found” container should not display if there are items in the archive page. Did modify or customize any of the product templates? You can add this css code to temporarily hide the “no-products-found” container.
.post-type-archive .woocommerce-no-products-found { display: none; }
Best regards,
IsmaelAugust 23, 2023 at 10:03 am #1416927Hello Ismael,
Thanks for your quick respons! Will try all this!
Some answers to your questions:
2. The strange thing is, the image size of this product image is exactly the same as the size of the images next to it: 540 x 304 pixels
3. I don’t know what you mean by the archive page nor do I now if modified or customized product templates. Some products I have are displayed on another website (academievoorabstractefotografie.nl) and a link brings people to the product page for this item.
The product is not presented on the overview page. Does that explain things to you?
Thanks for helping me out!
IrisAugust 23, 2023 at 10:19 am #1416930I see a whole lot of coding in my Quick CSS. Could it be one of these codes is causing trouble?
Should I remove this coding, before I add your new suggestions? As I am no web-developer, I’m unable to understand these codes and what they do for my website…
This is what is currently there:
.single-product-main-image {width: 66% !important;}
#top .product div.images img {
width: auto;
margin: 0 auto;
}@media only screen and (max-width:767px) {
.responsive #top #main .sidebar {
display: block !important;
width: 100% !important;
border: 0 !important;
}.responsive #top #main .sidebar .inner_sidebar {
margin-left: 0 !important;
}
}
.avia-button {
background-color:gold!important;
}August 26, 2023 at 7:11 pm #1417201Hi,
Thank you for your patience, the “no-products-found” container is because you have this function at the bottom of your functions.phpfunction custom_pre_get_posts_query( $q ) { $tax_query = (array) $q->get( 'tax_query' ); $tax_query[] = array( 'taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => array( 'cursus' ), // Don't display products in the clothing category on the shop page. 'operator' => 'NOT IN' ); $q->set( 'tax_query', $tax_query ); } add_action( 'woocommerce_product_query', 'custom_pre_get_posts_query' );
Or you can try Ismael’s css.
To correct the Herfstcursus image size try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:#top.archive .thumbnail_container img { height: 324px; }
Best regards,
MikeSeptember 4, 2023 at 11:46 am #1418023Sorry for my late respons.
1. Image size Herfstcursus is corrected now, thanks a lot!
2. About the search function, both your suggestion as Ismaels did not seem to work (or I entered it the wrong way or at the wrong place.
When I add Ismael CSS:
.post-type-archive .woocommerce-no-products-found {
display: none;something is deleted from the search function, but this CSS code also effects the layout of the page.
I tried entering you suggestion in my Quick CSS in the Enfold General Styling:
function custom_pre_get_posts_query( $q ) {
$tax_query = (array) $q->get( ‘tax_query’ );
$tax_query[] = array(
‘taxonomy’ => ‘product_cat’,
‘field’ => ‘slug’,
‘terms’ => array( ‘cursus’ ), // Don’t display products in the clothing category on the shop page.
‘operator’ => ‘NOT IN’
);
$q->set( ‘tax_query’, $tax_query );
}
add_action( ‘woocommerce_product_query’, ‘custom_pre_get_posts_query’ );But that did not do anything.
Can you help me out? I am not a programmer, just a user. So please guide me as detailed as possible.
Thanks, Iris
September 5, 2023 at 6:03 pm #1418191Hi,
Please note that that code should be in your child theme functions.php file in Appearance ▸ Editor and not in your Quick CSS field, please check again.Best regards,
MikeSeptember 11, 2023 at 11:34 am #1418731I’m so sorry… it still does not work.
I placed in in the Appearance Editor. But still this “Not found field”.
There was already some info in the editor. Could that be the reason? Or could it be this text: “Don’t display products in the clothing category on the shop page.”
This is al the info there is in there:
@media only screen and (max-width: 768px) {
/* Add your Desktop Styles here */
.responsive #top .products .product:nth-child(odd) {
clear: none !important;
}
}
post-type-archive .woocommerce-no-products-found {
display: none;
}
function custom_pre_get_posts_query( $q ) {
$tax_query = (array) $q->get( ‘tax_query’ );
$tax_query[] = array(
‘taxonomy’ => ‘product_cat’,
‘field’ => ‘slug’,
‘terms’ => array( ‘cursus’ ), // Don’t display products in the clothing category on the shop page.
‘operator’ => ‘NOT IN’
);
$q->set( ‘tax_query’, $tax_query );
}
add_action( ‘woocommerce_product_query’, ‘custom_pre_get_posts_query’ );For your information: This is in the Enfold Quick CSS. Could that be interfering?
.single-product-main-image {width: 66% !important;}
#top .product div.images img {
width: auto;
margin: 0 auto;
}#top.archive .thumbnail_container img {
height: 324px;
}@media only screen and (max-width:767px) {
.responsive #top #main .sidebar {
display: block !important;
width: 100% !important;
border: 0 !important;
}.responsive #top #main .sidebar .inner_sidebar {
margin-left: 0 !important;
}
}
.avia-button {
background-color:gold!important;
}.product_cat-cursus .single-product-main-image{
width: 30%!important;
}add_action( ‘woocommerce_product_query’, ‘custom_pre_get_posts_query’ );
September 11, 2023 at 12:27 pm #1418735Hi,
I see that you have placed the code that is causing problems in your WordPress ▸ Customize ▸ Additional CSS
This should not be there, please remove.
I also see that you have the same code in your WordPress ▸ Appearance ▸ Theme File Editor ▸ Enfold ▸ functions.php
please also remove this and then check again.
If you are not using a child theme I recommend the WPcode plugin this plugin supports PHP code snippets, JavaScript code snippets, & CSS code snippets, because you will lose the custom code that you add to the enfold ▸ functions.php when you update next time.Best regards,
MikeSeptember 11, 2023 at 12:49 pm #1418742This reply has been marked as private.September 11, 2023 at 6:11 pm #1418788Hi,
Try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:#top.post-type-archive-product .template-shop.content.av-content-full.alpha.units { display: none; }
After applying the css, please clear your browser cache and check.
Best regards,
MikeSeptember 11, 2023 at 6:22 pm #1418789This is so nerve-wracking. Did as you asked, including removing cache. But I still see more than the 8 products I want to display.
And the lay out is different than I planned, which makes the product-images out of proportions. I guess there is margins left and right now that were not there before.
If you can just fix it for me instead of me having to follow instructions that don’t seem to work, I would be very very happy!!!
September 12, 2023 at 12:02 am #1418805Hi,
Thank you for your patience, it looks like you didn’t paste all of the code into the Quick CSS field, the last bracket was missing, I added it for you and now it works.
I think I understand what you have done now, you manually added ALB code to the shop page and want to hide the shop page items that woocommerce wants to add, and that is why when you added the custom code to hide the woocommerce shop items you were seeing the “no-products-found” container.
It looks like the css I added has solved that for you, please check.Best regards,
MikeSeptember 12, 2023 at 6:58 am #1418829Thank you so so much, Mike!!! So glad this “not found” box is away! It looks the way I want it to look now!
At least on my desktop. On my tablet there is no image on Privé-(Foto)bespreking (4th item).
And the product-images on tablet and mobile look so out of proportion. From a landscape image it makes a portrait image. Is there any thing I can do to make it display the landscape image that I made?
I hope you can help me out on that too. So glad you are helping me!
September 12, 2023 at 8:01 am #1418842Hi,
Thank you for the update.
We edited the css code and added a few css media queries to adjust the height of the images on tablet view or smaller screens and prevent distortion.
This is the modified css code.
@media only screen and (min-width: 990px) { #top.archive .thumbnail_container img { height: 324px; } } @media only screen and (min-width: 768px) and (max-width: 989px) { #top.archive .thumbnail_container img { height: 224px; } } @media only screen and (max-width:767px) { .responsive #top #main .sidebar { display: block !important; width: 100% !important; border: 0 !important; } .responsive #top #main .sidebar .inner_sidebar { margin-left: 0 !important; } #top.archive .thumbnail_container img { height: 178px; } }
Please make sure to purge the cache before checking the page.
Best regards,
IsmaelSeptember 12, 2023 at 8:24 am #1418846Thanks Ismael,
Looks good on desktop and mobile phone. Thanks a lot!
On my tablet there is still no image on Privé-(Foto)bespreking (4th item) and the images are still distorted (to sqare size this time). Would be very grateful if you could also fix that.
September 12, 2023 at 8:27 am #1418848Oh, actually the image-aspect ratio is best on mobile phone now. Also still sqeezed on the desktop. It would be great if it would be the same everywhere…
September 12, 2023 at 8:33 am #1418850Hi,
Thank you for following up.
Also still sqeezed on the desktop. It would be great if it would be the same everywhere…
You can adjust the “height” property value as needed in the css rules that we provided above.
On my tablet there is still no image on Privé-(Foto)bespreking (4th item
The image of the Privé-(Foto)bespreking is visible on our end. Would you mind providing a screenshot of the issue? You can use platforms like Savvyify, Imgur or Dropbox to upload and share the screenshot. Here are the steps to follow:
1.) Visit the website of your chosen platform, such as Savvyify, Imgur or Dropbox.
2.) Locate the option to upload a file or an image.
3.) Select the screenshot file from your computer or device and upload it to the platform.
4.) After the upload is complete, you will be provided with a shareable link or an embed code.
5.) Copy the link or code and include it in your message or response to provide us with the screenshot.Thank you for taking the time to share the screenshot. It will help us better understand the issue you’re facing and provide appropriate assistance.
Best regards,
IsmaelSeptember 12, 2023 at 8:46 am #1418855https://docs.google.com/document/d/1pJigbGidhwe8j37JpxLUmDGaDVgUjVm-MLrC4ZfYsN4/edit?usp=sharing
Did it in my clumsy way… Hope it gives you the info you need.
September 12, 2023 at 8:48 am #1418856Hi,
We can’t access the screenshot for some reason. Would you mind using Savvyify, Imgur or Dropbox instead? Please make sure to remove the browser cache before checking the page, or switch to incognito mode.
Best regards,
IsmaelSeptember 12, 2023 at 8:52 am #1418859Ah, heard from a friend that the image is seen on her tablet, so maybe the problem is om my side.
But could you please make the proportions on my desktop and tablet on the same aspect ratio? The original image was: 960 by 540 pxI am not a professional webdeveloper, just a enterpreneur trying to make a living. Things that look simple to you are a huge challenge for me.
So I really would be so pleased if you could do this for me…September 12, 2023 at 9:02 am #1418861Hi,
We adjusted the height of the images as follows, so they retain the aspect ratio of 16:9.
Desktop: 200px
Tablet: 147px
Mobile: 120pxPlease make sure to remove the cache before checking the page.
Best regards,
IsmaelSeptember 15, 2023 at 4:20 pm #1419295Thank you, Ismael. That does the trick for desktop and tablet. On mobile phones the images are suddenly panoramic now.
I would be so happy if you are able to fix that!Have a nice weekend.
September 16, 2023 at 9:46 am #1419318Hmmm…. added a new image to the product-overview. (Second product: Complete Opleiding) It’s torn out of proportions, but even different from the ones next to it. (That are also distorted again).
Can you please have another look at it?
September 17, 2023 at 8:55 pm #1419406Hi,
I see that the image for your product “Complete Opleiding” was cropped even though the uploaded original image seems to be the same size as the others.
It also looked cropped in the product featured image of the backend, so I downloaded it and renamed it and uploaded it to your product again and then it looked correct in the featured image:
and now it looks correct on the frontend:
Perhaps it was just a hickup, it seems to be working correctly now, please check.Best regards,
MikeSeptember 19, 2023 at 5:26 pm #1419604In the Product Image the image looks the way I designed it. 960 x 540 pixels. And it’s improved in the product overview, at least all the text is visible.
But alle the images in the overview are still panoramic instead of landscape on the frontend. Is it possible to have another look at it.
I would be very happy if the product image would have the same aspect ratio as 960 x 540 pixels, on desktop, tablet and mobile.
September 19, 2023 at 6:42 pm #1419613Hi,
I think the issue is because the page has three columns with no max-width, so at 1024px the images only need to fill that space:
where on a large desktop the page width is much more:
so to add a page max width try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:.responsive #top.archive.woocommerce-shop .container_wrap_first > .container { max-width: 1024px; }
Best regards,
MikeSeptember 20, 2023 at 12:16 pm #1419699Thanks a lot!!!! That makes the difference for the desktop & tablet.
Could you also arrange this for mobile, as there it still does not look any good…
September 20, 2023 at 6:06 pm #1419764Hi,
Glad that this helped, for mobile try adding this css and adjust to suit:@media only screen and (max-width: 767px) { .responsive #top.archive.woocommerce-shop #wrap_all .container_wrap_first > .container { max-width: 60%; } }
Best regards,
MikeSeptember 20, 2023 at 7:24 pm #1419767Hi Mike,
The product-image size looks all right now on mobile, but only two out of eight images are displayed, the others generate question marks….
What can I do to solve this problem? -
AuthorPosts
- You must be logged in to reply to this topic.