I would like to import my products with the YouTube video in the "image or video gallery". Do you guys know the right attribute?

I did for all pictures and worked fine, but I don't know for videos.

  • 2
    Please revisit this question and update with the fix you found – Stevie G Mar 8 '17 at 12:00
  • I'm uploading a csv file with sku,video_url, import success but there is no video in the item, nor in backend and not in frontend. If I manually type the video_url in product page, it works. Thanks. – Daniel Dec 12 '18 at 8:56

There is no way for now (Magento 2.2) for export / import product video.

Some workaround can be - create your own new product attribute and import complete YouTube video URL like https://www.youtube.com/watch?v=XXXXXXXX or just video ID (XXXXXXXX which send to ?v=) there by CSV file. Then modify your product page template file and display that attribute value on specific format to generate YouTube embed code like

<iframe width="560" height="315" src="https://www.youtube.com/embed/XXXXXXXX" frameborder="0" allowfullscreen></iframe>
  • Would be the same method for local server links too, provided all the Videos are pre-uploaded. I'm not sure how Videos are managed by folder names; but this would be the appropriate method. – MackieeE Nov 6 '17 at 15:56
  • 1
    @MackieeE if you have all videos uploaded to your own server and not YoiuTube or Vimeo then you need to have your own embed player and pass your video URL there. Here is good one to use plyr.io – FireBear Nov 6 '17 at 16:16

Follow the steps to create youtube videos in products :

Step 1 : Create a module for product video in product.

Step 2 : Create a youtube video url attribute for set youtube video embed key and assign in product. For ex. : xaYLCgzQP58

Step 3 : Put <iframe> in your div or popup to display video and set embed key in src attribute of <iframe>.

=> For ex :

<iframe width="560" height="315" src="https://www.youtube.com/embed/<?php echo $embed_key; ?>" frameborder="0" allowfullscreen></iframe>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.