Checkout: Post/Page Embedding« Usage
WordPress Shopping Cart plugin: Post/Page Embedding
Making use of WordPress shortcodes and filtering the content of posts and pages has proven to make the WordPress Shopping Cart plugin extremely flexible. The plugin supports several different embedding codes of which many are automatically generated throughout the use of the plugin as WordPress posts/pages are created for shop categories, products, suppliers and more. Below is a list of embedding codes you can use in any of your WordPress posts/pages as needed.
All the shortcodes below can be easily accessed through the TinyMCE editor button made available by the plugin. See the TinyMCE editor button instructions. Ensure that you have the TinyMCE button for the Checkout plugin turned on under Checkout > Configuration, the very last setting in the ‘General Configuration’ box.
Single Category with Products
Show a single category page with the category title/name, its description, keywords, image (if applicable) and also the products which were assigned to the specified category. Replace “X” to the ID of the shop category you wish to display in the WordPress post/page.
Embed a hierarchical list of shop categories in the plugin database as links into a post/page. When a category link is clicked, the user will be taken to the shop category post/page with its image, description, etc. and the products belonging to it. By default, a bullet list with links will be shown. If you use category images, you may want to display a grid by adding a type=”grid” parameter to the shortcode. That is [wpcocategories type="grid"].
To display categories in a grid, use this shortcode:
To do sorting on categories, you can use “sort” and “sortby” parameters. The “sortby” parameter can be id, title, modified, created. And the “sort” parameter is simply ASC for ascending or DESC for descending. Like this:
[wpcocategories sortby="title" sort="ASC"]
To display only category parent you must use the “parentsonly” parameter.
You can order your sub-categories in either “ASC” (ascending – A to Z, first to last, lowest to highest) or “DESC” (descending – Z to A, last to first, highest to lowest) and you can order them by page “id”, or the page “title”, the date “created”, or the date “modified”. See the example below which would display my category with the id of 3, and would order the sub-categories by the date created from the first sub category created to the latest created (ascending order).
[wpcocategories id=”3” suborder=”ASC” suborderby=”created”]
Display all products in the database with paging.
Display a full product pitch page/overview within a WordPress post/page. Change the “X” to the ID of the product in question. With the product embedding code, you can display the product image, additional images, price, custom fields, content tabs and other attributes inside a WordPress post or page so that users can add the product to their shopping cart.
Generates a dynamic shopping cart/basket inside a WordPress post/page. This embedding code will display the current shopping cart contents and allow the customer to manage the shopping cart by entering a coupon code, deleting items in the cart, changing the quantities and much more.
Show a unordered bullet list of suppliers in the Shopping Cart plugin.
Single Supplier with Products
Display the details/information of a product supplier by ID together with a list/grid view of the products belonging to that supplier. Replace “X” with the ID of the specified supplier you wish to display.
You can also use the, “Shopping cart Functions,” button to to insert any of the the shortcodes mentioned already. When creating or editing any existing post or page you will see a little green shopping cart icon at the top of the TinyMCE (WYSIWYG) editor.
Clicking that button will open up an over-lay window with a few tabs which relate to different shortcodes. Have a look at the image below for an example of what can be done:
This will end up inserting the following code into the post/page:
[wpcocategories id=”10” suborder=”ASC” suborderby=”id”]
Give it a try and learn the different WordPress Shopping Cart plugin functions.