Portal | Homepage | Blog

Add a YouTube video to your Product Page


#1

The easiest way to add a YouTube Video is to add the videos embed code in the item’s extended description field. The extended description field takes HTML.

Alternatively, you can add a video using the procedure below.

Create a field in PAM.
Give the field a menaningful name an ensure the attribute type is set to string.
Copy the embed video code from the videos youtube page and paste it into the attribute field you just cretaed in PAM. The embed video code should be under share>embed
Be sure to click commit changes after you’ve added the embed code
Next you’ll need to add the newly created attribute to NSc Sync’s field mappings.

Left click on Configuration.
Left click on Field Mappings
Right click on Item
Choose add field, then Standard RMS field
For remote field name, enter product_weblinxcustomtextx (where x is an available custom text field.  x can be numbers 1-5)
For field source, enter: nitroasl_pamtable.mypamfieldname(where mypamfieldname is the what you name your newly created pam field)
Left click on validate, then ok
Synchronize your webstore

Finally you’ll need to add the nitroscript to your product page template.

simply add the following to your product page template - {product[‘product_weblinxcustomtextx’]} (where x is an available custom text field. x can be numbers 1-5)
You can style the field by enclosing it in a paragraph tag and adding a class you’ve created in your stylesheets. for example <p class=‘myclass’>{product[‘product_weblinxcustomtextx’]}</p>


Add Product Video to Product page
#2

If using the second option (which I would recommend) a better approach is to simply store the video ID in the database rather than storing the whole embed link. Not only will the database be storing less information it will provide you with the added flexibility of setting and controlling the iframe dimensions on your product page i.e. in a single place. Also, if the link needed to be changed for whatever reason you can simply change the link on your product page rather than having to update potentially thousands of database entries.

A typical YouTube video ID will look like this: A9j174k2t50

FROM: www.youtube.com/embed/A9j174k2t50

And the code needed on the product page:

{if (product['product_weblinxcustomtextX'])}
<div class="video-iframe">
        <iframe width="640" height="390" src="http://www.youtube.com/embed/{product['product_weblinxcustomtextX']}?rel=0" frameborder="0" allowfullscreen></iframe>
</div>
{endIf}

The rel=0 in the embed link will prevent related videos from being displayed once the video has been viewed.

Cheers.
Andy.


#3

We use Cash Register Express (CRE). Will this process work for us?


#4

Hi,

As long as you have access to a spare customtextX then the flavour of POS you are using should not make any difference to using the above solution.

Regards,
Conor.