Sauter la navigation

[Résolu] Product image disappears when using a Views filter

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem: I have a View of Products that seems to work okay until the URL is modified by adding a filter. After that, the Product images do not appear in the View.

Solution: Add the following CSS override:

div.woocommerce-product-gallery--with-images{
    opacity: 1 !important; 
  transition: opacity 0.25s ease-in-out;
}
This support ticket is created Il y a 5 années et 11 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Marqué : 

Ce sujet contient 5 réponses, a 2 voix.

Dernière mise à jour par Pat Il y a 5 années et 11 mois.

Assisté par: Christian Cox.

Auteur
Publications
#1194957

Pat

Hello,

I have created a Views in order to display products and have defined a filter to select products thanks to a specific custom field value.

Here is my filter :

[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="col-sm-6 form-group">
<label>[wpml-string context="wpv-views"]Couleur[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-couleur" url_param="couleur"]
</div>
<div class="col-sm-6 form-group">
<label>[wpml-string context="wpv-views"]Matière[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-matiere" url_param="matiere"]
</div>[wpv-filter-reset output="bootstrap"][/wpv-filter-controls]

[wpv-filter-end]

And the content template :
<div class="textecentre">
<h3 class="titreh3">[wpv-post-title]</h3>
[wpv-woo-product-image size="shop_catalog"]
<table><tr><td class="labelprix">Prix</td><td class="prix">[wpv-woo-product-price]</td></tr>
</table>
VOIR
</div>

The issue I have is that when I'm using this filter, the product images are no more displayed. If I look at the url after having defined a filter, here is what I'm getting (the page used for the Views is catalog) :

catalogue/?matiere=Cuivrecatalogue/?matiere=Cuivre&wpv_view_count=104

If I use this url :
catalogue/?matiere=Cuivre
(without the &wpv_view_count=104), then everything is fine.

Did I miss something?

Let me know
regard
Pat

#1195145

This is an invalid URL structure:
catalogue/?matiere=Cuivrecatalogue/?matiere=Cuivre&wpv_view_count=104

There should only be one "?", and "catalogue" should not be repeated like this. If the View is producing this kind of URL structure, then there may be a JavaScript error somewhere. Try deactivating all plugins except Types, Views, WooCommerce Views, and WooCommerce, and activate a default theme like Twenty Nineteen. Then test again. Let me know what you find out.

#1195163

Pat

Hi Christian,

Thanks for your quick answer.
I have deactivated all plugins except Toolset and WC and still have the issue.
No error reported in the console.
url : catalogue/?couleur=Alu&wpv_view_count=104 (104 is the ID of the used Views)

If I use this url : catalogue/?couleur=Alu, then it's OK.

Regards
Pat

#1195165

Okay that URL looks fine so there must be something else going on. Is the site online? If so, can I log in and take a closer look? If it's not online, I'll need to work with a Duplicator clone. I will activate private reply fields here.

#1195533

I have added this CSS to your View:

div.woocommerce-product-gallery--with-images{
    opacity: 1 !important; 
  transition: opacity 0.25s ease-in-out;
}

Can you check and see if it's working as expected now?

#1196465

Pat

Hi Christian,

Thanks for the help.
That's fine now.
It still not understand why this is happening only when using the filter selection (is you don't use filter selection, then the display is fine !).

Regards
Pat