10

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
  • 2
    Please revisit this question and update with the fix you found
    – tread
    Commented Mar 8, 2017 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.
    – Dan
    Commented Dec 12, 2018 at 8:56

2 Answers 2

3

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>
2
  • 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
    Commented Nov 6, 2017 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
    Commented Nov 6, 2017 at 16:16
2

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>
1
  • Is there any alternative solution using CSV or not? Commented Oct 10, 2019 at 12:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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