e-commerce content management
DESCRIPTION
Learn how to manage e-commerce/product content in ProdigyView's built in content management system.TRANSCRIPT
E-commerce/Product Content Management
OverviewObjective
Learn how to manipulate product content of ProdigyView’s built-in content management system.
Requirements
Installed version of ProdigyView with a database
Understanding of base content
Estimated Time
10 minuteswww.prodigyview.com
Follow Along With Code Example
1. Download a copy of the example code at www.prodigyview.com/source.
2.Install the system in an environment you feel comfortable testing in.
3.Proceed to examples/content/ProductContentExample.php
www.prodigyview.com
What Is Product Content?
Product content is content in the cms designed to facilitate data that involves e-commerce or listing of inventory. Examples of what product content can be used for are those listed below and other examples your imagination can think of.
Clothing Store
Food Store
Restaurant Menu
Movies
Calendars
etc
www.prodigyview.com
Extends Base ContentLike the other content types, product content extends base content. This means it has all the fields that base content has in addition to the fields that describes a product.
Product Content Fields
Base Content Fields
www.prodigyview.com
Create Product ContentProduct content is relatively easy to create. In an array, passed defined fields into PVContent::createProductContent method.
1. Define the content that will be stored as product content
2. Pass the array to PVContent::createProductContent3. Return content id
Database ViewRemember that the product content utilizes both the base content and product content fields. This is accomplished by joining two tables. Your two tables in the database should look something like below.
Base Content Database View
Product Content Database View
Product Content Fields
The previous slide only showed a few fields that can be set when defining product content. The complete list of fields that apply only to the product content type is:
Search for Product Content
Using the syntax from the PV Standard Search Query, we can search for content related to a product on fields for both base content and product content.
1. Search based on the passed arguments
2. Pass args into getProductContentList() method3. Returns an array of arrays
that contains the list of product content
www.prodigyview.com
Iterate Through The ListNext we can iterate through the list of product content to see the data we just added.
1. Iterate through the fields for base content
2. With the automatic joining of the tables, product content fields are also returned
www.prodigyview.com
Retrieving Product Content
Product content can also be retrieved directly using the content id. The data associated with that product id will be returned in array.
1. Pass in the content id
2. Content is returned in an array
3. Or get the content id through the content’s alias
4. Get the values of the array by specifying the associated index
www.prodigyview.com
Updating Product ContentThe array that contains the information for a product can also be used for updating the product. Simply change a value at an index in the array and pass it to PVContent::updateProductContent() method. Remember the content_id variable is required.
1. Set a new value for the product color
2. Pass the array back to updatewww.prodigyview.com
Deleting Event Content
The last action to take place is deleting the product content. To delete content, we pass the content id into PVContent::deleteContent method.
All the content types(audio, video, event, etc) use the PVContent::deleteContent method.
www.prodigyview.com
Review1. Create product content by passing an array of
arguments into PVContent::createProductContent()
2. PVContent::createProductContent() will return the id of the newly generated product content
3. Search for event content by using the syntax from PV Standard Search Query and passing those arguments into PVContent::getProductContentList()
4. Update content by passing an array of accepted fields in PVContent::updateProductContent(). The content_id must be present for this method to work.
5. Delete product content by passing the content_id into PVContent::deleteContent().
www.prodigyview.com
API ReferenceFor a better understanding of base content, visit the api by clicking on the link below.
PVContent
www.prodigyview.com
More Tutorials
For more tutorials, please visit:
http://www.prodigyview.com/tutorials