WordPress Simple PayPal Shopping Cart - Version 3.7

Version Description

None

Download this release

Release Info

Developer mra13
Plugin Icon 128x128 WordPress Simple PayPal Shopping Cart
Version 3.7
Comparing to
See all releases

Code changes from version 3.6 to 3.7

readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.tipsandtricks-hq.com
4
Tags: shopping cart, WordPress shopping cart, Paypal shopping cart, sell products, online shop, shop, e-commerce, wordpress ecommerce, wordpress store, store, PayPal cart widget, sell digital products, paypal
5
Requires at least: 3.0
6
Tested up to: 3.6
7
- Stable tag: 3.6
8
License: GPLv2 or later
9
10
Very easy to use Simple WordPress Paypal Shopping Cart Plugin. Great for selling products online in one click from your WordPress site.
@@ -111,5 +111,6 @@ Visit the plugin site at http://www.tipsandtricks-hq.com/?p=768 for screenshots.
111
None
112
113
== Changelog ==
114
Changelog can be found at the following URL
115
http://www.tipsandtricks-hq.com/ecommerce/?p=319
4
Tags: shopping cart, WordPress shopping cart, Paypal shopping cart, sell products, online shop, shop, e-commerce, wordpress ecommerce, wordpress store, store, PayPal cart widget, sell digital products, paypal
5
Requires at least: 3.0
6
Tested up to: 3.6
7
+ Stable tag: 3.7
8
License: GPLv2 or later
9
10
Very easy to use Simple WordPress Paypal Shopping Cart Plugin. Great for selling products online in one click from your WordPress site.
111
None
112
113
== Changelog ==
114
+
115
Changelog can be found at the following URL
116
http://www.tipsandtricks-hq.com/ecommerce/?p=319
wp_shopping_cart.php CHANGED
@@ -1,29 +1,18 @@
1
<?php
2
/*
3
Plugin Name: WP Simple Paypal Shopping cart
4
- Version: v3.6
5
Plugin URI: http://www.tipsandtricks-hq.com/?p=768
6
Author: Ruhul Amin
7
Author URI: http://www.tipsandtricks-hq.com/
8
Description: Simple WordPress Shopping Cart Plugin, very easy to use and great for selling products and services from your blog!
9
*/
10
11
- /*
12
- This program is free software; you can redistribute it
13
- under the terms of the GNU General Public License version 2,
14
- as published by the Free Software Foundation.
15
-
16
- This program is distributed in the hope that it will be useful,
17
- but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- GNU General Public License for more details.
20
- */
21
-
22
if(!isset($_SESSION)){
23
session_start();
24
}
25
26
- define('WP_CART_VERSION', '3.6');
27
define('WP_CART_FOLDER', dirname(plugin_basename(__FILE__)));
28
define('WP_CART_URL', plugins_url('',__FILE__));
29
@@ -545,7 +534,7 @@ function wp_cart_add_read_form_javascript()
545
obj.name == "amount") continue;
546
pos = obj.selectedIndex; // which option selected
547
val = obj.options[pos].value; // selected value
548
- val_combo = val_combo + "(" + val + ")";
549
}
550
}
551
// Now summarize everything we have processed above
@@ -555,14 +544,56 @@ function wp_cart_add_read_form_javascript()
555
//-->
556
</script>';
557
}
558
- function print_wp_cart_button_for_product($name, $price, $shipping=0)
559
{
560
$addcart = get_option('addToCartButtonName');
561
if (!$addcart || ($addcart == '') )
562
$addcart = __("Add to Cart", "WSPSC");
563
564
$replacement = '<div class="wp_cart_button_wrapper">';
565
- $replacement .= '<form method="post" class="wp-cart-button-form" action="" style="display:inline">';
566
if (preg_match("/http:/", $addcart)) // Use the image as the 'add to cart' button
567
{
568
$replacement .= '<input type="image" src="'.$addcart.'" class="wp_cart_button" alt="'.(__("Add to Cart", "WSPSC")).'"/>';
@@ -572,6 +603,7 @@ function print_wp_cart_button_for_product($name, $price, $shipping=0)
572
$replacement .= '<input type="submit" value="'.$addcart.'" />';
573
}
574
$replacement .= '<input type="hidden" name="product" value="'.$name.'" /><input type="hidden" name="price" value="'.$price.'" /><input type="hidden" name="shipping" value="'.$shipping.'" /><input type="hidden" name="addcart" value="1" /><input type="hidden" name="cartLink" value="'.cart_current_page_url().'" />';
575
$replacement .= '</form>';
576
$replacement .= '</div>';
577
return $replacement;
1
<?php
2
/*
3
Plugin Name: WP Simple Paypal Shopping cart
4
+ Version: v3.7
5
Plugin URI: http://www.tipsandtricks-hq.com/?p=768
6
Author: Ruhul Amin
7
Author URI: http://www.tipsandtricks-hq.com/
8
Description: Simple WordPress Shopping Cart Plugin, very easy to use and great for selling products and services from your blog!
9
*/
10
11
if(!isset($_SESSION)){
12
session_start();
13
}
14
15
+ define('WP_CART_VERSION', '3.7');
16
define('WP_CART_FOLDER', dirname(plugin_basename(__FILE__)));
17
define('WP_CART_URL', plugins_url('',__FILE__));
18
534
obj.name == "amount") continue;
535
pos = obj.selectedIndex; // which option selected
536
val = obj.options[pos].value; // selected value
537
+ val_combo = val_combo + " (" + val + ")";
538
}
539
}
540
// Now summarize everything we have processed above
544
//-->
545
</script>';
546
}
547
+ function print_wp_cart_button_for_product($name, $price, $shipping=0, $var1='', $var2='', $var3='')
548
{
549
$addcart = get_option('addToCartButtonName');
550
if (!$addcart || ($addcart == '') )
551
$addcart = __("Add to Cart", "WSPSC");
552
553
+ $var_output = "";
554
+ if(!empty($var1))
555
+ {
556
+ $var1_pieces = explode('|',$var1);
557
+ $variation1_name = $var1_pieces[0];
558
+ $var_output .= '<span class="wp_cart_variation_name">'.$variation1_name.' : </span>';
559
+ $var_output .= '<select name="variation1" onchange="ReadForm (this.form, false);">';
560
+ for ($i=1;$i<sizeof($var1_pieces); $i++)
561
+ {
562
+ $var_output .= '<option value="'.$var1_pieces[$i].'">'.$var1_pieces[$i].'</option>';
563
+ }
564
+ $var_output .= '</select><br />';
565
+ }
566
+ if(!empty($var2))
567
+ {
568
+ $var2_pieces = explode('|',$var2);
569
+ $variation2_name = $var2_pieces[0];
570
+ $var_output .= '<span class="wp_cart_variation_name">'.$variation2_name.' : </span>';
571
+ $var_output .= '<select name="variation2" onchange="ReadForm (this.form, false);">';
572
+ for ($i=1;$i<sizeof($var2_pieces); $i++)
573
+ {
574
+ $var_output .= '<option value="'.$var2_pieces[$i].'">'.$var2_pieces[$i].'</option>';
575
+ }
576
+ $var_output .= '</select><br />';
577
+ }
578
+ if(!empty($var3))
579
+ {
580
+ $var3_pieces = explode('|',$var3);
581
+ $variation3_name = $var3_pieces[0];
582
+ $var_output .= '<span class="wp_cart_variation_name">'.$variation3_name.' : </span>';
583
+ $var_output .= '<select name="variation3" onchange="ReadForm (this.form, false);">';
584
+ for ($i=1;$i<sizeof($var3_pieces); $i++)
585
+ {
586
+ $var_output .= '<option value="'.$var3_pieces[$i].'">'.$var3_pieces[$i].'</option>';
587
+ }
588
+ $var_output .= '</select><br />';
589
+ }
590
+
591
$replacement = '<div class="wp_cart_button_wrapper">';
592
+ $replacement .= '<form method="post" class="wp-cart-button-form" action="" style="display:inline" onsubmit="return ReadForm(this, true);">';
593
+ if (!empty($var_output)){//Show variation
594
+ $replacement .= '<div class="wp_cart_variation_section">'.$var_output.'</div>';
595
+ }
596
+
597
if (preg_match("/http:/", $addcart)) // Use the image as the 'add to cart' button
598
{
599
$replacement .= '<input type="image" src="'.$addcart.'" class="wp_cart_button" alt="'.(__("Add to Cart", "WSPSC")).'"/>';
603
$replacement .= '<input type="submit" value="'.$addcart.'" />';
604
}
605
$replacement .= '<input type="hidden" name="product" value="'.$name.'" /><input type="hidden" name="price" value="'.$price.'" /><input type="hidden" name="shipping" value="'.$shipping.'" /><input type="hidden" name="addcart" value="1" /><input type="hidden" name="cartLink" value="'.cart_current_page_url().'" />';
606
+ $replacement .= '<input type="hidden" name="product_tmp" value="'.$name.'" />';
607
$replacement .= '</form>';
608
$replacement .= '</div>';
609
return $replacement;
wp_shopping_cart_shortcodes.php CHANGED
@@ -5,6 +5,9 @@ function wp_cart_button_handler($atts){
5
'name' => '',
6
'price' => '',
7
'shipping' => '0',
8
), $atts));
9
10
if(empty($name)){
@@ -13,7 +16,7 @@ function wp_cart_button_handler($atts){
13
if(empty($price)){
14
return '<div style="color:red;">Error! You must specify a price for your product in the shortcode.</div>';
15
}
16
- return print_wp_cart_button_for_product($name, $price, $shipping);
17
}
18
19
function wp_cart_display_product_handler($atts)
@@ -22,8 +25,11 @@ function wp_cart_display_product_handler($atts)
22
'name' => '',
23
'price' => '',
24
'shipping' => '0',
25
'thumbnail' => '',
26
- 'description' => '',
27
), $atts));
28
29
if(empty($name)){
@@ -36,7 +42,7 @@ function wp_cart_display_product_handler($atts)
36
return '<div style="color:red;">Error! You must specify a thumbnail image for your product in the shortcode.</div>';
37
}
38
$currency_symbol = get_option('cart_currency_symbol');
39
- $button_code = print_wp_cart_button_for_product($name, $price, $shipping);
40
$display_code = <<<EOT
41
<div class="wp_cart_product_display_box">
42
<div class="wp_cart_product_thumbnail">
5
'name' => '',
6
'price' => '',
7
'shipping' => '0',
8
+ 'var1' => '',
9
+ 'var2' => '',
10
+ 'var3' => '',
11
), $atts));
12
13
if(empty($name)){
16
if(empty($price)){
17
return '<div style="color:red;">Error! You must specify a price for your product in the shortcode.</div>';
18
}
19
+ return print_wp_cart_button_for_product($name, $price, $shipping, $var1, $var2, $var3);
20
}
21
22
function wp_cart_display_product_handler($atts)
25
'name' => '',
26
'price' => '',
27
'shipping' => '0',
28
+ 'var1' => '',
29
+ 'var2' => '',
30
+ 'var3' => '',
31
'thumbnail' => '',
32
+ 'description' => '',
33
), $atts));
34
35
if(empty($name)){
42
return '<div style="color:red;">Error! You must specify a thumbnail image for your product in the shortcode.</div>';
43
}
44
$currency_symbol = get_option('cart_currency_symbol');
45
+ $button_code = print_wp_cart_button_for_product($name, $price, $shipping, $var1, $var2, $var3);
46
$display_code = <<<EOT
47
<div class="wp_cart_product_display_box">
48
<div class="wp_cart_product_thumbnail">