radykal | Support Center Chooser

For which product do you need support?

Fancy Product Designer Multistep Product Configurator

Start a new topic
Implemented

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?


Is it on by default or do we have to enable it somehow?

Any chance how the design image could be bigger included @ the new order email, or how it could be made bigger?

Included in V3.9.3

I think the feature is in the next new version which is 3.9.3. Radykal is currently working on this. 

I'm now in version 3.9.2. 

Does anyone have a solution for this with the latest version of FPD?

Any idea for adding this in the future?

It is seems iOS Mail.app starts to caching embedded images by its name (and show all over images as first loaded with same name). So i recommend to make unique name: 

$cid = 'item_' . $count . '.png';

|

V

$cid = 'item_' . strval($item_id) . '.png';



After cache refresh of my browser it's all fine but the link to fancy product disappeared from the eMail...

 

 Hi, I did all Oval said and thumbnails appear all fine in the cart.

But at the eMail level, the modification of email-order-items.php drives me to a blank page...

Do you have an idea?

For information, I have cutomizable products and other products also

 

i will try this, thanks!

 

2. Now as mention above:

in yourtheme/woocommerce/emails/email-order-items.php (copy it from plugin templates dir) edit:

$count = 1;

foreach ( $items as $item_id => $item ) :

...

...

do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );

                $cid = 'item_' . $count . '.png';

                $img = $item['_fpd_data']['fpd_product_thumbnail'];

                if($img)

                {

                    echo '<br>Product:<br>';

                    echo '<img src="cid:';

                    echo $cid;

                    echo '">';

 

                $imgdata = base64_decode(explode(',',$img)[1]);

                #$imgdata = explode(',',$img)[1];

 

                    add_action( 'phpmailer_init', function($phpmailer)use($cid, $imgdata){

                    //$phpmailer->SMTPKeepAlive = true;

                    write_log('cid = ' . $cid);

                    write_log('imgdata = ' . $imgdata);

                    $phpmailer->addStringEmbeddedImage($imgdata, $cid, $cid, 'base64', 'image/png');

                    remove_action( 'phpmailer_init', __function__ );

                });

                }

                $count++;

...


3. (Optional) Now suppose you want to see not only first view thumbnail of product but all of them?:

Go for "fancy-product-designer/woo/class-wc-product.php" and change "fancyProductDesigner.viewInstances[0].toDataURL(function(dataURL) {" to "fancyProductDesigner.getProductDataURL(function(dataURL) {" in two places.  Viola! 

Once again for v 3.7.0

1. We need to correct bugs in FancyProductDesigner due to it don't save order thumbnails in "woocommerce_order_itemmeta" table:

1.1 Change all  'fpd_data' (with quota) in "fancy-product-designer/woo/class-wc-cart.php" to '_fpd_data' (with quota) - 33 entries.

1.2 Change  in "fancy-product-designer/woo/class-wc-order.phpfunction add_order_item_meta:

  

		public function add_order_item_meta( $item_id, $item ) {
		 
			$fpd_data = null;
			if( isset( $item->legacy_values['_fpd_data'] ) )  // WC 3.0+
				$fpd_data = $item->legacy_values['_fpd_data'];
			else if( isset( $item['_fpd_data'] ) )  // WC <3.0
				$fpd_data = $item['_fpd_data'];

			if( !is_null($fpd_data) ) {
				wc_add_order_item_meta( $item_id, '_fpd_data', $fpd_data);
			}
		} 

Now custom thumbnails will be saved.

To be continued...    



Did anyone find a solution for this?? I really need this feature.

 

it is possible only in 3.4.8 or below (after that FPD didn't store image in (_)fpd_data meta field due some mistaken code)

in yourtheme/woocommerce/emails/email-order-items.php (copy it from plugin):

$count = 1;

foreach ( $items as $item_id => $item ) :

...

...

do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );

                $cid = 'item_' . $count . '.png';

                $img = $item['_fpd_data']['fpd_product_thumbnail'];

                if($img)        

                {

                    echo '<br>Эскизы сторон:<br>';

                    echo '<img src="cid:';

                    echo $cid;  

                    echo '">';

                    

                $imgdata = base64_decode(explode(',',$img)[1]);

                #$imgdata = explode(',',$img)[1];

                    

                #write_log('img = ' . $imgdata);

                    add_action( 'phpmailer_init', function($phpmailer)use($cid, $imgdata){

                    //$phpmailer->SMTPKeepAlive = true;

                    write_log('cid = ' . $cid);

                    write_log('imgdata = ' . $imgdata);

                    $phpmailer->addStringEmbeddedImage($imgdata, $cid, $cid, 'base64', 'image/png');

                    remove_action( 'phpmailer_init', __function__ );

                });

                }

                $count++;


Same here. Did anyone find a way to change the Admin Order Screen thumbnail?

Login or Signup to post a comment