How to Use WP Shopping Cart
|
Wordpress Shopping cart |
Add the shopping cart to your theme.
Copy wp-shopping-cart.php to your theme directory. Call the shopping cart in your functions.php file:
Normal PHP shopping car
require_once('wp-shopping-cart.php');
Configure your settings.
In the wp-shopping-cart.php file, replace these variables with your information:
$paypal_account - Your PayPal email address
$cart_icon - An icon for your shopping cart link, if you have one
$url_store - The URL of your store
$url_cart - The URL of your shopping cart
$url_update - The meta info/URL when the cart is updated
$url_success - The meta info/URL when the checkout is successful
Shipping variables - Based on shopping cart subtotal value
Create product pages.
Create pages for your products, and use the [add_to_cart] shortcode to create links.
Shortcode variables:
product="PRODUCT NAME"
price="X.XX"
options="TITLE=OPTION 1|OPTION 2|OPTION 3" (Not required. Limit 1 set of options.)
sold="SOLD OUT MESSAGE"
Example:
[add_to_cart product="T-Shirt" price="20" options="Size=Small|Med|Large"]
Create a shopping cart page.
Create a shopping cart page, and use the [checkout_cart] shortcode to embed a cart.
Add a link to the cart.
Add a link to the cart anywhere on your site using the [checkout_cart_link] shortcode or <?php echo checkout_cart_link(); ?>.
Another Method
WP Shopping Cart Installation
- Unzip and Upload the folder “wordpress-paypal-shopping-cart” to the “/wp-content/plugins/” directory.
- Activate this Plugin
- Go to settings and configure the options your peyment method paypal email,shopping cart and return url etc
- Use the shortcode to add a product a post or page where you want it to appear
WP Shopping Cart
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"]
To add the shopping cart to a post or page, insert the following shortcode to a post or page.
Using Button and Cart Form a template File
To Add 'Add Cart Button' from template.php file use this code:
<?php echo print_wp_cart_button_for_product('PRODUCT-NAME', PRODUCT-PRICE); ?>
<?php echo print_wp_cart_button_for_product('wordpress', 7.50); ?>
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() ?>