WooFrance Dépannage et support WordPress WooCommerce › Forums › Forum de Support WooCommerce › Problème d'affichage – produits apparentés et produits associés
- Ce sujet contient 11 réponses, 2 participants et a été mis à jour pour la dernière fois par
Arnaud P, le il y a 7 années.
-
AuteurMessages
-
30 août 2018 à 11 h 23 min #6942930 août 2018 à 12 h 47 min #6943730 août 2018 à 16 h 51 min #6947831 août 2018 à 8 h 07 min #69531
Voici un lien qui illustre bien le problème: https://www.liberon.fr/produit/vernis-colle/
Selon moi, c’est lié aux classes des produits qui sont différentes selon l’affichage et engendrent des tailles d’images différentes.
31 août 2018 à 8 h 40 min #6953631 août 2018 à 8 h 44 min #6953731 août 2018 à 9 h 13 min #6955131 août 2018 à 9 h 26 min #69554j’ai fait une erreur de frappe dans mon message précédent, je voulais dire qu’il y a une classe
====================columns-4
à modifier en « columns-3 ».
si vous trouvez le fichier qui génère cela, vous réglerez peut-être le problème plus efficacement parce qu’en modifiant le CSS, vous pouvez perturber l’effet responsif d’affichage des images en colonnes.
31 août 2018 à 10 h 07 min #6956131 août 2018 à 12 h 31 min #69587le fichiers template sont des fichiers PHP qui personnalisent des parties d’affichage de WooCommerce :
====================
https://docs.woocommerce.com/document/template-structure/
7 septembre 2018 à 13 h 11 min #70284Bonjour,
Après quelques recherches, je pense que l’erreur doit provenir de ce fichier (woocommerce/templates/single-product/product-image.php) ?
====================<?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 https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.3.2
*/
defined( ‘ABSPATH’ ) || exit;
// Note:wc_get_gallery_image_html
was added in WC 3.3.2 and did not exist prior. This check protects against theme overrides being used on older versions of WC.
if ( ! function_exists( ‘wc_get_gallery_image_html’ ) ) {
return;
}
global $product;
$columns = apply_filters( ‘woocommerce_product_thumbnails_columns’, 4 );
$post_thumbnail_id = $product->get_image_id();
$wrapper_classes = apply_filters( ‘woocommerce_single_product_image_gallery_classes’, array(
‘woocommerce-product-gallery’,
‘woocommerce-product-gallery–‘ . ( has_post_thumbnail() ? ‘with-images’ : ‘without-images’ ),
‘woocommerce-product-gallery–columns-‘ . absint( $columns ),
‘images’,
) );
?>» data-columns= »<?php echo esc_attr( $columns ); ?> » style= »opacity: 0; transition: opacity .25s ease-in-out; »>
<figure class= »woocommerce-product-gallery__wrapper »>
<?php
if ( has_post_thumbnail() ) {
$html = wc_get_gallery_image_html( $post_thumbnail_id, true );
} else {
$html = ‘‘;
$html .= sprintf( ‘‘, esc_url( wc_placeholder_img_src() ), esc_html__( ‘Awaiting product image’, ‘woocommerce’ ) );
$html .= ‘‘;
}
echo apply_filters( ‘woocommerce_single_product_image_thumbnail_html’, $html, $post_thumbnail_id );
do_action( ‘woocommerce_product_thumbnails’ );
?>
</figure>
-
AuteurMessages
- Vous devez être connecté pour répondre à ce sujet.