How do you add a video popup link at below the product summary text on WooCommerce single product details page? You can embed the YouTube or Vimeo or any other videos via product add/edit screen page at Dashboard. In this tutorial I shall show how you’ll add it.
What am I doing?
- Adding a video embed input field under Product Data -> Advanced Tab at Dashboard. So admin can easily add/edit the video for individual product.
- Displaying a popup link (Watch Product Video) at below the product short description at frontend(single product details page).
- Opening the video on modal box when a customer will trigger the popup link.
Adding Embed Video Field At Backend
I am adding the textarea field on product add/edit screen at Dashboard like above screenshot. So administrator can easily add/edit/delete the video for individual product. Open the functions.php file of your active theme and add this PHP snippets at end of the file
The rest of the content is available for Pro members. Click on the PAY NOW button to enable access to this content.
$10.00Pay Now
* Payment is non-refundable.
Paid members will be able to login below to see the restricted content.
Login
- Navigate to Products->All Products ->Edit a selected product or Products -> Add New product
- Go to Product Data box
- Click on Advanced Tab
- Enter the video embed code into Embed Video field
- Click on Publish or Update button
- Click on View Product link
- It will redirect to product details and you will get a Watch Product Video link there. Click on the link and video will come on popup box.
Juan Carlos (verified owner) –
Hello, I bought the code but the java scrip does not work for me. How do you mention what other solution is there?