WP Shopping Cart Installation
- Unzip and Upload the folder “wordpress-paypal-shopping-cart” to the “/wp-content/plugins/” directory.
- Activate the plugin through the “Plugins” menu in WordPress.
- Go to Settings and configure the options (eg. your paypal email, Shopping Cart name, Return URL etc.)
- Use the shortcode to add a product to a post or page where you want it to appear.
WP Shopping Cart Basic Usage
Step 1: To add the ‘Add to Cart’ button simply insert the following shortcode to a post or page next to the product description:
[wp_cart_button name="PRODUCT-NAME" price="PRODUCT-PRICE"]
Replace PRODUCT-NAME and PRODUCT-PRICE with the actual name and price.
Here is an example usage of the shortcode:
[wp_cart_button name="Test Product" price="19.95"]
Step 2: To add the shopping cart to a post or page, insert the following shortcode to a post or page.
Using the Buttons and Cart From a template file
If you want to add a purchase button in your theme’s template file then do the following:
1. To add the ‘Add to Cart’ button from template (.php) files use the following function:
<?php echo print_wp_cart_button_for_product('PRODUCT-NAME', PRODUCT-PRICE); ?>
Replace PRODUCT-NAME and PRODUCT-PRICE with the actual name and price. Example:
<?php echo print_wp_cart_button_for_product('wordpress', 7.50); ?>
2. To add the shopping cart to the sidebar, simply use the widget from the widgets menu or add the following line to your sidebar template file where you want the shopping cart to appear.
<?php echo print_wp_shopping_cart() ?>
Display a Product Box
Read the following documentation that explains how you can use a shortcode to display a nice product box for your product(s):
Example Post/Page Editor Content with Shortcode
The following is a screenshot of the WordPress post/page editor showing how the ‘add to cart’ button and the shopping cart is inserted into a post or page.
Using a Compact Shopping Cart
Use the following shortcode where you want to show the compact shopping cart:
You can add this shortcode in a standard text widget to add the compact cart to the sidebar.
Always Show the Shopping Cart
The standard “show_wp_shopping_cart” shortcode only shows the cart when there are items in the cart. So it shows the cart when the visitor has clicked on an add to cart button and added item(s) to the cart. When the cart is empty, it simply hides the cart (nothing is shown).
If you want to show the cart all the time then use the following shortcode instead. It will show an empty cart message when there is nothing in the cart.
Using Shipping Option
1. To use shipping cost use the “shipping” argument in the shortcode. Here is an example usage:
[wp_cart_button name="Test Product" price="19.95" shipping="4.99"]
or use the following php function from your wordpress template files
<?php echo print_wp_cart_button_for_product('product name',price,shipping cost); ?>
Please see the How shipping Calculation Works post for more info.
Using Variation Control Option
Variation Control can be used to create products similar to the following screenshot:
1. To use variation control for your product use the variation argument like the following:
[wp_cart_button name="Test Product" price="25.95" var1="VARIATION-NAME|VARIATION1|VARIATION2|VARIATION3"]
Here is an example usage:
[wp_cart_button name="Test Product" price="29.95" var1="Size|small|medium|large"]
2. To use a 2nd or 3rd variation use the following:
[wp_cart_button name="Test Product" price="29.95" var1="Size|small|medium|large" var2="Color|red|green|blue"]
[wp_cart_button name="Test Product" price="29.95" var1="Size|small|medium|large" var2="Color|red|green|blue" var3="Sleeve|short|full"]
Selling Digital Media Files
See the media file selling usage documentation.
Use an User Interface to Insert the Shortcodes
The plugin has a shortcode inserter that you can use to add the shortcodes to your WordPress posts/pages.
Feel free to leave a comment below if you are having any difficulties.
Visit the WordPress Shopping Cart Plugin Page.