Welcome to the support center for

Fancy Product Designer & Multistep Product Configurator

Answered

customized product thumbnail in order email?

Hi,

I have the problem that the procuct thumbnail in woocommerce order e-mail ist not the customized one. It is showing the basic procut image instead of the customized product. Is there any way to achieve this?

Answer

With the plugin as it is currently not, no sorry. You could make a feature request for this or support and existing one (I have not checked for one).

My clients are certainly curious about getting images of the customized product in the order confirmation email....please add this feature!

I am close to have this done. Are you interested in the code?

Please, yes share the code. I can go ahead and put it in wherever you recommend. Let me know, thanks!

 Try to add the following code to your theme functions. That should change the thumbnail to fancy product thumbnail. Let me know if it works. I would recommend to add this function to the plugin in general as it's an important feature.

function change_email_item_thumbnail($thumbnail, $item = null) {

    if (!is_null($item) && isset($item['fpd_data'])) {

        $fpd_data = maybe_unserialize($item['fpd_data']);

        //check if data contains the fancy product thumbnail
        if (isset($fpd_data['fpd_product_thumbnail']) && $fpd_data['fpd_product_thumbnail']) {

            $dom = new DOMDocument;
            libxml_use_internal_errors(true);
            $dom->loadHTML($thumbnail);
            $xpath = new DOMXPath($dom);
            libxml_clear_errors();
            $doc = $dom->getElementsByTagName("img")->item(0);
            $src = $xpath->query(".//@src");

            foreach ($src as $s) {
                $s->nodeValue = $fpd_data['fpd_product_thumbnail'];
            }

            $output = $dom->saveXML($doc);

            return $output;

        }

    }

    return $thumbnail;

}

add_filter('woocommerce_order_item_thumbnail', 'change_email_item_thumbnail', 10, 2);

 

Hi Christian,


thank you for your code. Unfortunately the image is appearing as broken. There is some base64 content in there. Does it work on your installation? Can you assist me?


Thanks!

This code doesn't work for me as well. 

Hi,
it works fine for me on the email-template.
But is there a solution for the review-order-Page, too?
With this little code it will show the original thumb 
<?php $thumbnail = apply_filters( 'woocommerce_in_cart_product_thumbnail', $_product->get_image(), $values, $cart_item_key ); echo $thumbnail; ?>

but when I'll change this with the "filter" for the e-mail-image


woocommerce_order_item_thumbnail

 That will show only the original Thumb not the designed.

 

 Is there a quick solution?


It would make sense that the designed image will displayed on my orders. The color-settings, too. Or?


Thanks!

Hi i want to achieve same, i want to show customized image show in thankyou page or in email template if anyone solve this plz share the code if someone solves this

 


Login or Signup to post a comment