-
AuthorPosts
-
December 14, 2020 at 5:57 pm #1267226
Hello,
I have a woocommerce site.
I add a product-variation in the cart.
I consult the cart..
I follow the link on the product (a product-variation in this case)
On the single-product page, the correct variation is selected, but the image is not the correct one.
For example: https://lhumeurvagabonde.com/l-humeur-en-ligne/fiole-plante-immergee-30-ml/?attribute_plante=Ruscus+aculeatusI am using the “WooCommerce Additional Variation Images” plugin.
If I deactivate the plugin it’s worse: the images don’t work at all.
Can you help me please ? Any idea ?
thank you in advance
Best regards- This topic was modified 3 years, 11 months ago by PilatInformatique.
December 17, 2020 at 8:46 am #1268038Hey PilatInformatique,
Thank you for the inquiry.
The product gallery seems to be working properly now, showing the appropriate image for the selected variation. Did you set the Enfold > Shop Options > Product Gallery to the second option (Woocommerce 3.0 Product Gallery)?
Best regards,
IsmaelDecember 17, 2020 at 9:37 am #1268049Hey Ismael,
Thank you for your reply.
I didn’t change this option. Anyway I just tried and it doesnt change anything.
The correct image should be the one with only one vial (the one you chose to buy). Following the link https://lhumeurvagabonde.com/l-humeur-en-ligne/fiole-plante-immergee-30-ml/?attribute_plante=Ruscus+aculeatus they are 3 vials. The thing is, the attribute is selected but the image is not,. Wich is confusing.
A way to get around the problem should be to change the link on the product in the cart, removing the “?attribute_plante=Ruscus+aculeatus”
This way the customer could link to the product and nothing is selected, wich is less confusing.
If you have any Idea how to do that ?EDIT : I found this hook :
add_filter('woocommerce_cart_item_permalink','__return_false');
Or by this way less radical :
function addCustomFieldToUrl( $permalink, $cart_item, $cartItemId ) { //echo $permalink ; $tabPermalink = explode("?",$permalink); // Découpe l'URL sur ses "?" $permalink = $tabPermalink[0]; // On ne garde que l'URL avant les paramètres return $permalink; } add_filter('woocommerce_cart_item_permalink', 'addCustomFieldToUrl', 10, 3 ); add_filter('woocommerce_order_item_permalink', 'addCustomFieldToUrl', 10, 3 );
Best regards,
Matthieu- This reply was modified 3 years, 11 months ago by PilatInformatique.
December 21, 2020 at 6:43 am #1268965 -
AuthorPosts
- The topic ‘link to variation product’ is closed to new replies.