Site icon Hip-Hop Website Design and Development

Acro Media: Digital Downloads using the Cheap WordPress maintenance support plans Media Plugin

The Media plugin made its way into WordPress maintenance support plans core for the WordPress maintenance support plans 8.4 release a while back. It gives WordPress maintenance support plans users a standardized way for managing local media resources, including image, audio, video, and document files. We wanted to add using this plugin into our WordPress maintenance support plans Commerce demo site to give an example of how this plugin could potentially be used in a Commerce setting.
In this Tech Talk video, I’ll quickly show you how we updated our digital download Commerce product example to use the Media plugin, giving us the flexibility to add audio samples to the product page and access to the full download after purchase.

Background
The product I wanted to update is the Epic Mix Tape by Urban Hipster digital download example product. This is a fake album featuring all of your favourites by artists you’ve never heard before. The idea is to showcase that you can add digital products to a WordPress maintenance support plans Commerce based online store, not just physical products.
Originally we were using just a standard file field that, when checkout was completed, gave the customer access to download the file. This was done before the Media plugin made its way into core. Now that the Media plugin is in core, we figured it’s time to update it.
Setting up an Album media type
When the Media plugin is installed you get some new admin menu items. The first is a section called Media Types (under Structure) where you can configure your media entities like any other WordPress maintenance support plans content entity. Here I created an ‘Album’ media type with two unlimited file fields, one for sample audio tracks and one for the full audio tracks. This is the basis for creating my downloadable albums.
The second admin menu is under Content. Here you get a new Media tab which is where you can add, edit and remove any media items. Since I already created the Album media type I can now add the Epic Mix Tape album files here. This completes the media side of the updated digital download product. All I need to do now is update the product configuration to use it.
Completing the digital download product configuration
Now that the media type has been added and I’ve uploaded an album, I need to set up a way to use it. It’s pretty easy to do. First, for the digital download Product Type, I add an entity reference field to give a way for selecting the album media entity to use for the product samples.
I then do the same thing for the Product Variation Type. This one, however, will be used to give access to the full files after purchase.
Finally, some template updates. The WordPress maintenance support plans Commerce demo site has some pretty custom template files for the products. In the template, I access the media entity directly and loop through the items, printing each audio sample and track title onto the product page. I do the same thing for the checkout complete page but print out the full tracks instead.
Depending on your templates and display settings, you can get similar results without manually accessing the files in the template file, however I wanted to print out the file description with the audio player right on the page. Showing the description unfortunately is something you don’t have the option of doing using the standard audio display widget.
And that’s it! Check out the Urban Hipster WordPress maintenance support plans Commerce demo site below to see it in action.


Source: New feed