Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Image Url At Order Confirmation In An Javascript Rate Topic   - - - - -

 

Posted 24 February 2021 - 12:55 PM #1

Hi,

 

We are getting reviews from Trustpilot true an javascript code at out order conformation page.
This works fine.

 

They have also the abaility to get product review, so I must extend the code.
The code looks like this.
The only thing what at this moment must be fill is the image url of the products.

I search Google at this forum but I can't find how?
Can someone help me?

<script> 
	document.addEventListener('DOMContentLoaded', function() {
		const trustpilot_invitation = {
   			recipientEmail: '{$order_info.email}',
   			recipientName: '{$order_info.firstname} {$order_info.lastname}',
   			referenceId: '{$order_info.order_id}',
   			source: 'InvitationScript',
  		productSkus: [{foreach from=$order_info.products item="product" key="key"}'{$product.product_code}',{/foreach} ] ,
   			products: [{foreach from=$order_info.products item="product" key="key"}{
					sku: '{$product.product_code}',
					productUrl: '{"products.view?product_id=`$product.product_id`"|fn_url}',
					imageUrl: 'HERE MUST THE IMAGE URL',
					name: '{$product.product}',
				},{/foreach}],
  		};
  		tp('createInvitation', trustpilot_invitation);
	});
</script>


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21708 posts

Posted 24 February 2021 - 01:09 PM #2

Try 

{$product.main_pair.detailed.image_path}

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 

Posted 24 February 2021 - 01:38 PM #3

unfortunately, it's blank then

 

imageUrl: '',



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21708 posts

Posted 25 February 2021 - 05:55 AM #4

Where do you locate this code?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 

Posted 25 February 2021 - 10:15 AM #5

I have tried this as an HTML Block with Smarty, on the oder landing page.

And also As an hook, in design/themes/energot/templates/addons/my_changes/hooks/checkout/order_confirmation.post.tpl



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21708 posts

Posted 25 February 2021 - 01:21 PM #6

In this case additional code is required to retrieve image data from database

{$product.main_pair = $product.product_id|fn_get_image_pairs:'product':'M':true:true}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 

Posted 26 February 2021 - 06:39 AM #7

Thanks a lot!
It works



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21708 posts

Posted 26 February 2021 - 01:14 PM #8

You are welcome!


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)