Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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+aculeatus

    I 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

    #1268038

    Hey 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,
    Ismael

    #1268049

    Hey 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

    #1268965

    Hi,

    Glad to know that you have found a solution. Please feel free to open a new thread if you need anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘link to variation product’ is closed to new replies.