Version Description
- New: Filter for 'wpsc_display_product_multicurrency'.
- New: Additional filters for compatibility with WPML.
- Change: Discount information is now displayed on the Packing Slip.
- Fix: Sometimes wpsc_product_has_multicurrency() returns true when it should return false.
- Fix: Edit product page makes many database queries if you have lots of variations.
- Fix: Variation prices are not calculated correctly.
- Fix: Request-URI Too Large error when searching on the Admin Products page with lots of products.
- Fix: Add to cart shortcode doesn't display fancy notifications, and also doesn't check whether variations are selected.
- Fix: Infinite AJAX loop on checkout page when Same as Billing is checked.
- Fix: Per-item shipping total is calculated incorrectly in various places (Packing Slip, Sales Report etc.).
- Fix: Wrong product link when the product is assigned multiple categories.
- Fix: Canonical tags are not generated correctly for products with multiple categories.
- Fix: Edit variations inline messes up columns when stock limitation is disabled.
- Fix: Product with no category selected is not automatically assigned a default category when sort by drag&drop is enabled.
- Fix: Unnecessary use of livequery in variations.js causes Product edit page to freeze when there are many variation sets.
- Fix: Slashes added to checkout form field that has single quotes in it (e.g: O\'Connor).
- Fix: Multicurrency price is truncated when displayed.
- Fix: Checkout page keeps refreshing without displaying Google Checkout Button.
- Fix: Discount doesn't work with Paypal Standard.
- Fix: wpsc_single_template is not removed from the_content after it's run, causing subsequent the_content() calls to output the single product again.
- Fix: Sorting product categories is broken.
- Fix: Coupon rule "In Category" not taken into consideration.
- Fix: WPEC default stylesheet imposes #content font-size.
- Fix: Incompatibility with Prototype JS library.
- Fix: Checking (or unchecking) Stock checkbox when editing product causes variation table columns to break.
- Fix: jQuery 1.6 incompatibility with attr( 'className' ).
Download this release
Release Info
Developer | mychelle |
Plugin | WP eCommerce |
Version | 3.8.6 |
Comparing to | |
See all releases |
Code changes from version 3.8.5 to 3.8.6
- readme.txt +161 -67
- woo-integration/css/main_frame_style.css +11 -11
- woo-integration/css/style.css +154 -154
- woo-integration/js/script.js +50 -48
- woo-integration/options_presentation.php +15 -15
- woo-integration/woo_integration.php +61 -61
- wp-shopping-cart.php +1 -1
- wpsc-admin/admin-form-functions.php +178 -181
- wpsc-admin/admin.php +0 -4
- wpsc-admin/ajax-and-init.php +6 -46
- wpsc-admin/css/settingspage.css +3 -3
- wpsc-admin/display-items.page.php +14 -1
- wpsc-admin/includes/display-items-functions.php +17 -51
- wpsc-admin/includes/product-functions.php +49 -16
- wpsc-admin/includes/products.php +16 -33
- wpsc-admin/includes/save-data.functions.php +13 -10
- wpsc-admin/includes/settings-pages/checkout.php +0 -2
- wpsc-admin/includes/walker-variation-checklist.php +47 -0
- wpsc-admin/js/admin-legacy.js +3 -3
- wpsc-admin/js/admin.js +24 -22
- wpsc-admin/js/variations.js +0 -13
- wpsc-admin/js/wpsc-swfupload-handlers.js +1 -1
- wpsc-core/js/jquery.rating.js +1 -2
- wpsc-core/js/user.js +2 -2
- wpsc-core/js/wp-e-commerce.js +17 -13
- wpsc-core/wpsc-constants.php +5 -4
- wpsc-core/wpsc-functions.php +2 -2
- wpsc-includes/ajax.functions.php +4 -4
- wpsc-includes/cart.class.php +6 -5
- wpsc-includes/category.functions.php +4 -2
- wpsc-includes/checkout.class.php +3 -1
- wpsc-includes/coupons.class.php +43 -6
- wpsc-includes/display.functions.php +5 -8
- wpsc-includes/misc.functions.php +2 -12
- wpsc-includes/processing.functions.php +17 -10
- wpsc-includes/product-template.php +4 -11
- wpsc-includes/purchaselogs.class.php +2 -2
- wpsc-includes/theme.functions.php +9 -4
- wpsc-merchants/chronopay.php +1 -1
- wpsc-merchants/paypal-standard.merchant.php +16 -2
- wpsc-theme/functions/wpsc-transaction_results_functions.php +4 -4
- wpsc-theme/wpsc-default.css +15 -13
- wpsc-theme/wpsc-products_page.php +3 -2
- wpsc-theme/wpsc-shopping_cart_page.php +1 -1
- wpsc-widgets/donations_widget.php +2 -0
readme.txt
CHANGED
@@ -4,24 +4,143 @@ Donate link: http://getshopped.org
|
|
4 |
Tags: e-commerce, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.2
|
7 |
-
Stable tag: 3.8.
|
8 |
|
9 |
-
WP e-Commerce is a
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
*
|
20 |
-
*
|
21 |
-
*
|
22 |
-
*
|
23 |
-
*
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
For more information visit [http://getshopped.org](http://getshopped.org "http://getshopped.org")
|
27 |
|
@@ -37,6 +156,34 @@ After upgrading from earlier versions look for link "Update Store". This will up
|
|
37 |
|
38 |
|
39 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
= 3.8.5 =
|
41 |
* New: Added hooks to support WPML.
|
42 |
* New: Links to WP e-Commerce documentation for individual payment gateways.
|
@@ -176,59 +323,6 @@ After upgrading from earlier versions look for link "Update Store". This will up
|
|
176 |
* Better template integration for designers
|
177 |
* Optimized for ticketing (Tikipress)
|
178 |
|
179 |
-
= 3.7.5.3 =
|
180 |
-
* Support for WordPress 2.9 canonical URLs for Products and Categories
|
181 |
-
|
182 |
-
= 3.7.5.2 =
|
183 |
-
* More Fixes to the Paypal Pro merchant file
|
184 |
-
* Image thumbnail size fixes
|
185 |
-
* Updated readme to mark plugin as working with 2.9
|
186 |
-
* Purchase log filtering bug fixed
|
187 |
-
* Fix for a bug when no shipping module is used where the shipping country and region were not being changed
|
188 |
-
* Remove button on checkout page now clears stock claims
|
189 |
-
|
190 |
-
= 3.7.5.1 =
|
191 |
-
* Fixes to the Paypal Pro merchant file
|
192 |
-
* Fixes to the Paypal Express Checkout merchant file
|
193 |
-
* Tracking email improvements
|
194 |
-
* HTML in descriptions does not break RSS (thanks to http://www.leewillis.co.uk)
|
195 |
-
* Category permalinks will now be regenerated properly on instalation
|
196 |
-
* Category list bug preventing viewing a product when viewing a category fixed.
|
197 |
-
|
198 |
-
|
199 |
-
= 3.7.5 =
|
200 |
-
* Added code for upgrades/additions from nielo.info and lsdev.biz, we will be using this for new modules in the future.
|
201 |
-
* All In One SEO Pack compatibility bugfixes and improvements.
|
202 |
-
* CSV has had some work done on it, it now takes larger files, and associates a CSV file to a single category of your choice. We'd love to be able to allow users to add the categories and images as part of the CSV file. We will look into it more at a later date.
|
203 |
-
* SSL we fixed the image issue from beta1 and used James Collis recommended fix (using is_ssl() for our conditions) Thanks James!
|
204 |
-
* Show list of Product Groupsí shows all Groups <- there may be some backwards compatibility issues (we havent encountered any but nevertheless if you spot any let us know)
|
205 |
-
* When duplicating products, their tags do not get duplicated for the new product. <- Oh yes they DO!
|
206 |
-
* Google Checkout now sends off Discount Coupons As well. And we fixed the `name` vs `code` Issue people mentioned in the forum
|
207 |
-
* Category shortcode backwards compatibility
|
208 |
-
* Fix Purchlogs - We had a lot of users that somehow by passed the 'fix purchase logs' page when upgrading from 3.6, so we added some better conditions to the mix and added it on to the debug page (a powerful wp-e-commerce page that is hidden from most users as it's usage is very corrosive backing up your DB and files is strongly recommended if not necessary when you work with this page).
|
209 |
-
* Valid XHTML for front end of wpec YAY!
|
210 |
-
* Fixed adding variations when adding products
|
211 |
-
* Sender from the 'resend email to buyer' link on the purchase log details page has been fixed
|
212 |
-
* Shipping Discount Bug that stopped shipping working at all.
|
213 |
-
* Categories Widget has had numerous changes ñ
|
214 |
-
* Better MU support.
|
215 |
-
* Canadian Tax ñ Fixes
|
216 |
-
* US Tax ñFixes
|
217 |
-
* Product Categories Caching Issue Resolved
|
218 |
-
* Coupons ñ ëApply to all Productsí and numerous bug fixes
|
219 |
-
* ëYour Accountí done some fixes to it.
|
220 |
-
* ëAccepted Paymentí goes straight to ëClosed Orderí
|
221 |
-
* Stock claims are now cleared when the cart is emptied
|
222 |
-
* Purchase log bulk actions now work
|
223 |
-
* PayPal gateway module fixes and improvements
|
224 |
-
* HTML Tables can now be added to product descriptions
|
225 |
-
* Flat Rate and Weight Rate improvements
|
226 |
-
|
227 |
-
|
228 |
-
= 3.7.4 =
|
229 |
-
* Changes to shipping to fix the bugs from 3.7.3 with shipping and the new shipping_discount feature
|
230 |
-
* Fixes for variations under grid view
|
231 |
-
|
232 |
|
233 |
== Frequently Asked Questions ==
|
234 |
|
4 |
Tags: e-commerce, wp-e-commerce, shop, cart, paypal, authorize, stock control, ecommerce, shipping, tax
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.2
|
7 |
+
Stable tag: 3.8.6
|
8 |
|
9 |
+
WP e-Commerce is a free WordPress Shopping Cart Plugin that lets customers buy your products, services and digital downloads online.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
+
We make setting up an ecommerce shop easy, and with over 1.3 Million downloads, we have unparalleled experience.
|
14 |
+
|
15 |
+
Features:
|
16 |
+
|
17 |
+
= WordPress Integration =
|
18 |
+
* Easy to install WordPress plugin
|
19 |
+
* Works with any standards compliant WordPress theme
|
20 |
+
* Plays well with other Plugins
|
21 |
+
* Supports regular WordPress widgets, as well as a few snazzy ones of our own
|
22 |
+
* Utilizes shortcodes and template tags (just like WordPress)
|
23 |
+
* Works out-of-the-box with WordPress MU (make sure you use sub domains with your MU setup)
|
24 |
+
|
25 |
+
= 100% Customizable =
|
26 |
+
* A designers dream – use your own HTML & CSS and have complete control over the look and feel of your. store
|
27 |
+
* Easy to modify templates
|
28 |
+
|
29 |
+
= Amazing Support =
|
30 |
+
* Lots of video tutorials
|
31 |
+
* Guaranteed speedy response (through our premium forums)
|
32 |
+
* Access to instant support from our community of users
|
33 |
+
|
34 |
+
= Payment Gateways Integration =
|
35 |
+
* Manual Payment (checks/money orders) (included)
|
36 |
+
* PayPal Payments Standard (included)
|
37 |
+
* PayPal Payments Pro (included)
|
38 |
+
* PayPal Express Checkout (included)
|
39 |
+
* Google Checkout (Level 2) (included)
|
40 |
+
* Chronopay (included)
|
41 |
+
* PayPal Payflow Pro (available with Gold Cart)
|
42 |
+
* Authorize.net (available with Gold Cart)
|
43 |
+
* FirstData/LinkPoint (available with Gold Cart)
|
44 |
+
* eWay Payment (available with Gold Cart)
|
45 |
+
* iDEAL (available with Gold Cart)
|
46 |
+
* BluePay (available with Gold Cart)
|
47 |
+
* DPS (available with Gold Cart)
|
48 |
+
* Paystation (available with Gold Cart)
|
49 |
+
* SagePay (available with Gold Cart)
|
50 |
+
* If you still aren’t happy, we provide you with the necessary info to write your payment gateway
|
51 |
+
|
52 |
+
= Marketing =
|
53 |
+
* Flexible coupon/discount pricing rules
|
54 |
+
* Product specific sales
|
55 |
+
* Quantity discounts
|
56 |
+
* Free shipping options
|
57 |
+
* Multi-tier pricing for quantity discounts.
|
58 |
+
* Search Engine Friendly URLs
|
59 |
+
* New Products widget
|
60 |
+
* Cross-sells on product pages (in 3.8 this is now available as a Plugin)
|
61 |
+
* Google Site Map
|
62 |
+
* Uses the popular “Share This” button for easily promoting your products on popular social networking sites
|
63 |
+
* Integrates with Facebook Marketplace (Facebook Marketplace API has closed – we’re working on it)
|
64 |
+
* Integrates with Google Base
|
65 |
+
* Integrates with Campaign Monitor for advanced email marketing
|
66 |
+
* Integrates with Intense Debate for shared comments
|
67 |
+
* Mail Chimp integration coming soon
|
68 |
+
|
69 |
+
= Search Engine Optimization =
|
70 |
+
* 100% Search Engine Friendly
|
71 |
+
* Meta-information for products and categories
|
72 |
+
* RSS feeds for products and categories
|
73 |
+
* Integrates with Google (XML site maps and Google Merchant Centre)
|
74 |
+
* Integrates with the All in One SEO plugin for WordPress (which includes Google Analytics)
|
75 |
+
|
76 |
+
= Internationalization Support =
|
77 |
+
* Multi-lingual (the first Plugin to fully utilize and integrate with GlotPress)
|
78 |
+
* Support for multiple currencies
|
79 |
+
* Ability to target specific countries
|
80 |
+
|
81 |
+
= Shipping =
|
82 |
+
* Integrates with UPS, USPS, Australia Post and Shipwire for real-time shipping rates
|
83 |
+
* Flexible built-in shipping rate calculators
|
84 |
+
* Domestic and global shipping rates
|
85 |
+
* Flat rate shipping
|
86 |
+
* Table rate shipping
|
87 |
+
* Weight rate shipping
|
88 |
+
|
89 |
+
= Checkout =
|
90 |
+
* One-Page Checkout or Stepped Checkout, whichever you prefer
|
91 |
+
* SSL security support for orders on both front-end and back-end
|
92 |
+
* Checkout without account/Guest Checkout
|
93 |
+
* Shopping Cart with tax and shipping estimates
|
94 |
+
* Option to create account at beginning of checkout
|
95 |
+
* Fully customizable checkout page
|
96 |
+
|
97 |
+
= Managing Orders =
|
98 |
+
* Admin dashboard for sales overview
|
99 |
+
* Export orders and customers into CSV formats
|
100 |
+
* Order history with labels for order processing status
|
101 |
+
* Email notifications of orders
|
102 |
+
* Print invoices and packing slips
|
103 |
+
|
104 |
+
= Catalog Management =
|
105 |
+
* Single-page product data entry
|
106 |
+
* Ability to duplicate products
|
107 |
+
* Quickly edit your products from the store front (saving you heaps of time)
|
108 |
+
* Smart Groups allow you to organize your products with hierarchical categories, as well as by brand.
|
109 |
+
* Batch import/export of catalog
|
110 |
+
* Google Base integration
|
111 |
+
* Product variation management
|
112 |
+
* Create attributes on the fly
|
113 |
+
* Downloadable/Digital Products
|
114 |
+
* Support for donations
|
115 |
+
* Customer Personalized Products
|
116 |
+
* Media Manager with automatic image resizing
|
117 |
+
* Handles multiple product images with easy drag-and-drop sorting
|
118 |
+
* support for Special Prices
|
119 |
+
* Tax rates per location
|
120 |
+
* Basic inventory control
|
121 |
+
|
122 |
+
= Catalog Browsing =
|
123 |
+
* Live product search – mmm just like apple.com (available add on)
|
124 |
+
* Cross-sells
|
125 |
+
* Product listing in list format
|
126 |
+
* Product listing in grid format (available with Gold Cart)
|
127 |
+
* Breadcrumbs
|
128 |
+
* Product Image Zoom-in Capability
|
129 |
+
* Stock Availability
|
130 |
+
* Multiple Images Per Product (activated with Gold Cart)
|
131 |
+
* Product comments
|
132 |
+
* Filter by Product Tags
|
133 |
+
* New Products widget
|
134 |
+
* Features Products widget
|
135 |
+
* Live updating shopping cart (put it wherever you want)
|
136 |
+
|
137 |
+
= Additional Modules =
|
138 |
+
* Gold Cart & Grid Module – adds more options and functionality to your store
|
139 |
+
* Drop Shop – an incredibly snazzy way for buyers to add products to their cart, via a simple drag n drop process.
|
140 |
+
* Mp3 Audio Player – Preview audio clips on your website
|
141 |
+
* NextGen Gallery Buy Now Buttons – turns your NextGen gallery into an ecommerce solution
|
142 |
+
* Product Slider – Display your products in a new and fancy way
|
143 |
+
* Members Only Module – Create pay to view subscription sites
|
144 |
|
145 |
For more information visit [http://getshopped.org](http://getshopped.org "http://getshopped.org")
|
146 |
|
156 |
|
157 |
|
158 |
== Changelog ==
|
159 |
+
= 3.8.6 =
|
160 |
+
* New: Filter for 'wpsc_display_product_multicurrency'.
|
161 |
+
* New: Additional filters for compatibility with WPML.
|
162 |
+
* Change: Discount information is now displayed on the Packing Slip.
|
163 |
+
* Fix: Sometimes wpsc_product_has_multicurrency() returns true when it should return false.
|
164 |
+
* Fix: Edit product page makes many database queries if you have lots of variations.
|
165 |
+
* Fix: Variation prices are not calculated correctly.
|
166 |
+
* Fix: Request-URI Too Large error when searching on the Admin Products page with lots of products.
|
167 |
+
* Fix: Add to cart shortcode doesn't display fancy notifications, and also doesn't check whether variations are selected.
|
168 |
+
* Fix: Infinite AJAX loop on checkout page when Same as Billing is checked.
|
169 |
+
* Fix: Per-item shipping total is calculated incorrectly in various places (Packing Slip, Sales Report etc.).
|
170 |
+
* Fix: Wrong product link when the product is assigned multiple categories.
|
171 |
+
* Fix: Canonical tags are not generated correctly for products with multiple categories.
|
172 |
+
* Fix: Edit variations inline messes up columns when stock limitation is disabled.
|
173 |
+
* Fix: Product with no category selected is not automatically assigned a default category when sort by drag&drop is enabled.
|
174 |
+
* Fix: Unnecessary use of livequery in variations.js causes Product edit page to freeze when there are many variation sets.
|
175 |
+
* Fix: Slashes added to checkout form field that has single quotes in it (e.g: O\'Connor).
|
176 |
+
* Fix: Multicurrency price is truncated when displayed.
|
177 |
+
* Fix: Checkout page keeps refreshing without displaying Google Checkout Button.
|
178 |
+
* Fix: Discount doesn't work with Paypal Standard.
|
179 |
+
* Fix: wpsc_single_template is not removed from the_content after it's run, causing subsequent the_content() calls to output the single product again.
|
180 |
+
* Fix: Sorting product categories is broken.
|
181 |
+
* Fix: Coupon rule "In Category" not taken into consideration.
|
182 |
+
* Fix: WPEC default stylesheet imposes #content font-size.
|
183 |
+
* Fix: Incompatibility with Prototype JS library.
|
184 |
+
* Fix: Checking (or unchecking) Stock checkbox when editing product causes variation table columns to break.
|
185 |
+
* Fix: jQuery 1.6 incompatibility with attr( 'className' ).
|
186 |
+
|
187 |
= 3.8.5 =
|
188 |
* New: Added hooks to support WPML.
|
189 |
* New: Links to WP e-Commerce documentation for individual payment gateways.
|
323 |
* Better template integration for designers
|
324 |
* Optimized for ticketing (Tikipress)
|
325 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
|
327 |
== Frequently Asked Questions ==
|
328 |
|
woo-integration/css/main_frame_style.css
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
/* CSS Document */
|
2 |
-
|
3 |
-
li.wpsc_presentation a{
|
4 |
-
padding-left: 40px !important;
|
5 |
-
background: url(../../wpsc-core/images/credit_cards.png) no-repeat;
|
6 |
-
background-position: 12px center;
|
7 |
-
}
|
8 |
-
|
9 |
-
iframe#wpsc-presentation{
|
10 |
-
height: 2210px;
|
11 |
-
width: 100%;
|
12 |
}
|
1 |
+
/* CSS Document */
|
2 |
+
|
3 |
+
li.wpsc_presentation a{
|
4 |
+
padding-left: 40px !important;
|
5 |
+
background: url(../../wpsc-core/images/credit_cards.png) no-repeat;
|
6 |
+
background-position: 12px center;
|
7 |
+
}
|
8 |
+
|
9 |
+
iframe#wpsc-presentation{
|
10 |
+
height: 2210px;
|
11 |
+
width: 100%;
|
12 |
}
|
woo-integration/css/style.css
CHANGED
@@ -1,155 +1,155 @@
|
|
1 |
-
/* CSS Document */
|
2 |
-
|
3 |
-
*{
|
4 |
-
font-family: 'Lucida Grande', Verdana, sans-serif;
|
5 |
-
font-size: 11px;
|
6 |
-
color: #666;
|
7 |
-
list-style: none;
|
8 |
-
}
|
9 |
-
|
10 |
-
h3{
|
11 |
-
font-size: 14px;
|
12 |
-
color: #333;
|
13 |
-
display: block;
|
14 |
-
border-bottom: solid 1px #e7e7e7;
|
15 |
-
padding-bottom: 7px;
|
16 |
-
}
|
17 |
-
|
18 |
-
tr{
|
19 |
-
display: block;
|
20 |
-
padding-bottom: 10px;
|
21 |
-
}
|
22 |
-
|
23 |
-
th[scope=row], th[score=row]{
|
24 |
-
text-align: left;
|
25 |
-
}
|
26 |
-
|
27 |
-
input[type=text]{
|
28 |
-
border: solid #CCC #EEE #EEE #CCC;
|
29 |
-
border-width: 1px;
|
30 |
-
background-color: #fafafa;
|
31 |
-
-moz-border-radius: 3px;
|
32 |
-
-webkit-border-radius: 3px;
|
33 |
-
-border-radius: 3px;
|
34 |
-
padding: 5px;
|
35 |
-
-webkit-bor
|
36 |
-
}
|
37 |
-
|
38 |
-
input[type=text]:hover{
|
39 |
-
background-color: #FFF;
|
40 |
-
}
|
41 |
-
|
42 |
-
.allign_top{
|
43 |
-
vertical-align: top;
|
44 |
-
}
|
45 |
-
|
46 |
-
.button_settings_th{
|
47 |
-
width: 180px;
|
48 |
-
}
|
49 |
-
|
50 |
-
.button_settings_desc{
|
51 |
-
width: 260px;
|
52 |
-
padding-left: 20px;
|
53 |
-
}
|
54 |
-
|
55 |
-
.product_settings_th{
|
56 |
-
width: 350px;
|
57 |
-
}
|
58 |
-
|
59 |
-
.product_page_settings_th, .product_category_settings_th, .thumbnail_settings_th{
|
60 |
-
width: 260px;
|
61 |
-
padding-right: 10px;
|
62 |
-
}
|
63 |
-
|
64 |
-
.shopping_cart_settings_th{
|
65 |
-
width: 240px;
|
66 |
-
padding-right: 10px;
|
67 |
-
}
|
68 |
-
|
69 |
-
.pagination_settings_th{
|
70 |
-
width: 200px;
|
71 |
-
}
|
72 |
-
|
73 |
-
.wpsc_select_wrapper{
|
74 |
-
-moz-border-radius: 4px;
|
75 |
-
-webkit-border-radius: 4px;
|
76 |
-
border-radius: 4px;
|
77 |
-
font-family: "Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif;
|
78 |
-
font-size: 12px;
|
79 |
-
background: #FAFAFA url(../../functions/images/select.png) no-repeat right center;
|
80 |
-
border-color: #CCC #EEE #EEE #CCC;
|
81 |
-
border-style: solid;
|
82 |
-
border-width: 1px;
|
83 |
-
float: left;
|
84 |
-
height: 26px;
|
85 |
-
width: 280px;
|
86 |
-
margin: 0;
|
87 |
-
margin-bottom: 9px !important;
|
88 |
-
display: block;
|
89 |
-
color: #555;
|
90 |
-
}
|
91 |
-
|
92 |
-
.wpsc_select{
|
93 |
-
cursor: pointer;
|
94 |
-
height: 28px;
|
95 |
-
margin: 0;
|
96 |
-
opacity: 0;
|
97 |
-
padding: 0;
|
98 |
-
position: relative;
|
99 |
-
width: inherit;
|
100 |
-
z-index: 4;
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
.wpsc_select_span{
|
105 |
-
height: 26px;
|
106 |
-
line-height: 26px;
|
107 |
-
position: absolute;
|
108 |
-
z-index: 2;
|
109 |
-
padding-left: 6px;
|
110 |
-
}
|
111 |
-
|
112 |
-
.wpsc_select:hover{
|
113 |
-
color: #333;
|
114 |
-
background: white;
|
115 |
-
}
|
116 |
-
|
117 |
-
input[type=submit][name=updateoption]{
|
118 |
-
border-color: #BBB !important;
|
119 |
-
cursor: pointer;
|
120 |
-
background-color: #FAFAFA;
|
121 |
-
border: 1px solid;
|
122 |
-
padding: 5px;
|
123 |
-
font-family: "Lucida Grande", Verdana, sans-serif;
|
124 |
-
color: #555;
|
125 |
-
-moz-border-radius: 4px;
|
126 |
-
-webkit-border-radius: 4px;
|
127 |
-
-border-radius: 4px;
|
128 |
-
border-style: solid;
|
129 |
-
border-width: 1px;
|
130 |
-
position: fixed;
|
131 |
-
bottom: 10px;
|
132 |
-
}
|
133 |
-
|
134 |
-
input[type=submit][name=updateoption]:hover{
|
135 |
-
border-color: #666 !important;
|
136 |
-
color: black;
|
137 |
-
}
|
138 |
-
|
139 |
-
.comment_settings_th{
|
140 |
-
width: 250px;
|
141 |
-
}
|
142 |
-
|
143 |
-
#message{
|
144 |
-
position: fixed;
|
145 |
-
bottom: 10px;
|
146 |
-
right: 0px;
|
147 |
-
display: block;
|
148 |
-
width: 400px;
|
149 |
-
text-align: center;
|
150 |
-
background-color: #FFFFE0;
|
151 |
-
border: 1px solid #E6DB55;
|
152 |
-
-moz-border-radius: 4px;
|
153 |
-
-webkit-border-radius: 4px;
|
154 |
-
-border-radius: 4px;
|
155 |
}
|
1 |
+
/* CSS Document */
|
2 |
+
|
3 |
+
*{
|
4 |
+
font-family: 'Lucida Grande', Verdana, sans-serif;
|
5 |
+
font-size: 11px;
|
6 |
+
color: #666;
|
7 |
+
list-style: none;
|
8 |
+
}
|
9 |
+
|
10 |
+
h3{
|
11 |
+
font-size: 14px;
|
12 |
+
color: #333;
|
13 |
+
display: block;
|
14 |
+
border-bottom: solid 1px #e7e7e7;
|
15 |
+
padding-bottom: 7px;
|
16 |
+
}
|
17 |
+
|
18 |
+
tr{
|
19 |
+
display: block;
|
20 |
+
padding-bottom: 10px;
|
21 |
+
}
|
22 |
+
|
23 |
+
th[scope=row], th[score=row]{
|
24 |
+
text-align: left;
|
25 |
+
}
|
26 |
+
|
27 |
+
input[type=text]{
|
28 |
+
border: solid #CCC #EEE #EEE #CCC;
|
29 |
+
border-width: 1px;
|
30 |
+
background-color: #fafafa;
|
31 |
+
-moz-border-radius: 3px;
|
32 |
+
-webkit-border-radius: 3px;
|
33 |
+
-border-radius: 3px;
|
34 |
+
padding: 5px;
|
35 |
+
-webkit-bor
|
36 |
+
}
|
37 |
+
|
38 |
+
input[type=text]:hover{
|
39 |
+
background-color: #FFF;
|
40 |
+
}
|
41 |
+
|
42 |
+
.allign_top{
|
43 |
+
vertical-align: top;
|
44 |
+
}
|
45 |
+
|
46 |
+
.button_settings_th{
|
47 |
+
width: 180px;
|
48 |
+
}
|
49 |
+
|
50 |
+
.button_settings_desc{
|
51 |
+
width: 260px;
|
52 |
+
padding-left: 20px;
|
53 |
+
}
|
54 |
+
|
55 |
+
.product_settings_th{
|
56 |
+
width: 350px;
|
57 |
+
}
|
58 |
+
|
59 |
+
.product_page_settings_th, .product_category_settings_th, .thumbnail_settings_th{
|
60 |
+
width: 260px;
|
61 |
+
padding-right: 10px;
|
62 |
+
}
|
63 |
+
|
64 |
+
.shopping_cart_settings_th{
|
65 |
+
width: 240px;
|
66 |
+
padding-right: 10px;
|
67 |
+
}
|
68 |
+
|
69 |
+
.pagination_settings_th{
|
70 |
+
width: 200px;
|
71 |
+
}
|
72 |
+
|
73 |
+
.wpsc_select_wrapper{
|
74 |
+
-moz-border-radius: 4px;
|
75 |
+
-webkit-border-radius: 4px;
|
76 |
+
border-radius: 4px;
|
77 |
+
font-family: "Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif;
|
78 |
+
font-size: 12px;
|
79 |
+
background: #FAFAFA url(../../functions/images/select.png) no-repeat right center;
|
80 |
+
border-color: #CCC #EEE #EEE #CCC;
|
81 |
+
border-style: solid;
|
82 |
+
border-width: 1px;
|
83 |
+
float: left;
|
84 |
+
height: 26px;
|
85 |
+
width: 280px;
|
86 |
+
margin: 0;
|
87 |
+
margin-bottom: 9px !important;
|
88 |
+
display: block;
|
89 |
+
color: #555;
|
90 |
+
}
|
91 |
+
|
92 |
+
.wpsc_select{
|
93 |
+
cursor: pointer;
|
94 |
+
height: 28px;
|
95 |
+
margin: 0;
|
96 |
+
opacity: 0;
|
97 |
+
padding: 0;
|
98 |
+
position: relative;
|
99 |
+
width: inherit;
|
100 |
+
z-index: 4;
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
.wpsc_select_span{
|
105 |
+
height: 26px;
|
106 |
+
line-height: 26px;
|
107 |
+
position: absolute;
|
108 |
+
z-index: 2;
|
109 |
+
padding-left: 6px;
|
110 |
+
}
|
111 |
+
|
112 |
+
.wpsc_select:hover{
|
113 |
+
color: #333;
|
114 |
+
background: white;
|
115 |
+
}
|
116 |
+
|
117 |
+
input[type=submit][name=updateoption]{
|
118 |
+
border-color: #BBB !important;
|
119 |
+
cursor: pointer;
|
120 |
+
background-color: #FAFAFA;
|
121 |
+
border: 1px solid;
|
122 |
+
padding: 5px;
|
123 |
+
font-family: "Lucida Grande", Verdana, sans-serif;
|
124 |
+
color: #555;
|
125 |
+
-moz-border-radius: 4px;
|
126 |
+
-webkit-border-radius: 4px;
|
127 |
+
-border-radius: 4px;
|
128 |
+
border-style: solid;
|
129 |
+
border-width: 1px;
|
130 |
+
position: fixed;
|
131 |
+
bottom: 10px;
|
132 |
+
}
|
133 |
+
|
134 |
+
input[type=submit][name=updateoption]:hover{
|
135 |
+
border-color: #666 !important;
|
136 |
+
color: black;
|
137 |
+
}
|
138 |
+
|
139 |
+
.comment_settings_th{
|
140 |
+
width: 250px;
|
141 |
+
}
|
142 |
+
|
143 |
+
#message{
|
144 |
+
position: fixed;
|
145 |
+
bottom: 10px;
|
146 |
+
right: 0px;
|
147 |
+
display: block;
|
148 |
+
width: 400px;
|
149 |
+
text-align: center;
|
150 |
+
background-color: #FFFFE0;
|
151 |
+
border: 1px solid #E6DB55;
|
152 |
+
-moz-border-radius: 4px;
|
153 |
+
-webkit-border-radius: 4px;
|
154 |
+
-border-radius: 4px;
|
155 |
}
|
woo-integration/js/script.js
CHANGED
@@ -1,48 +1,50 @@
|
|
1 |
-
// JavaScript Document
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
1 |
+
// JavaScript Document
|
2 |
+
(function($){
|
3 |
+
$(document).ready(function() {
|
4 |
+
//Button Settings Block
|
5 |
+
$("h3:contains('Button Settings')").next().find('th[scope="row"]').addClass('button_settings_th allign_top');
|
6 |
+
|
7 |
+
var i = $("h3:contains('Button Settings')").next().find('td').first();
|
8 |
+
i.html(i.html().replace('Buy Now Button only works for Paypal Standard, please activate Paypal Standard to enable this option.',''));
|
9 |
+
i.after("<td class='button_settings_desc'>Buy Now Button only works for Paypal Standard, please activate Paypal Standard to enable this option.</td>");
|
10 |
+
i.addClass('allign_top');
|
11 |
+
|
12 |
+
//Products Settings Block
|
13 |
+
$("h3:contains('Product Settings')").next().find('th[scope="row"]').addClass('product_settings_th allign_top');
|
14 |
+
$("h3:contains('Product Settings')").next().find('th[score="row"]').addClass('product_settings_th allign_top');
|
15 |
+
|
16 |
+
//Product Page Settings
|
17 |
+
$("h3:contains('Product Page Settings')").next().find('th[scope="row"]').addClass('product_page_settings_th allign_top');
|
18 |
+
|
19 |
+
//Shopping Cart Settings
|
20 |
+
$("h3:contains('Shopping Cart Settings')").next().find('th[scope="row"]').addClass('shopping_cart_settings_th allign_top');
|
21 |
+
|
22 |
+
//Product category Settings
|
23 |
+
$("h3:contains('Product Category Settings')").next().find('th[scope="row"]').addClass('product_category_settings_th allign_top');
|
24 |
+
|
25 |
+
//Thumbnail Settings
|
26 |
+
$("h3:contains('Thumbnail Settings')").next().next().find('th[scope="row"]').addClass('thumbnail_settings_th');
|
27 |
+
|
28 |
+
//Pagination Settings
|
29 |
+
$("h3:contains('Pagination settings')").next().find('th[scope="row"]').addClass('pagination_settings_th');
|
30 |
+
|
31 |
+
//Comment Settings
|
32 |
+
$("h3:contains('Comment Settings')").next().find('th[scope="row"]').addClass('comment_settings_th');
|
33 |
+
|
34 |
+
//Select control
|
35 |
+
$("select").wrap('<div class="wpsc_select_wrapper" />');
|
36 |
+
$("select").before('<span class="wpsc_select_span"></span>');
|
37 |
+
$("select").addClass("wpsc_select");
|
38 |
+
$("select").change(function (){
|
39 |
+
$(this).prev().text($(this).find('option:selected').text());
|
40 |
+
});
|
41 |
+
|
42 |
+
//Initialize select valua
|
43 |
+
$("select").each(function(index, element) {
|
44 |
+
$(this).prev().text($(this).find('option:selected').text());
|
45 |
+
});
|
46 |
+
|
47 |
+
//Remove Advanced Theme Setting
|
48 |
+
$('#themes_and_appearance').remove();
|
49 |
+
});
|
50 |
+
})(jQuery);
|
woo-integration/options_presentation.php
CHANGED
@@ -1,16 +1,16 @@
|
|
1 |
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
-
<head>
|
4 |
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5 |
-
<link rel="stylesheet" type="text/css" href="<?php echo WPSC_URL; ?>/woo-integration/css/style.css"/>
|
6 |
-
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
|
7 |
-
<script type="text/javascript" src="<?php echo WPSC_URL; ?>/woo-integration/js/script.js"></script>
|
8 |
-
<title>Dirty Options Presentaion</title>
|
9 |
-
</head>
|
10 |
-
<body>
|
11 |
-
<?php
|
12 |
-
require_once( WPSC_FILE_PATH . '/wpsc-admin/includes/settings-pages/presentation.php' );
|
13 |
-
echo wpsc_options_presentation();
|
14 |
-
?>
|
15 |
-
</body>
|
16 |
</html>
|
1 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
3 |
+
<head>
|
4 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5 |
+
<link rel="stylesheet" type="text/css" href="<?php echo WPSC_URL; ?>/woo-integration/css/style.css"/>
|
6 |
+
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
|
7 |
+
<script type="text/javascript" src="<?php echo WPSC_URL; ?>/woo-integration/js/script.js"></script>
|
8 |
+
<title>Dirty Options Presentaion</title>
|
9 |
+
</head>
|
10 |
+
<body>
|
11 |
+
<?php
|
12 |
+
require_once( WPSC_FILE_PATH . '/wpsc-admin/includes/settings-pages/presentation.php' );
|
13 |
+
echo wpsc_options_presentation();
|
14 |
+
?>
|
15 |
+
</body>
|
16 |
</html>
|
woo-integration/woo_integration.php
CHANGED
@@ -1,62 +1,62 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
//Remove presentation tab on wpsc option menu
|
4 |
-
function woo_wpsc_remove_presentation_tab($default_tabs){
|
5 |
-
unset( $default_tabs['presentation'] );
|
6 |
-
return $default_tabs;
|
7 |
-
}
|
8 |
-
|
9 |
-
//Filter redirect url so that WPSC presentation page will loac correctly after update
|
10 |
-
function woo_wpsc_filter_redirect_url($query){
|
11 |
-
if ($_GET['page']=='woothemes'){
|
12 |
-
$query = remove_query_arg('tab', $query);
|
13 |
-
$query = add_query_arg( 'page' , 'woothemes' , $query);
|
14 |
-
}
|
15 |
-
return $query;
|
16 |
-
}
|
17 |
-
|
18 |
-
//Print presentation menu subpage
|
19 |
-
function woo_wpsc_filter_option($return){
|
20 |
-
$return[1] .= '<li class="wpsc_presentation">
|
21 |
-
<a title="WPSC_presentation" href="#wpsc-option-presentation">
|
22 |
-
WPSC Presentation
|
23 |
-
</a>
|
24 |
-
</li>';
|
25 |
-
|
26 |
-
$return[0] .= ' <div class="group" id="wpsc-option-presentation">
|
27 |
-
<iframe id="wpsc-presentation" src="'.get_bloginfo('wpurl').'/wp-admin/admin-ajax.php?action=print_wpsc_presentation">
|
28 |
-
</iframe>
|
29 |
-
</div>';
|
30 |
-
|
31 |
-
return $return;
|
32 |
-
}
|
33 |
-
|
34 |
-
//Ajax respond for wp_ajax_print_wpsc_presentation
|
35 |
-
function woo_wpsc_presentation_menu(){
|
36 |
-
require_once( WPSC_FILE_PATH . '/woo-integration/options_presentation.php' );
|
37 |
-
die();
|
38 |
-
}
|
39 |
-
|
40 |
-
//Add main frame style sheet
|
41 |
-
function add_my_stylesheet() {
|
42 |
-
wp_register_style('gb_admin_style', get_bloginfo('template_url') . '/wpsc/css/main_frame_style.css' );
|
43 |
-
wp_enqueue_style('gb_admin_style');
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
function woo_wpsc_integration(){
|
48 |
-
//add_filter( 'wpsc_settings_tabs' , 'woo_wpsc_remove_presentation_tab');
|
49 |
-
add_filter( 'woo_before_option_page' , 'woo_wpsc_filter_option');
|
50 |
-
add_filter( 'wpsc_settings_redirect_url' , 'woo_wpsc_filter_redirect_url');
|
51 |
-
add_action( 'wp_ajax_print_wpsc_presentation' , 'woo_wpsc_presentation_menu');
|
52 |
-
add_action( 'admin_init' , 'add_my_stylesheet');
|
53 |
-
}
|
54 |
-
|
55 |
-
function wpsc_detect_woo(){
|
56 |
-
if (function_exists('woo_version')){
|
57 |
-
woo_wpsc_integration();
|
58 |
-
}
|
59 |
-
}
|
60 |
-
|
61 |
-
add_action('after_setup_theme', 'wpsc_detect_woo');
|
62 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
//Remove presentation tab on wpsc option menu
|
4 |
+
function woo_wpsc_remove_presentation_tab($default_tabs){
|
5 |
+
unset( $default_tabs['presentation'] );
|
6 |
+
return $default_tabs;
|
7 |
+
}
|
8 |
+
|
9 |
+
//Filter redirect url so that WPSC presentation page will loac correctly after update
|
10 |
+
function woo_wpsc_filter_redirect_url($query){
|
11 |
+
if ($_GET['page']=='woothemes'){
|
12 |
+
$query = remove_query_arg('tab', $query);
|
13 |
+
$query = add_query_arg( 'page' , 'woothemes' , $query);
|
14 |
+
}
|
15 |
+
return $query;
|
16 |
+
}
|
17 |
+
|
18 |
+
//Print presentation menu subpage
|
19 |
+
function woo_wpsc_filter_option($return){
|
20 |
+
$return[1] .= '<li class="wpsc_presentation">
|
21 |
+
<a title="WPSC_presentation" href="#wpsc-option-presentation">
|
22 |
+
WPSC Presentation
|
23 |
+
</a>
|
24 |
+
</li>';
|
25 |
+
|
26 |
+
$return[0] .= ' <div class="group" id="wpsc-option-presentation">
|
27 |
+
<iframe id="wpsc-presentation" src="'.get_bloginfo('wpurl').'/wp-admin/admin-ajax.php?action=print_wpsc_presentation">
|
28 |
+
</iframe>
|
29 |
+
</div>';
|
30 |
+
|
31 |
+
return $return;
|
32 |
+
}
|
33 |
+
|
34 |
+
//Ajax respond for wp_ajax_print_wpsc_presentation
|
35 |
+
function woo_wpsc_presentation_menu(){
|
36 |
+
require_once( WPSC_FILE_PATH . '/woo-integration/options_presentation.php' );
|
37 |
+
die();
|
38 |
+
}
|
39 |
+
|
40 |
+
//Add main frame style sheet
|
41 |
+
function add_my_stylesheet() {
|
42 |
+
wp_register_style('gb_admin_style', get_bloginfo('template_url') . '/wpsc/css/main_frame_style.css' );
|
43 |
+
wp_enqueue_style('gb_admin_style');
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
function woo_wpsc_integration(){
|
48 |
+
//add_filter( 'wpsc_settings_tabs' , 'woo_wpsc_remove_presentation_tab');
|
49 |
+
add_filter( 'woo_before_option_page' , 'woo_wpsc_filter_option');
|
50 |
+
add_filter( 'wpsc_settings_redirect_url' , 'woo_wpsc_filter_redirect_url');
|
51 |
+
add_action( 'wp_ajax_print_wpsc_presentation' , 'woo_wpsc_presentation_menu');
|
52 |
+
add_action( 'admin_init' , 'add_my_stylesheet');
|
53 |
+
}
|
54 |
+
|
55 |
+
function wpsc_detect_woo(){
|
56 |
+
if (function_exists('woo_version')){
|
57 |
+
woo_wpsc_integration();
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
add_action('after_setup_theme', 'wpsc_detect_woo');
|
62 |
?>
|
wp-shopping-cart.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WP e-Commerce
|
4 |
* Plugin URI: http://getshopped.org/
|
5 |
* Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://getshopped.org" target="_blank">GetShopped.org</a> | <a href="http://getshopped.org/forums/" target="_blank">Support Forum</a> | <a href="http://docs.getshopped.org/" target="_blank">Documentation</a>
|
6 |
-
* Version: 3.8.
|
7 |
* Author: Instinct Entertainment
|
8 |
* Author URI: http://getshopped.org/
|
9 |
**/
|
3 |
* Plugin Name: WP e-Commerce
|
4 |
* Plugin URI: http://getshopped.org/
|
5 |
* Description: A plugin that provides a WordPress Shopping Cart. See also: <a href="http://getshopped.org" target="_blank">GetShopped.org</a> | <a href="http://getshopped.org/forums/" target="_blank">Support Forum</a> | <a href="http://docs.getshopped.org/" target="_blank">Documentation</a>
|
6 |
+
* Version: 3.8.6
|
7 |
* Author: Instinct Entertainment
|
8 |
* Author URI: http://getshopped.org/
|
9 |
**/
|
wpsc-admin/admin-form-functions.php
CHANGED
@@ -247,213 +247,210 @@ function wpsc_right_now() {
|
|
247 |
}
|
248 |
|
249 |
|
250 |
-
function wpsc_packing_slip($purchase_id) {
|
251 |
echo "<!DOCTYPE html><html><head><title>" . __( 'Packing Slip', 'wpsc' ) . "</title></head><body id='wpsc-packing-slip'>";
|
252 |
global $wpdb;
|
253 |
-
$purch_sql = "SELECT * FROM `".WPSC_TABLE_PURCHASE_LOGS."` WHERE `id
|
254 |
-
|
255 |
|
256 |
-
|
|
|
|
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
$
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
|
277 |
-
|
278 |
-
$form_data = $wpdb->get_results("SELECT * FROM `".WPSC_TABLE_CHECKOUT_FORMS."` WHERE `active` = '1'",ARRAY_A);
|
279 |
-
|
280 |
-
foreach($form_data as $form_field) {
|
281 |
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value']), ENT_QUOTES, 'UTF-8')."</td></tr>\n\r";
|
291 |
-
break;
|
292 |
-
|
293 |
-
case 'delivery_country':
|
294 |
|
295 |
-
|
296 |
-
|
297 |
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
else
|
306 |
-
echo " <tr class='heading'><td colspan='2'><strong>".wp_kses($form_field['name'], array()).":</strong></td></tr>\n\r";
|
307 |
-
break;
|
308 |
-
|
309 |
-
default:
|
310 |
|
311 |
-
|
312 |
-
parse_str($rekeyed_input[$form_field['id']]['value'], $cupcakes );
|
313 |
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
|
|
|
|
|
|
|
|
|
|
335 |
}
|
336 |
-
|
337 |
-
|
338 |
-
echo " <tr><td>".__('Name', 'wpsc').":</td><td>".$purch_data['firstname']." ".$purch_data['lastname']."</td></tr>\n\r";
|
339 |
-
echo " <tr><td>".__('Address', 'wpsc').":</td><td>".$purch_data['address']."</td></tr>\n\r";
|
340 |
-
echo " <tr><td>".__('Phone', 'wpsc').":</td><td>".$purch_data['phone']."</td></tr>\n\r";
|
341 |
-
echo " <tr><td>".__('Email', 'wpsc').":</td><td>".$purch_data['email']."</td></tr>\n\r";
|
342 |
}
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
|
|
|
|
|
|
355 |
}
|
|
|
|
|
356 |
}
|
357 |
}
|
|
|
358 |
|
359 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
360 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
|
362 |
-
|
363 |
-
|
364 |
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
echo " <th>".__('Quantity', 'wpsc')." </th>";
|
369 |
-
|
370 |
-
echo " <th>".__('Name', 'wpsc')."</th>";
|
371 |
-
|
372 |
-
|
373 |
-
echo " <th>".__('Price', 'wpsc')." </th>";
|
374 |
-
|
375 |
-
echo " <th>".__('Shipping', 'wpsc')." </th>";
|
376 |
-
echo '<th>' . __('Tax', 'wpsc') . '</th>';
|
377 |
-
echo '</tr>';
|
378 |
-
$endtotal = 0;
|
379 |
-
$all_donations = true;
|
380 |
-
$all_no_shipping = true;
|
381 |
-
$file_link_list = array();
|
382 |
-
foreach($cart_log as $cart_row) {
|
383 |
-
$alternate = "";
|
384 |
-
$j++;
|
385 |
-
if(($j % 2) != 0) {
|
386 |
-
$alternate = "class='alt'";
|
387 |
-
}
|
388 |
-
// product ID will be $cart_row['prodid']. need to fetch name and stuff
|
389 |
-
|
390 |
-
$variation_list = '';
|
391 |
-
|
392 |
-
if($cart_row['donation'] != 1) {
|
393 |
-
$all_donations = false;
|
394 |
-
}
|
395 |
-
|
396 |
-
if($cart_row['no_shipping'] != 1) {
|
397 |
-
$shipping = $cart_row['pnp'] * $cart_row['quantity'];
|
398 |
-
$total_shipping += $shipping;
|
399 |
-
$all_no_shipping = false;
|
400 |
-
} else {
|
401 |
-
$shipping = 0;
|
402 |
-
}
|
403 |
|
404 |
-
|
405 |
-
$
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
|
411 |
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
echo " <td>";
|
416 |
-
echo $cart_row['quantity'];
|
417 |
-
echo " </td>";
|
418 |
-
|
419 |
-
echo " <td>";
|
420 |
-
echo $cart_row['name'];
|
421 |
-
echo stripslashes($variation_list);
|
422 |
-
echo " </td>";
|
423 |
-
|
424 |
-
|
425 |
-
echo " <td>";
|
426 |
-
echo wpsc_currency_display( $price );
|
427 |
-
echo " </td>";
|
428 |
-
|
429 |
-
echo " <td>";
|
430 |
-
echo wpsc_currency_display($shipping );
|
431 |
-
echo " </td>";
|
432 |
-
|
433 |
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
echo '</tr>';
|
439 |
-
}
|
440 |
-
echo "</table>";
|
441 |
|
442 |
-
echo
|
443 |
-
echo
|
444 |
-
echo
|
445 |
-
|
446 |
-
if($purch_data['wpec_taxes_total'] != 0.00)
|
447 |
-
{
|
448 |
-
echo '<tr><th>Taxes</th><td>' . wpsc_currency_display( $purch_data['wpec_taxes_total'] ) . '</td></tr>';
|
449 |
-
}
|
450 |
-
echo '<tr><th>Total Price</th><td>' . wpsc_currency_display( $purch_data['totalprice'] ) . '</td></tr>';
|
451 |
-
echo '</table>';
|
452 |
|
453 |
-
|
454 |
-
|
455 |
-
echo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
|
458 |
}
|
459 |
|
247 |
}
|
248 |
|
249 |
|
250 |
+
function wpsc_packing_slip( $purchase_id ) {
|
251 |
echo "<!DOCTYPE html><html><head><title>" . __( 'Packing Slip', 'wpsc' ) . "</title></head><body id='wpsc-packing-slip'>";
|
252 |
global $wpdb;
|
253 |
+
$purch_sql = $wpdb->prepare( "SELECT * FROM `".WPSC_TABLE_PURCHASE_LOGS."` WHERE `id`=%d", $purchase_id );
|
254 |
+
$purch_data = $wpdb->get_row( $purch_sql, ARRAY_A ) ;
|
255 |
|
256 |
+
$cartsql = $wpdb->prepare( "SELECT * FROM `".WPSC_TABLE_CART_CONTENTS."` WHERE `purchaseid`=%d", $purchase_id );
|
257 |
+
$cart_log = $wpdb->get_results($cartsql,ARRAY_A) ;
|
258 |
+
$j = 0;
|
259 |
|
260 |
+
if($cart_log != null) {
|
261 |
+
echo "<div class='packing_slip'>\n\r";
|
262 |
+
echo apply_filters( 'wpsc_packing_slip_header', '<h2>' . __( 'Packing Slip', 'wpsc' ) . "</h2>\n\r" );
|
263 |
+
echo "<strong>".__('Order', 'wpsc')." #</strong> ".$purchase_id."<br /><br />\n\r";
|
264 |
+
|
265 |
+
echo "<table>\n\r";
|
266 |
+
|
267 |
+
$form_sql = $wpdb->prepare( "SELECT * FROM `".WPSC_TABLE_SUBMITED_FORM_DATA."` WHERE `log_id` = %d", $purchase_id );
|
268 |
+
$input_data = $wpdb->get_results($form_sql,ARRAY_A);
|
269 |
+
|
270 |
+
foreach($input_data as $input_row) {
|
271 |
+
$rekeyed_input[$input_row['form_id']] = $input_row;
|
272 |
+
}
|
273 |
+
|
274 |
+
|
275 |
+
if($input_data != null) {
|
276 |
+
$form_data = $wpdb->get_results("SELECT * FROM `".WPSC_TABLE_CHECKOUT_FORMS."` WHERE `active` = '1'",ARRAY_A);
|
|
|
277 |
|
278 |
+
foreach($form_data as $form_field) {
|
|
|
|
|
|
|
279 |
|
280 |
+
switch($form_field['type']) {
|
281 |
+
case 'country':
|
282 |
+
|
283 |
+
$delivery_region_count = $wpdb->get_var("SELECT COUNT(`regions`.`id`) FROM `".WPSC_TABLE_REGION_TAX."` AS `regions` INNER JOIN `".WPSC_TABLE_CURRENCY_LIST."` AS `country` ON `country`.`id` = `regions`.`country_id` WHERE `country`.`isocode` IN('".$wpdb->escape( $purch_data['billing_country'])."')");
|
284 |
+
|
285 |
+
if(is_numeric($purch_data['billing_region']) && ($delivery_region_count > 0))
|
286 |
+
echo " <tr><td>".__('State', 'wpsc').":</td><td>".wpsc_get_region($purch_data['billing_region'])."</td></tr>\n\r";
|
|
|
|
|
|
|
|
|
|
|
287 |
|
288 |
+
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value']), ENT_QUOTES, 'UTF-8')."</td></tr>\n\r";
|
289 |
+
break;
|
290 |
|
291 |
+
case 'delivery_country':
|
292 |
+
|
293 |
+
if(is_numeric($purch_data['shipping_region']) && ($delivery_region_count > 0))
|
294 |
+
echo " <tr><td>".__('State', 'wpsc').":</td><td>".wpsc_get_region($purch_data['shipping_region'])."</td></tr>\n\r";
|
295 |
+
|
296 |
+
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value']), ENT_QUOTES, 'UTF-8')."</td></tr>\n\r";
|
297 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
298 |
|
299 |
+
case 'heading':
|
|
|
300 |
|
301 |
+
if($form_field['name'] == "Hidden Fields")
|
302 |
+
continue;
|
303 |
+
else
|
304 |
+
echo " <tr class='heading'><td colspan='2'><strong>".wp_kses($form_field['name'], array()).":</strong></td></tr>\n\r";
|
305 |
+
break;
|
306 |
+
|
307 |
+
default:
|
308 |
+
if( $form_field['name'] == "Cupcakes") {
|
309 |
+
parse_str($rekeyed_input[$form_field['id']]['value'], $cupcakes );
|
310 |
+
|
311 |
+
foreach( $cupcakes as $product_id => $quantity ) {
|
312 |
+
$product = get_post($product_id);
|
313 |
+
$string .= "(".$quantity.") ".$product->post_title.", ";
|
314 |
+
}
|
315 |
+
|
316 |
+
$string = rtrim($string, ", ");
|
317 |
+
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".htmlentities(stripslashes($string), ENT_QUOTES, 'UTF-8')."</td></tr>\n\r";
|
318 |
+
} else {
|
319 |
+
if ($form_field['name']=="State" && !empty($purch_data['billing_region']) || $form_field['name']=="State" && !empty($purch_data['billing_region']))
|
320 |
+
echo "";
|
321 |
+
else
|
322 |
+
echo " <tr><td>".wp_kses($form_field['name'], array() ).":</td><td>".
|
323 |
+
( isset( $rekeyed_input[$form_field['id']] ) ? htmlentities(stripslashes($rekeyed_input[$form_field['id']]['value']), ENT_QUOTES, 'UTF-8') : '' ).
|
324 |
+
"</td></tr>\n\r";
|
325 |
+
}
|
326 |
+
break;
|
327 |
}
|
328 |
+
|
|
|
|
|
|
|
|
|
|
|
329 |
}
|
330 |
+
} else {
|
331 |
+
echo " <tr><td>".__('Name', 'wpsc').":</td><td>".$purch_data['firstname']." ".$purch_data['lastname']."</td></tr>\n\r";
|
332 |
+
echo " <tr><td>".__('Address', 'wpsc').":</td><td>".$purch_data['address']."</td></tr>\n\r";
|
333 |
+
echo " <tr><td>".__('Phone', 'wpsc').":</td><td>".$purch_data['phone']."</td></tr>\n\r";
|
334 |
+
echo " <tr><td>".__('Email', 'wpsc').":</td><td>".$purch_data['email']."</td></tr>\n\r";
|
335 |
+
}
|
336 |
+
|
337 |
+
if ( 2 == get_option( 'payment_method' ) ) {
|
338 |
+
$gateway_name = '';
|
339 |
+
$nzshpcrt_gateways = nzshpcrt_get_gateways();
|
340 |
+
|
341 |
+
foreach( $nzshpcrt_gateways as $gateway ) {
|
342 |
+
if ( $purch_data['gateway'] != 'testmode' ) {
|
343 |
+
if ( $gateway['internalname'] == $purch_data['gateway'] ) {
|
344 |
+
$gateway_name = $gateway['name'];
|
345 |
}
|
346 |
+
} else {
|
347 |
+
$gateway_name = __('Manual Payment', 'wpsc');
|
348 |
}
|
349 |
}
|
350 |
+
}
|
351 |
|
352 |
+
echo "</table>\n\r";
|
353 |
+
|
354 |
+
|
355 |
+
do_action ('wpsc_packing_slip_extra_info',$purchase_id);
|
356 |
+
|
357 |
+
|
358 |
+
echo "<table class='packing_slip'>";
|
359 |
|
360 |
+
echo "<tr>";
|
361 |
+
echo " <th>".__('Quantity', 'wpsc')." </th>";
|
362 |
+
|
363 |
+
echo " <th>".__('Name', 'wpsc')."</th>";
|
364 |
+
|
365 |
+
|
366 |
+
echo " <th>".__('Price', 'wpsc')." </th>";
|
367 |
+
|
368 |
+
echo " <th>".__('Shipping', 'wpsc')." </th>";
|
369 |
+
echo '<th>' . __('Tax', 'wpsc') . '</th>';
|
370 |
+
echo '</tr>';
|
371 |
+
$endtotal = 0;
|
372 |
+
$all_donations = true;
|
373 |
+
$all_no_shipping = true;
|
374 |
+
$file_link_list = array();
|
375 |
+
$total_shipping = 0;
|
376 |
+
foreach($cart_log as $cart_row) {
|
377 |
+
$alternate = "";
|
378 |
+
$j++;
|
379 |
+
if(($j % 2) != 0) {
|
380 |
+
$alternate = "class='alt'";
|
381 |
+
}
|
382 |
+
// product ID will be $cart_row['prodid']. need to fetch name and stuff
|
383 |
|
384 |
+
$variation_list = '';
|
|
|
385 |
|
386 |
+
if($cart_row['donation'] != 1) {
|
387 |
+
$all_donations = false;
|
388 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
|
390 |
+
if($cart_row['no_shipping'] != 1) {
|
391 |
+
$shipping = $cart_row['pnp'];
|
392 |
+
$total_shipping += $shipping;
|
393 |
+
$all_no_shipping = false;
|
394 |
+
} else {
|
395 |
+
$shipping = 0;
|
396 |
+
}
|
397 |
+
|
398 |
+
$price = $cart_row['price'] * $cart_row['quantity'];
|
399 |
+
$gst = $price - ($price / (1+($cart_row['gst'] / 100)));
|
400 |
+
|
401 |
+
if($gst > 0) {
|
402 |
+
$tax_per_item = $gst / $cart_row['quantity'];
|
403 |
+
}
|
404 |
|
405 |
|
406 |
+
echo "<tr $alternate>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
|
408 |
+
|
409 |
+
echo " <td>";
|
410 |
+
echo $cart_row['quantity'];
|
411 |
+
echo " </td>";
|
|
|
|
|
|
|
412 |
|
413 |
+
echo " <td>";
|
414 |
+
echo $cart_row['name'];
|
415 |
+
echo stripslashes($variation_list);
|
416 |
+
echo " </td>";
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
|
418 |
+
|
419 |
+
echo " <td>";
|
420 |
+
echo wpsc_currency_display( $price );
|
421 |
+
echo " </td>";
|
422 |
+
|
423 |
+
echo " <td>";
|
424 |
+
echo wpsc_currency_display($shipping );
|
425 |
+
echo " </td>";
|
426 |
+
|
427 |
+
|
428 |
+
|
429 |
+
echo '<td>';
|
430 |
+
echo wpsc_currency_display( $cart_row['tax_charged'] );
|
431 |
+
echo '</td>';
|
432 |
+
echo '</tr>';
|
433 |
}
|
434 |
+
|
435 |
+
echo "</table>";
|
436 |
+
echo '<table class="packing-slip-totals">';
|
437 |
+
if ( floatval( $purch_data['discount_value'] ) )
|
438 |
+
echo '<tr><th>'.__('Discount', 'wpsc').'</th><td>(' . wpsc_currency_display( $purch_data['discount_value'] ) . ')</td></tr>';
|
439 |
+
|
440 |
+
echo '<tr><th>'.__('Base Shipping','wpsc').'</th><td>' . wpsc_currency_display( $purch_data['base_shipping'] ) . '</td></tr>';
|
441 |
+
echo '<tr><th>'.__('Total Shipping','wpsc').'</th><td>' . wpsc_currency_display( $purch_data['base_shipping'] + $total_shipping ) . '</td></tr>';
|
442 |
+
//wpec_taxes
|
443 |
+
if($purch_data['wpec_taxes_total'] != 0.00)
|
444 |
+
{
|
445 |
+
echo '<tr><th>'.__('Taxes','wpsc').'</th><td>' . wpsc_currency_display( $purch_data['wpec_taxes_total'] ) . '</td></tr>';
|
446 |
+
}
|
447 |
+
echo '<tr><th>'.__('Total Price','wpsc').'</th><td>' . wpsc_currency_display( $purch_data['totalprice'] ) . '</td></tr>';
|
448 |
+
echo '</table>';
|
449 |
+
|
450 |
+
echo "</div>\n\r";
|
451 |
+
} else {
|
452 |
+
echo "<br />".__('This users cart was empty', 'wpsc');
|
453 |
+
}
|
454 |
|
455 |
}
|
456 |
|
wpsc-admin/admin.php
CHANGED
@@ -251,9 +251,6 @@ function wpsc_admin_include_css_and_js( ) {
|
|
251 |
wp_enqueue_style( 'wp-e-commerce-admin', WPSC_URL . '/wpsc-admin/css/admin.css', false, $version_identifier, 'all' );
|
252 |
wp_enqueue_style( 'wp-e-commerce-admin-dynamic', $siteurl . "/wp-admin/admin.php?wpsc_admin_dynamic_css=true", false, $version_identifier, 'all' );
|
253 |
|
254 |
-
// Prototype breaks dragging and dropping, I need it gone
|
255 |
-
wp_deregister_script( 'prototype' );
|
256 |
-
|
257 |
// remove the old javascript and CSS, we want it no more, it smells bad
|
258 |
remove_action( 'admin_head', 'wpsc_admin_css' );
|
259 |
|
@@ -352,7 +349,6 @@ function wpsc_admin_include_css_and_js_refac( $pagehook ) {
|
|
352 |
}
|
353 |
if ( 'dashboard_page_wpsc-upgrades' == $pagehook || 'dashboard_page_wpsc-update' == $pagehook )
|
354 |
wp_enqueue_style( 'wp-e-commerce-admin', WPSC_URL . '/wpsc-admin/css/admin.css', false, $version_identifier, 'all' );
|
355 |
-
wp_deregister_script( 'prototype' );
|
356 |
|
357 |
// remove the old javascript and CSS, we want it no more, it smells bad
|
358 |
remove_action( 'admin_head', 'wpsc_admin_css' );
|
251 |
wp_enqueue_style( 'wp-e-commerce-admin', WPSC_URL . '/wpsc-admin/css/admin.css', false, $version_identifier, 'all' );
|
252 |
wp_enqueue_style( 'wp-e-commerce-admin-dynamic', $siteurl . "/wp-admin/admin.php?wpsc_admin_dynamic_css=true", false, $version_identifier, 'all' );
|
253 |
|
|
|
|
|
|
|
254 |
// remove the old javascript and CSS, we want it no more, it smells bad
|
255 |
remove_action( 'admin_head', 'wpsc_admin_css' );
|
256 |
|
349 |
}
|
350 |
if ( 'dashboard_page_wpsc-upgrades' == $pagehook || 'dashboard_page_wpsc-update' == $pagehook )
|
351 |
wp_enqueue_style( 'wp-e-commerce-admin', WPSC_URL . '/wpsc-admin/css/admin.css', false, $version_identifier, 'all' );
|
|
|
352 |
|
353 |
// remove the old javascript and CSS, we want it no more, it smells bad
|
354 |
remove_action( 'admin_head', 'wpsc_admin_css' );
|
wpsc-admin/ajax-and-init.php
CHANGED
@@ -1255,6 +1255,7 @@ if ( isset( $_REQUEST['wpsc_admin_action'] ) && ($_REQUEST['wpsc_admin_action']
|
|
1255 |
//handles the editing and adding of new checkout fields
|
1256 |
function wpsc_checkout_settings() {
|
1257 |
global $wpdb;
|
|
|
1258 |
$wpdb->show_errors = true;
|
1259 |
$filter = isset( $_POST['selected_form_set'] ) ? $_POST['selected_form_set'] : '0';
|
1260 |
if ( ! isset( $_POST['new_form_mandatory'] ) )
|
@@ -1614,17 +1615,17 @@ if ( isset( $_REQUEST['wpsc_admin_action'] ) && ( 'wpsc-delete-coupon' == $_REQU
|
|
1614 |
|
1615 |
|
1616 |
function flat_price( $price ) {
|
1617 |
-
if (
|
1618 |
return true;
|
1619 |
}
|
1620 |
|
1621 |
function percentile_price( $price ) {
|
1622 |
-
if (
|
1623 |
return true;
|
1624 |
}
|
1625 |
|
1626 |
function differential_price( $price ) {
|
1627 |
-
if (
|
1628 |
return true;
|
1629 |
}
|
1630 |
|
@@ -1772,55 +1773,14 @@ function save_term_prices( $term_id ) {
|
|
1772 |
foreach ( (array)$children_ids as $parents => $kids ) {
|
1773 |
|
1774 |
$kids = array_values( $kids );
|
1775 |
-
$parent_pricing = get_product_meta( $parents, "price", true );
|
1776 |
|
1777 |
foreach ( $kids as $kiddos ) {
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
if ( $var_price_type == 'flat' ) {
|
1782 |
-
|
1783 |
-
update_product_meta( $kiddos, "price", floatval( $_POST["variation_price"] ) );
|
1784 |
-
} elseif ( $var_price_type == 'percentile' ) {
|
1785 |
-
|
1786 |
-
//Are we decreasing or increasing the price?
|
1787 |
-
|
1788 |
-
if ( strchr( $_POST["variation_price"], '-' ) )
|
1789 |
-
$positive = false;
|
1790 |
-
else
|
1791 |
-
$positive = true;
|
1792 |
-
|
1793 |
-
//Now, let's get the parent product price, +/- by the percentage given
|
1794 |
-
$percentage = (absint( $_POST["variation_price"] ) / 100);
|
1795 |
-
|
1796 |
-
if ( $positive )
|
1797 |
-
$price = $parent_pricing + ($parent_pricing * $percentage);
|
1798 |
-
else
|
1799 |
-
$price = $parent_pricing - ($parent_pricing * $percentage);
|
1800 |
-
|
1801 |
-
update_product_meta( $kiddos, "price", $price );
|
1802 |
-
} elseif ( $var_price_type == 'differential' ) {
|
1803 |
-
|
1804 |
-
//Are we decreasing or increasing the price?
|
1805 |
-
if ( strchr( $_POST["variation_price"], '-' ) )
|
1806 |
-
$positive = false;
|
1807 |
-
else
|
1808 |
-
$positive = true;
|
1809 |
-
|
1810 |
-
//Now, let's get the parent product price, +/- by the differential given
|
1811 |
-
$differential = (absint( $_POST["variation_price"] ));
|
1812 |
-
|
1813 |
-
if ( $positive )
|
1814 |
-
$price = $parent_pricing + $differential;
|
1815 |
-
else
|
1816 |
-
$price = $parent_pricing - $differential;
|
1817 |
-
update_product_meta( $kiddos, "price", $price );
|
1818 |
-
}
|
1819 |
}
|
1820 |
}
|
1821 |
}
|
1822 |
}
|
1823 |
add_action( 'edited_wpsc-variation', 'save_term_prices' );
|
1824 |
add_action( 'created_wpsc-variation', 'save_term_prices' );
|
1825 |
-
|
1826 |
?>
|
1255 |
//handles the editing and adding of new checkout fields
|
1256 |
function wpsc_checkout_settings() {
|
1257 |
global $wpdb;
|
1258 |
+
$updated = 0;
|
1259 |
$wpdb->show_errors = true;
|
1260 |
$filter = isset( $_POST['selected_form_set'] ) ? $_POST['selected_form_set'] : '0';
|
1261 |
if ( ! isset( $_POST['new_form_mandatory'] ) )
|
1615 |
|
1616 |
|
1617 |
function flat_price( $price ) {
|
1618 |
+
if ( ! empty( $price ) && strchr( $price, '-' ) === false && strchr( $price, '+' ) === false && strchr( $price, '%' ) === false )
|
1619 |
return true;
|
1620 |
}
|
1621 |
|
1622 |
function percentile_price( $price ) {
|
1623 |
+
if ( ! empty( $price ) && ( strchr( $price, '-' ) || strchr( $price, '+' ) ) && strchr( $price, '%' ) )
|
1624 |
return true;
|
1625 |
}
|
1626 |
|
1627 |
function differential_price( $price ) {
|
1628 |
+
if ( ! empty( $price ) && ( strchr( $price, '-' ) || strchr( $price, '+' ) ) && strchr( $price, '%' ) === false )
|
1629 |
return true;
|
1630 |
}
|
1631 |
|
1773 |
foreach ( (array)$children_ids as $parents => $kids ) {
|
1774 |
|
1775 |
$kids = array_values( $kids );
|
|
|
1776 |
|
1777 |
foreach ( $kids as $kiddos ) {
|
1778 |
+
$price = wpsc_determine_variation_price( $kiddos );
|
1779 |
+
update_product_meta( $kiddos, 'price', $price );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1780 |
}
|
1781 |
}
|
1782 |
}
|
1783 |
}
|
1784 |
add_action( 'edited_wpsc-variation', 'save_term_prices' );
|
1785 |
add_action( 'created_wpsc-variation', 'save_term_prices' );
|
|
|
1786 |
?>
|
wpsc-admin/css/settingspage.css
CHANGED
@@ -2,10 +2,10 @@ table#wpsc_checkout_list{
|
|
2 |
width:100%;
|
3 |
}
|
4 |
th#trash{
|
5 |
-
width:
|
6 |
}
|
7 |
th#drag{
|
8 |
-
width:
|
9 |
}
|
10 |
tr.wpsc_grey{
|
11 |
background-color: #ededed;
|
@@ -18,7 +18,7 @@ td.drag a:hover{
|
|
18 |
cursor: move;
|
19 |
}
|
20 |
th#mandatory{
|
21 |
-
width:
|
22 |
}
|
23 |
|
24 |
#checkout_message{
|
2 |
width:100%;
|
3 |
}
|
4 |
th#trash{
|
5 |
+
width:60px;
|
6 |
}
|
7 |
th#drag{
|
8 |
+
width:50px;
|
9 |
}
|
10 |
tr.wpsc_grey{
|
11 |
background-color: #ededed;
|
18 |
cursor: move;
|
19 |
}
|
20 |
th#mandatory{
|
21 |
+
width:90px;
|
22 |
}
|
23 |
|
24 |
#checkout_message{
|
wpsc-admin/display-items.page.php
CHANGED
@@ -65,9 +65,22 @@ function wpsc_additional_column_name_variations( $columns ){
|
|
65 |
//For BC for 3.0 (hoping to remove for WPEC 3.9)
|
66 |
register_column_headers( 'wpsc-product_variants', $columns );
|
67 |
|
|
|
|
|
68 |
return apply_filters( 'wpsc_variation_column_headers', $columns);
|
69 |
}
|
70 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
/**
|
72 |
* wpsc_additional_column_data.
|
73 |
*
|
@@ -176,7 +189,7 @@ function wpsc_additional_column_data( $column ) {
|
|
176 |
}
|
177 |
else
|
178 |
echo wpsc_product_variation_price_available( $post->ID ).'+';
|
179 |
-
echo '<input type="hidden" value="'.$has_var.'"
|
180 |
|
181 |
break;
|
182 |
case 'sale_price' :
|
65 |
//For BC for 3.0 (hoping to remove for WPEC 3.9)
|
66 |
register_column_headers( 'wpsc-product_variants', $columns );
|
67 |
|
68 |
+
add_filter( 'get_user_option_managewpsc-product_variantscolumnshidden', 'wpsc_variation_form_hidden_columns' );
|
69 |
+
|
70 |
return apply_filters( 'wpsc_variation_column_headers', $columns);
|
71 |
}
|
72 |
|
73 |
+
function wpsc_variation_form_hidden_columns( $return ) {
|
74 |
+
global $post;
|
75 |
+
|
76 |
+
if ( isset( $post ) && $post->post_parent == 0 && ! is_numeric( get_post_meta( $post->ID, '_wpsc_stock', true ) ) )
|
77 |
+
$return = array(
|
78 |
+
'stock',
|
79 |
+
);
|
80 |
+
|
81 |
+
return $return;
|
82 |
+
}
|
83 |
+
|
84 |
/**
|
85 |
* wpsc_additional_column_data.
|
86 |
*
|
189 |
}
|
190 |
else
|
191 |
echo wpsc_product_variation_price_available( $post->ID ).'+';
|
192 |
+
echo '<input type="hidden" value="'.$has_var.'" id="inline_' . $post->ID . '_has_var" />';
|
193 |
|
194 |
break;
|
195 |
case 'sale_price' :
|
wpsc-admin/includes/display-items-functions.php
CHANGED
@@ -222,7 +222,7 @@ function wpsc_price_control_forms() {
|
|
222 |
}
|
223 |
?>
|
224 |
<tr>
|
225 |
-
<td><input type="text" size="5" value="
|
226 |
<td><input type='text' size='10' value='' name='table_rate_price[table_price][]'/></td>
|
227 |
</tr>
|
228 |
</table>
|
@@ -365,7 +365,9 @@ function wpsc_product_taxes_forms() {
|
|
365 |
<p><?php echo $wpec_taxes_controller->wpec_taxes_build_input( $taxable_checkbox_settings ); ?></p>
|
366 |
<?php
|
367 |
}
|
|
|
368 |
function wpsc_product_variation_forms() {
|
|
|
369 |
global $post, $wpdb, $wp_query, $variations_processor, $wpsc_product_defaults;
|
370 |
|
371 |
$db_version = get_option( 'db_version' );
|
@@ -396,55 +398,18 @@ function wpsc_product_variation_forms() {
|
|
396 |
<p><?php _e( 'You must first save this Product as a Draft before adding variations', 'wpsc' ); ?></p>
|
397 |
<?php else : ?>
|
398 |
<div id="product_variations">
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
if ( in_array( $variation_set->term_id, $product_terms ) )
|
412 |
-
$set_checked_state = "checked='checked'"; ?>
|
413 |
-
<div class="variation_set">
|
414 |
-
|
415 |
-
<label class='set_label'>
|
416 |
-
<input type="checkbox" <?php echo $set_checked_state; ?> name="variations[<?php echo $variation_set->term_id; ?>]" value="1">
|
417 |
-
<?php echo $variation_set->name; ?>
|
418 |
-
</label>
|
419 |
-
|
420 |
-
<?php
|
421 |
-
$variations = get_terms( 'wpsc-variation', array (
|
422 |
-
'hide_empty' => 0,
|
423 |
-
'parent' => $variation_set->term_id
|
424 |
-
) );
|
425 |
-
// Loop through the variations
|
426 |
-
foreach ( (array)$variations as $variation ) :
|
427 |
-
$checked_state = '';
|
428 |
-
|
429 |
-
if ( in_array( $variation->term_id, $product_terms ) )
|
430 |
-
$checked_state = "checked='checked'";
|
431 |
-
|
432 |
-
?>
|
433 |
-
|
434 |
-
<div class="variation">
|
435 |
-
<label>
|
436 |
-
<input type="checkbox" <?php echo $checked_state; ?> name="edit_var_val[<?php echo $variation_set->term_id; ?>][<?php echo $variation->term_id; ?>]" value="1">
|
437 |
-
<?php echo $variation->name; ?>
|
438 |
-
</label>
|
439 |
-
</div>
|
440 |
-
|
441 |
-
<?php endforeach; ?>
|
442 |
-
|
443 |
-
</div>
|
444 |
-
|
445 |
-
<?php endforeach; ?>
|
446 |
-
|
447 |
-
</div>
|
448 |
<a class="preview button update_variations_action" href='#'><?php _e( 'Update Variations →', 'wpsc' ); ?></a>
|
449 |
|
450 |
</div>
|
@@ -1012,7 +977,8 @@ function wpsc_attachment_fields( $form_fields, $post ) {
|
|
1012 |
|
1013 |
// regenerate size metadata in case it's missing
|
1014 |
if ( ! image_get_intermediate_size( $post->ID, $check ) ) {
|
1015 |
-
$metadata = wp_get_attachment_metadata( $post->ID )
|
|
|
1016 |
$file = get_attached_file( $post->ID );
|
1017 |
$generated = wp_generate_attachment_metadata( $thumbnail_id, $file );
|
1018 |
$metadata['sizes'] = array_merge( $generated['sizes'], $metadata['sizes'] );
|
222 |
}
|
223 |
?>
|
224 |
<tr>
|
225 |
+
<td><input type="text" size="5" value="" name="table_rate_price[quantity][]"/><span class='description'><?php _e( 'and above', 'wpsc' ); ?></span> </td>
|
226 |
<td><input type='text' size='10' value='' name='table_rate_price[table_price][]'/></td>
|
227 |
</tr>
|
228 |
</table>
|
365 |
<p><?php echo $wpec_taxes_controller->wpec_taxes_build_input( $taxable_checkbox_settings ); ?></p>
|
366 |
<?php
|
367 |
}
|
368 |
+
|
369 |
function wpsc_product_variation_forms() {
|
370 |
+
require_once( 'walker-variation-checklist.php' );
|
371 |
global $post, $wpdb, $wp_query, $variations_processor, $wpsc_product_defaults;
|
372 |
|
373 |
$db_version = get_option( 'db_version' );
|
398 |
<p><?php _e( 'You must first save this Product as a Draft before adding variations', 'wpsc' ); ?></p>
|
399 |
<?php else : ?>
|
400 |
<div id="product_variations">
|
401 |
+
<div class="variation_checkboxes">
|
402 |
+
<?php
|
403 |
+
|
404 |
+
wp_terms_checklist( $post->ID, array(
|
405 |
+
'taxonomy' => 'wpsc-variation',
|
406 |
+
'selected_cats' => $product_terms,
|
407 |
+
'walker' => new WPSC_Walker_Variation_Checklist,
|
408 |
+
'checked_ontop' => false
|
409 |
+
) );
|
410 |
+
|
411 |
+
?>
|
412 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
<a class="preview button update_variations_action" href='#'><?php _e( 'Update Variations →', 'wpsc' ); ?></a>
|
414 |
|
415 |
</div>
|
977 |
|
978 |
// regenerate size metadata in case it's missing
|
979 |
if ( ! image_get_intermediate_size( $post->ID, $check ) ) {
|
980 |
+
if ( ! $metadata = wp_get_attachment_metadata( $post->ID ) )
|
981 |
+
$metadata = array();
|
982 |
$file = get_attached_file( $post->ID );
|
983 |
$generated = wp_generate_attachment_metadata( $thumbnail_id, $file );
|
984 |
$metadata['sizes'] = array_merge( $generated['sizes'], $metadata['sizes'] );
|
wpsc-admin/includes/product-functions.php
CHANGED
@@ -260,9 +260,12 @@ function wpsc_admin_submit_notices() {
|
|
260 |
* @param $product_id (int) the Post ID
|
261 |
* @return null
|
262 |
*/
|
263 |
-
function wpsc_add_product_category_default($product_id){
|
264 |
$terms = get_terms( 'wpsc_product_category', array( 'orderby' => 'id', 'hide_empty' => 0 ) );
|
265 |
-
|
|
|
|
|
|
|
266 |
}
|
267 |
/**
|
268 |
* wpsc_sanitise_product_forms function
|
@@ -564,6 +567,48 @@ function term_id_price($term_id, $parent_price) {
|
|
564 |
return $price;
|
565 |
}
|
566 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
567 |
/**
|
568 |
* wpsc_edit_product_variations function.
|
569 |
* this is the function to make child products using variations
|
@@ -676,19 +721,8 @@ function wpsc_edit_product_variations($product_id, $post_data) {
|
|
676 |
|
677 |
endforeach;
|
678 |
|
679 |
-
|
680 |
-
|
681 |
-
$price = array();
|
682 |
-
foreach ($term_ids as $term_id_price) {
|
683 |
-
$price[] = term_id_price($term_id_price, $child_product_meta["_wpsc_price"][0]);
|
684 |
-
}
|
685 |
-
rsort($price);
|
686 |
-
$price = $price[0];
|
687 |
-
|
688 |
-
if($price > 0) {
|
689 |
-
update_post_meta($child_product_id, "_wpsc_price", $price);
|
690 |
-
}
|
691 |
-
}
|
692 |
}
|
693 |
}
|
694 |
|
@@ -1121,5 +1155,4 @@ function wpsc_variations_stock_remaining($product_id){
|
|
1121 |
`pm`.`meta_key` = "_wpsc_stock"
|
1122 |
');
|
1123 |
}
|
1124 |
-
|
1125 |
?>
|
260 |
* @param $product_id (int) the Post ID
|
261 |
* @return null
|
262 |
*/
|
263 |
+
function wpsc_add_product_category_default( $product_id ){
|
264 |
$terms = get_terms( 'wpsc_product_category', array( 'orderby' => 'id', 'hide_empty' => 0 ) );
|
265 |
+
if ( ! empty( $terms ) ) {
|
266 |
+
$default = array_shift( $terms );
|
267 |
+
wp_set_object_terms( $product_id , array( $default->slug ) , 'wpsc_product_category' );
|
268 |
+
}
|
269 |
}
|
270 |
/**
|
271 |
* wpsc_sanitise_product_forms function
|
567 |
return $price;
|
568 |
}
|
569 |
|
570 |
+
/**
|
571 |
+
* Determine the price of a variation product based on the variation it's assigned
|
572 |
+
* to. Because each variation term can have its own price (eg. 10, +10, -5%), this
|
573 |
+
* function also takes those into account.
|
574 |
+
*
|
575 |
+
* @since 3.8.6
|
576 |
+
* @param int $variation_id ID of the variation product
|
577 |
+
* @param string $terms Optional. Defaults to false. Variation terms assigned to
|
578 |
+
* the variation product. Pass this argument to save one SQL query.
|
579 |
+
* @return float Calculated price of the variation
|
580 |
+
*/
|
581 |
+
function wpsc_determine_variation_price( $variation_id, $term_ids = false ) {
|
582 |
+
$flat = array();
|
583 |
+
$diff = 0;
|
584 |
+
|
585 |
+
$variation = get_post( $variation_id );
|
586 |
+
$price = (float) get_product_meta( $variation->post_parent, 'price', true );
|
587 |
+
|
588 |
+
if ( ! $term_ids )
|
589 |
+
$term_ids = wp_get_object_terms( $variation_id, 'wpsc-variation', array( 'fields' => 'ids' ) );
|
590 |
+
|
591 |
+
$term_price_arr = get_option( 'term_prices' );
|
592 |
+
foreach ( $term_ids as $term_id ) {
|
593 |
+
if ( isset( $term_price_arr[$term_id] ) )
|
594 |
+
$term_price = trim( $term_price_arr[$term_id]['price'] );
|
595 |
+
else
|
596 |
+
continue;
|
597 |
+
if ( flat_price( $term_price ) ) {
|
598 |
+
$flat[] = $term_price;
|
599 |
+
} elseif ( differential_price( $term_price ) ) {
|
600 |
+
$diff += (float) $term_price;
|
601 |
+
} elseif ( percentile_price( $term_price ) ) {
|
602 |
+
$diff += (float) $term_price / 100 * $price;
|
603 |
+
}
|
604 |
+
}
|
605 |
+
// Variation price should at least be the maximum of all flat prices
|
606 |
+
if ( ! empty( $flat ) )
|
607 |
+
$price = max( $flat );
|
608 |
+
$price += $diff;
|
609 |
+
return $price;
|
610 |
+
}
|
611 |
+
|
612 |
/**
|
613 |
* wpsc_edit_product_variations function.
|
614 |
* this is the function to make child products using variations
|
721 |
|
722 |
endforeach;
|
723 |
|
724 |
+
if ( is_array( $term_ids ) && $price = wpsc_determine_variation_price( $child_product_id, $term_ids ) )
|
725 |
+
update_product_meta( $child_product_id, 'price', $price );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
726 |
}
|
727 |
}
|
728 |
|
1155 |
`pm`.`meta_key` = "_wpsc_stock"
|
1156 |
');
|
1157 |
}
|
|
|
1158 |
?>
|
wpsc-admin/includes/products.php
CHANGED
@@ -75,14 +75,16 @@ function wpsc_product_row(&$product, $parent_product = null) {
|
|
75 |
<tr id='post-<?php echo $product->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $product->post_status ); ?> iedit <?php if ( get_option ( 'wpsc_sort_by' ) == 'dragndrop') { echo 'product-edit'; } ?>' valign="top">
|
76 |
<?php
|
77 |
$posts_columns = get_column_headers( 'wpsc-product_variants' );
|
|
|
78 |
|
79 |
if(empty($posts_columns))
|
80 |
$posts_columns = array('image' => '', 'title' => __('Name', 'wpsc') , 'weight' => __('Weight', 'wpsc'), 'stock' => __('Stock', 'wpsc'), 'price' => __('Price', 'wpsc'), 'sale_price' => __('Sale Price', 'wpsc'), 'SKU' => __('SKU', 'wpsc'), 'hidden_alerts' => '');
|
81 |
|
82 |
foreach ( $posts_columns as $column_name=>$column_display_name ) {
|
83 |
-
$
|
84 |
-
|
85 |
-
$
|
|
|
86 |
|
87 |
switch ($column_name) {
|
88 |
|
@@ -161,7 +163,7 @@ function wpsc_product_row(&$product, $parent_product = null) {
|
|
161 |
</strong>
|
162 |
<?php
|
163 |
$has_var = '';
|
164 |
-
if(wpsc_product_has_children($product->ID))
|
165 |
$has_var = 'wpsc_has_variation';
|
166 |
$actions = array();
|
167 |
if ( $current_user_can_edit_this_product && 'trash' != $product->post_status ) {
|
@@ -169,14 +171,6 @@ function wpsc_product_row(&$product, $parent_product = null) {
|
|
169 |
$actions['quick_edit'] = "<a class='wpsc_editinline ".$has_var."' title='".esc_attr(__('Quick Edit', 'wpsc'))."' href='#'>".__('Quick Edit', 'wpsc')."</a>";
|
170 |
}
|
171 |
|
172 |
-
if ( in_array($product->post_status, array('pending', 'draft')) ) {
|
173 |
-
if ( $current_user_can_edit_this_product ) {
|
174 |
-
$actions['view'] = '<a href="'.get_permalink($product->ID).'" title="'.esc_attr(sprintf(__('Preview “%s”', 'wpsc'), $title)) . '" rel="permalink">'.__('Preview', 'wpsc').'</a>';
|
175 |
-
}
|
176 |
-
} else if ( 'trash' != $product->post_status ) {
|
177 |
-
$actions['view'] = '<a href="'.get_permalink($product->ID).'" title="'.esc_attr(sprintf(__('View “%s”', 'wpsc'), $title)).'" rel="permalink">'.__('View', 'wpsc').'</a>';
|
178 |
-
}
|
179 |
-
|
180 |
$actions = apply_filters('post_row_actions', $actions, $product);
|
181 |
$action_count = count($actions);
|
182 |
$i = 0;
|
@@ -189,7 +183,6 @@ function wpsc_product_row(&$product, $parent_product = null) {
|
|
189 |
}
|
190 |
|
191 |
echo '</div>';
|
192 |
-
get_inline_data($product);
|
193 |
?>
|
194 |
</td>
|
195 |
<?php
|
@@ -201,31 +194,21 @@ function wpsc_product_row(&$product, $parent_product = null) {
|
|
201 |
?>
|
202 |
<td class="product-image ">
|
203 |
<?php
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
|
|
212 |
|
213 |
|
214 |
|
215 |
if(isset($product->ID) && has_post_thumbnail($product->ID)){
|
216 |
echo get_the_post_thumbnail($product->ID, 'admin-product-thumbnails');
|
217 |
-
}
|
218 |
-
$attached_image = $attached_images[0];
|
219 |
-
|
220 |
-
$src =wp_get_attachment_url($attached_image->ID);
|
221 |
-
?>
|
222 |
-
<div style='width:38px;height:38px;overflow:hidden;'>
|
223 |
-
<img title='Drag to a new position' src='<?php echo $src; ?>' alt='<?php echo $title; ?>' width='38' height='38' />
|
224 |
-
</div>
|
225 |
-
<?php
|
226 |
-
|
227 |
-
|
228 |
-
}else{
|
229 |
$image_url = WPSC_CORE_IMAGES_URL . "/no-image-uploaded.gif";
|
230 |
?>
|
231 |
<img title='Drag to a new position' src='<?php echo $image_url; ?>' alt='<?php echo $title; ?>' width='38' height='38' />
|
75 |
<tr id='post-<?php echo $product->ID; ?>' class='<?php echo trim( $rowclass . ' author-' . $post_owner . ' status-' . $product->post_status ); ?> iedit <?php if ( get_option ( 'wpsc_sort_by' ) == 'dragndrop') { echo 'product-edit'; } ?>' valign="top">
|
76 |
<?php
|
77 |
$posts_columns = get_column_headers( 'wpsc-product_variants' );
|
78 |
+
$hidden_columns = get_hidden_columns( 'wpsc-product_variants' );
|
79 |
|
80 |
if(empty($posts_columns))
|
81 |
$posts_columns = array('image' => '', 'title' => __('Name', 'wpsc') , 'weight' => __('Weight', 'wpsc'), 'stock' => __('Stock', 'wpsc'), 'price' => __('Price', 'wpsc'), 'sale_price' => __('Sale Price', 'wpsc'), 'SKU' => __('SKU', 'wpsc'), 'hidden_alerts' => '');
|
82 |
|
83 |
foreach ( $posts_columns as $column_name=>$column_display_name ) {
|
84 |
+
$attributes = "class=\"$column_name column-$column_name\"";
|
85 |
+
|
86 |
+
if ( in_array( $column_name, $hidden_columns ) )
|
87 |
+
$attributes .= ' style="display:none;"';
|
88 |
|
89 |
switch ($column_name) {
|
90 |
|
163 |
</strong>
|
164 |
<?php
|
165 |
$has_var = '';
|
166 |
+
if(! $parent_product && wpsc_product_has_children($product->ID))
|
167 |
$has_var = 'wpsc_has_variation';
|
168 |
$actions = array();
|
169 |
if ( $current_user_can_edit_this_product && 'trash' != $product->post_status ) {
|
171 |
$actions['quick_edit'] = "<a class='wpsc_editinline ".$has_var."' title='".esc_attr(__('Quick Edit', 'wpsc'))."' href='#'>".__('Quick Edit', 'wpsc')."</a>";
|
172 |
}
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
$actions = apply_filters('post_row_actions', $actions, $product);
|
175 |
$action_count = count($actions);
|
176 |
$i = 0;
|
183 |
}
|
184 |
|
185 |
echo '</div>';
|
|
|
186 |
?>
|
187 |
</td>
|
188 |
<?php
|
194 |
?>
|
195 |
<td class="product-image ">
|
196 |
<?php
|
197 |
+
$attachment_args = array(
|
198 |
+
'post_type' => 'attachment',
|
199 |
+
'numberposts' => 1,
|
200 |
+
'post_status' => null,
|
201 |
+
'post_parent' => $product->ID,
|
202 |
+
'orderby' => 'menu_order',
|
203 |
+
'order' => 'ASC'
|
204 |
+
);
|
205 |
+
|
206 |
|
207 |
|
208 |
|
209 |
if(isset($product->ID) && has_post_thumbnail($product->ID)){
|
210 |
echo get_the_post_thumbnail($product->ID, 'admin-product-thumbnails');
|
211 |
+
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
$image_url = WPSC_CORE_IMAGES_URL . "/no-image-uploaded.gif";
|
213 |
?>
|
214 |
<img title='Drag to a new position' src='<?php echo $image_url; ?>' alt='<?php echo $title; ?>' width='38' height='38' />
|
wpsc-admin/includes/save-data.functions.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
/**
|
4 |
* This file used for adding fields to the products category taxonomy page and saving those values correctly :)
|
5 |
*
|
@@ -18,16 +17,20 @@
|
|
18 |
*/
|
19 |
|
20 |
function wpsc_ajax_set_category_order(){
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
|
33 |
/**
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* This file used for adding fields to the products category taxonomy page and saving those values correctly :)
|
4 |
*
|
17 |
*/
|
18 |
|
19 |
function wpsc_ajax_set_category_order(){
|
20 |
+
global $wpdb;
|
21 |
+
$sort_order = $_POST['sort_order'];
|
22 |
+
$parent_id = $_POST['parent_id'];
|
23 |
|
24 |
+
$result = true;
|
25 |
+
foreach( $sort_order as $key=>$value ){
|
26 |
+
if ( empty( $value ) )
|
27 |
+
continue;
|
28 |
+
|
29 |
+
$value = preg_replace( '/[^0-9]/', '', $value );
|
30 |
+
|
31 |
+
if( !wpsc_update_meta( $value, 'sort_order', $key, 'wpsc_category' ) )
|
32 |
+
$result = false;
|
33 |
+
}
|
34 |
}
|
35 |
|
36 |
/**
|
wpsc-admin/includes/settings-pages/checkout.php
CHANGED
@@ -24,7 +24,6 @@ function wpsc_options_checkout(){
|
|
24 |
/* wpsc_setting_page_update_notification displays the wordpress styled notifications */
|
25 |
wpsc_settings_page_update_notification(); ?>
|
26 |
|
27 |
-
<form method='post' action='' id='chekcout_options_tbl' class='wpsc_form_track'>
|
28 |
<div class='metabox-holder' style='width:95%;'>
|
29 |
<div class='postbox'>
|
30 |
<input type='hidden' name='checkout_submits' value='true' />
|
@@ -225,7 +224,6 @@ function wpsc_options_checkout(){
|
|
225 |
<input class='button-primary' type='submit' name='submit' value='<?php _e('Save Changes', 'wpsc');?>' />
|
226 |
<a href='#' onclick='return add_form_field();'><?php _e('Add New Form Field', 'wpsc');?></a></p>
|
227 |
<div id="checkout_message">Note: Any new form fields will appear in your sales logs and on your checkout page but this data will not be sent to the payment gateway.</div>
|
228 |
-
</form>
|
229 |
</div>
|
230 |
</form>
|
231 |
<?php
|
24 |
/* wpsc_setting_page_update_notification displays the wordpress styled notifications */
|
25 |
wpsc_settings_page_update_notification(); ?>
|
26 |
|
|
|
27 |
<div class='metabox-holder' style='width:95%;'>
|
28 |
<div class='postbox'>
|
29 |
<input type='hidden' name='checkout_submits' value='true' />
|
224 |
<input class='button-primary' type='submit' name='submit' value='<?php _e('Save Changes', 'wpsc');?>' />
|
225 |
<a href='#' onclick='return add_form_field();'><?php _e('Add New Form Field', 'wpsc');?></a></p>
|
226 |
<div id="checkout_message">Note: Any new form fields will appear in your sales logs and on your checkout page but this data will not be sent to the payment gateway.</div>
|
|
|
227 |
</div>
|
228 |
</form>
|
229 |
<?php
|
wpsc-admin/includes/walker-variation-checklist.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Walker Variation Checklist
|
4 |
+
* Outputs checkboxes for variation sets
|
5 |
+
*/
|
6 |
+
class WPSC_Walker_Variation_Checklist extends Walker_Category_Checklist {
|
7 |
+
private $is_displayed = true;
|
8 |
+
|
9 |
+
// Don't need to output anything - if this was a nest list it would be a <ul>
|
10 |
+
// It's here purely to override the default output with nothing.
|
11 |
+
function start_lvl( &$output, $depth, $args ) {
|
12 |
+
}
|
13 |
+
|
14 |
+
// Same as above for the closing tag.
|
15 |
+
function end_lvl( &$output, $depth, $args ) {
|
16 |
+
}
|
17 |
+
|
18 |
+
// Start variation set or variation
|
19 |
+
function start_el( &$output, $category, $depth, $args ) {
|
20 |
+
extract( $args );
|
21 |
+
if ( empty( $taxonomy ) )
|
22 |
+
$taxonomy = 'wpsc-variation';
|
23 |
+
if ( $depth == 0 ) {
|
24 |
+
// Start variation set
|
25 |
+
$this->is_displayed = in_array( $category->term_id, $selected_cats );
|
26 |
+
$output .= '<div class="variation_set">';
|
27 |
+
$output .= '<label class="set_label">
|
28 |
+
<input type="checkbox"' . checked( $this->is_displayed, true, false ) .'name="variations[' . $category->term_id . ']" value="1">
|
29 |
+
' . esc_html( apply_filters( 'the_category', $category->name ) ) . '
|
30 |
+
</label>';
|
31 |
+
} else {
|
32 |
+
// Start variation
|
33 |
+
$output .= '<div class="variation"' . ( $this->is_displayed ? '' : ' style="display:none;"' ) . '>
|
34 |
+
<label>
|
35 |
+
<input type="checkbox"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . 'name="edit_var_val[' . $category->parent . '][' . $category->term_id . ']" value="1">
|
36 |
+
' . esc_html( apply_filters( 'the_category', $category->name ) ) . '
|
37 |
+
</label>';
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
// End variation set or variation
|
42 |
+
function end_el( &$output, $category, $depth, $args ) {
|
43 |
+
$output .= '</div>';
|
44 |
+
if ( $depth == 0 )
|
45 |
+
$this->is_displayed = true;
|
46 |
+
}
|
47 |
+
}
|
wpsc-admin/js/admin-legacy.js
CHANGED
@@ -542,13 +542,13 @@ jQuery(window).load( function () {
|
|
542 |
});
|
543 |
var toggleContent = function(e)
|
544 |
{
|
545 |
-
var targetContent =
|
546 |
if (targetContent.css('display') == 'none') {
|
547 |
targetContent.slideDown(300);
|
548 |
-
|
549 |
} else {
|
550 |
targetContent.slideUp(300);
|
551 |
-
|
552 |
}
|
553 |
return false;
|
554 |
};
|
542 |
});
|
543 |
var toggleContent = function(e)
|
544 |
{
|
545 |
+
var targetContent = jQuery('div.itemContent', this.parentNode.parentNode);
|
546 |
if (targetContent.css('display') == 'none') {
|
547 |
targetContent.slideDown(300);
|
548 |
+
jQuery(this).html('[-]');
|
549 |
} else {
|
550 |
targetContent.slideUp(300);
|
551 |
+
jQuery(this).html('[+]');
|
552 |
}
|
553 |
return false;
|
554 |
};
|
wpsc-admin/js/admin.js
CHANGED
@@ -10,12 +10,12 @@ jQuery(document).ready(function(){
|
|
10 |
|
11 |
jQuery('a.update_variations_action').click(function(){
|
12 |
jQuery("<img class='loading' src='images/loading.gif' height='15' width='15' />").insertAfter(this);
|
13 |
-
edit_var_val = jQuery('div.variation_checkboxes input:checked').serialize();
|
14 |
-
description = jQuery('#content_ifr').contents().find('body').html();
|
15 |
-
additional_description = jQuery('textarea#additional_description').text();
|
16 |
-
name = jQuery('input#title').val();
|
17 |
-
product_id = jQuery('input#product_id').val();
|
18 |
-
post_values = edit_var_val + '&description=' + description + '&additional_description=' + additional_description + '&name=' + name + '&product_id=' + product_id;
|
19 |
jQuery('div#wpsc_product_variation_forms table.widefat tbody').fadeTo(200, 0, function(){
|
20 |
jQuery.post(ajaxurl + '?action=wpsc_update_variations',post_values, function(returned_data){
|
21 |
jQuery('div#wpsc_product_variation_forms table.widefat tbody').html(returned_data).fadeTo(200, 1);
|
@@ -291,11 +291,15 @@ jQuery(document).ready(function(){
|
|
291 |
}
|
292 |
//Added for inline editing capabilities
|
293 |
jQuery('#wpsc_product_list a.wpsc_editinline').live('click', function() {
|
294 |
-
jQuery(this)
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
|
|
|
|
|
|
|
|
299 |
return false;
|
300 |
});
|
301 |
|
@@ -590,17 +594,15 @@ jQuery(document).ready(function(){
|
|
590 |
|
591 |
|
592 |
// show or hide the stock input forms
|
593 |
-
jQuery(
|
594 |
-
jQuery(this).
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
}
|
603 |
-
});
|
604 |
});
|
605 |
|
606 |
|
10 |
|
11 |
jQuery('a.update_variations_action').click(function(){
|
12 |
jQuery("<img class='loading' src='images/loading.gif' height='15' width='15' />").insertAfter(this);
|
13 |
+
var edit_var_val = jQuery('div.variation_checkboxes input:checked').serialize();
|
14 |
+
var description = jQuery('#content_ifr').contents().find('body').html();
|
15 |
+
var additional_description = jQuery('textarea#additional_description').text();
|
16 |
+
var name = jQuery('input#title').val();
|
17 |
+
var product_id = jQuery('input#product_id').val();
|
18 |
+
var post_values = edit_var_val + '&description=' + description + '&additional_description=' + additional_description + '&name=' + name + '&product_id=' + product_id;
|
19 |
jQuery('div#wpsc_product_variation_forms table.widefat tbody').fadeTo(200, 0, function(){
|
20 |
jQuery.post(ajaxurl + '?action=wpsc_update_variations',post_values, function(returned_data){
|
21 |
jQuery('div#wpsc_product_variation_forms table.widefat tbody').html(returned_data).fadeTo(200, 1);
|
291 |
}
|
292 |
//Added for inline editing capabilities
|
293 |
jQuery('#wpsc_product_list a.wpsc_editinline').live('click', function() {
|
294 |
+
var t = jQuery(this),
|
295 |
+
tr = t.parents('tr');
|
296 |
+
tr.find('td input[type="text"].wpsc_ie_field').each(function(){
|
297 |
+
var ti = jQuery(this), p = ti.parents('td');
|
298 |
+
if (! p.hasClass('column-stock') || p.css('display') != 'none') {
|
299 |
+
ti.innerWidth(p.width());
|
300 |
+
}
|
301 |
+
}).show();
|
302 |
+
tr.find('td .wpsc_inline_actions').show().end().find('a.row-title, td > span').hide();
|
303 |
return false;
|
304 |
});
|
305 |
|
594 |
|
595 |
|
596 |
// show or hide the stock input forms
|
597 |
+
jQuery('input.limited_stock_checkbox').live('click', function () {
|
598 |
+
parent_form = jQuery(this).parents('form');
|
599 |
+
if(jQuery(this).is(':checked')) {
|
600 |
+
jQuery("div.edit_stock",parent_form).show();
|
601 |
+
jQuery("th.column-stock, td.stock", parent_form).show();
|
602 |
+
} else {
|
603 |
+
jQuery("div.edit_stock", parent_form).hide();
|
604 |
+
jQuery("th.column-stock, td.stock", parent_form).hide();
|
605 |
+
}
|
|
|
|
|
606 |
});
|
607 |
|
608 |
|
wpsc-admin/js/variations.js
CHANGED
@@ -56,19 +56,6 @@ jQuery('.variation_checkboxes').livequery(function(){
|
|
56 |
}
|
57 |
});
|
58 |
|
59 |
-
|
60 |
-
jQuery("div.variation_set>label input:checkbox", this).livequery(function(event){
|
61 |
-
});
|
62 |
-
|
63 |
-
jQuery("div.variation input:checkbox", this).livequery(function(event){
|
64 |
-
var variation_set = jQuery(this).parents("div.variation_set");
|
65 |
-
var checked_count = jQuery('div.variation input:checked', variation_set).length;
|
66 |
-
if(checked_count < 1) {
|
67 |
-
jQuery('div.variation', variation_set).hide();
|
68 |
-
jQuery('label.set_label input:checkbox', variation_set).attr('checked', false);
|
69 |
-
}
|
70 |
-
});
|
71 |
-
|
72 |
});
|
73 |
|
74 |
|
56 |
}
|
57 |
});
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
});
|
60 |
|
61 |
|
wpsc-admin/js/wpsc-swfupload-handlers.js
CHANGED
@@ -62,7 +62,7 @@ function wpsc_prepareMediaItem(fileObj, serverData) {
|
|
62 |
function wpsc_prepareMediaItemInit(fileObj) {
|
63 |
|
64 |
// Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename
|
65 |
-
jQuery('#media-item-' + fileObj.id + ' .thumbnail').clone().attr('
|
66 |
|
67 |
// Replace the original filename with the new (unique) one assigned during upload
|
68 |
jQuery('#media-item-' + fileObj.id + ' .filename.original').replaceWith(jQuery('#media-item-' + fileObj.id + ' .filename.new'));
|
62 |
function wpsc_prepareMediaItemInit(fileObj) {
|
63 |
|
64 |
// Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename
|
65 |
+
jQuery('#media-item-' + fileObj.id + ' .thumbnail').clone().attr('class', 'pinkynail toggle').prependTo('#media-item-' + fileObj.id);
|
66 |
|
67 |
// Replace the original filename with the new (unique) one assigned during upload
|
68 |
jQuery('#media-item-' + fileObj.id + ' .filename.original').replaceWith(jQuery('#media-item-' + fileObj.id + ' .filename.new'));
|
wpsc-core/js/jquery.rating.js
CHANGED
@@ -23,9 +23,8 @@ jQuery.fn.rating = function(){
|
|
23 |
return this.each(function(){
|
24 |
var div = jQuery("<div/>").attr({
|
25 |
title: this.title,
|
26 |
-
|
27 |
}).insertAfter( this );
|
28 |
-
|
29 |
product_id = jQuery("input.wpsc_rating_product_id", this).val();
|
30 |
|
31 |
var selected_rating = jQuery("select option:selected", this).val();
|
23 |
return this.each(function(){
|
24 |
var div = jQuery("<div/>").attr({
|
25 |
title: this.title,
|
26 |
+
'class': this.className
|
27 |
}).insertAfter( this );
|
|
|
28 |
product_id = jQuery("input.wpsc_rating_product_id", this).val();
|
29 |
|
30 |
var selected_rating = jQuery("select option:selected", this).val();
|
wpsc-core/js/user.js
CHANGED
@@ -225,11 +225,11 @@ function submit_register_form(frm)
|
|
225 |
}
|
226 |
|
227 |
var fadeInSuggestion = function(suggestionBox, suggestionIframe) {
|
228 |
-
|
229 |
};
|
230 |
|
231 |
var fadeOutSuggestion = function(suggestionBox, suggestionIframe) {
|
232 |
-
|
233 |
};
|
234 |
|
235 |
function change_pics(command){
|
225 |
}
|
226 |
|
227 |
var fadeInSuggestion = function(suggestionBox, suggestionIframe) {
|
228 |
+
jQuery(suggestionBox).fadeTo(300,1);
|
229 |
};
|
230 |
|
231 |
var fadeOutSuggestion = function(suggestionBox, suggestionIframe) {
|
232 |
+
jQuery(suggestionBox).fadeTo(300,0);
|
233 |
};
|
234 |
|
235 |
function change_pics(command){
|
wpsc-core/js/wp-e-commerce.js
CHANGED
@@ -234,7 +234,7 @@ jQuery(document).ready(function () {
|
|
234 |
});
|
235 |
|
236 |
// Submit the product form using AJAX
|
237 |
-
jQuery("form.product_form").live('submit', function() {
|
238 |
// we cannot submit a file through AJAX, so this needs to return true to submit the form normally if a file formfield is present
|
239 |
file_upload_elements = jQuery.makeArray(jQuery('input[type="file"]', jQuery(this)));
|
240 |
if(file_upload_elements.length > 0) {
|
@@ -290,8 +290,9 @@ jQuery(document).ready(function () {
|
|
290 |
jQuery(".wpsc_select_variation").live('change', function() {
|
291 |
jQuery('option[value="0"]', this).attr('disabled', 'disabled');
|
292 |
parent_form = jQuery(this).parents("form.product_form");
|
|
|
|
|
293 |
form_values =jQuery("input[name='product_id'], .wpsc_select_variation",parent_form).serialize( );
|
294 |
-
|
295 |
jQuery.post( 'index.php?update_product_price=true', form_values, function(returned_data) {
|
296 |
variation_msg = '';
|
297 |
eval(returned_data);
|
@@ -326,7 +327,6 @@ jQuery(document).ready(function () {
|
|
326 |
}
|
327 |
}
|
328 |
});
|
329 |
-
return false;
|
330 |
});
|
331 |
|
332 |
// Object frame destroying code.
|
@@ -505,23 +505,27 @@ jQuery(document).ready(function(){
|
|
505 |
|
506 |
//Javascript for variations: bounce the variation box when nothing is selected and return false for add to cart button.
|
507 |
jQuery(document).ready(function(){
|
508 |
-
jQuery('.productcol, .textcol, .product_grid_item').each(function(){
|
509 |
jQuery('.wpsc_buy_button', this).click(function(){
|
510 |
-
jQuery(this).
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
|
|
|
|
|
|
|
|
518 |
});
|
519 |
});
|
520 |
});
|
521 |
});
|
522 |
}
|
523 |
});
|
524 |
-
if(
|
525 |
return false;
|
526 |
});
|
527 |
});
|
234 |
});
|
235 |
|
236 |
// Submit the product form using AJAX
|
237 |
+
jQuery("form.product_form, .wpsc-add-to-cart-button-form").live('submit', function() {
|
238 |
// we cannot submit a file through AJAX, so this needs to return true to submit the form normally if a file formfield is present
|
239 |
file_upload_elements = jQuery.makeArray(jQuery('input[type="file"]', jQuery(this)));
|
240 |
if(file_upload_elements.length > 0) {
|
290 |
jQuery(".wpsc_select_variation").live('change', function() {
|
291 |
jQuery('option[value="0"]', this).attr('disabled', 'disabled');
|
292 |
parent_form = jQuery(this).parents("form.product_form");
|
293 |
+
if ( parent_form.length == 0 )
|
294 |
+
return;
|
295 |
form_values =jQuery("input[name='product_id'], .wpsc_select_variation",parent_form).serialize( );
|
|
|
296 |
jQuery.post( 'index.php?update_product_price=true', form_values, function(returned_data) {
|
297 |
variation_msg = '';
|
298 |
eval(returned_data);
|
327 |
}
|
328 |
}
|
329 |
});
|
|
|
330 |
});
|
331 |
|
332 |
// Object frame destroying code.
|
505 |
|
506 |
//Javascript for variations: bounce the variation box when nothing is selected and return false for add to cart button.
|
507 |
jQuery(document).ready(function(){
|
508 |
+
jQuery('.productcol, .textcol, .product_grid_item, .wpsc-add-to-cart-button').each(function(){
|
509 |
jQuery('.wpsc_buy_button', this).click(function(){
|
510 |
+
var dropdowns = jQuery(this).closest('form').find('.wpsc_select_variation');
|
511 |
+
var not_selected = false;
|
512 |
+
dropdowns.each(function(){
|
513 |
+
var t = jQuery(this);
|
514 |
+
if(t.val() <= 0){
|
515 |
+
not_selected = true;
|
516 |
+
t.css('position','relative');
|
517 |
+
t.animate({'left': '-=5px'}, 50, function(){
|
518 |
+
t.animate({'left': '+=10px'}, 100, function(){
|
519 |
+
t.animate({'left': '-=10px'}, 100, function(){
|
520 |
+
t.animate({'left': '+=10px'}, 100, function(){
|
521 |
+
t.animate({'left': '-=5px'}, 50);
|
522 |
});
|
523 |
});
|
524 |
});
|
525 |
});
|
526 |
}
|
527 |
});
|
528 |
+
if (not_selected)
|
529 |
return false;
|
530 |
});
|
531 |
});
|
wpsc-core/wpsc-constants.php
CHANGED
@@ -26,9 +26,9 @@ function wpsc_core_constants() {
|
|
26 |
if(!defined('WPSC_URL'))
|
27 |
define( 'WPSC_URL', plugins_url( '', __FILE__ ) );
|
28 |
// Define Plugin version
|
29 |
-
define( 'WPSC_VERSION', '3.8.
|
30 |
-
define( 'WPSC_MINOR_VERSION', '
|
31 |
-
define( 'WPSC_PRESENTABLE_VERSION', '3.8.
|
32 |
|
33 |
// Define Debug Variables for developers
|
34 |
define( 'WPSC_DEBUG', false );
|
@@ -160,7 +160,8 @@ function wpsc_core_constants_table_names() {
|
|
160 |
* Set the Upload related constants
|
161 |
*/
|
162 |
function wpsc_core_constants_uploads() {
|
163 |
-
|
|
|
164 |
$wp_upload_dir_data = wp_upload_dir();
|
165 |
|
166 |
// Error Message
|
26 |
if(!defined('WPSC_URL'))
|
27 |
define( 'WPSC_URL', plugins_url( '', __FILE__ ) );
|
28 |
// Define Plugin version
|
29 |
+
define( 'WPSC_VERSION', '3.8.6' );
|
30 |
+
define( 'WPSC_MINOR_VERSION', '419073' );
|
31 |
+
define( 'WPSC_PRESENTABLE_VERSION', '3.8.6' );
|
32 |
|
33 |
// Define Debug Variables for developers
|
34 |
define( 'WPSC_DEBUG', false );
|
160 |
* Set the Upload related constants
|
161 |
*/
|
162 |
function wpsc_core_constants_uploads() {
|
163 |
+
$upload_path = '';
|
164 |
+
$upload_url = '';
|
165 |
$wp_upload_dir_data = wp_upload_dir();
|
166 |
|
167 |
// Error Message
|
wpsc-core/wpsc-functions.php
CHANGED
@@ -1025,7 +1025,7 @@ function wpsc_product_link( $permalink, $post, $leavename ) {
|
|
1025 |
if ( (isset( $wp_query->query_vars['products'] ) && $wp_query->query_vars['products'] != null) && in_array( $wp_query->query_vars['products'], $product_category_slugs ) ) {
|
1026 |
$product_category = $wp_query->query_vars['products'];
|
1027 |
} else {
|
1028 |
-
if( $current_cat = get_query_var( 'wpsc_product_category' ) && in_array( $current_cat, $product_category_slugs ) )
|
1029 |
$link = $current_cat;
|
1030 |
else
|
1031 |
$link = $product_categories[0]->slug;
|
@@ -1069,7 +1069,7 @@ function wpsc_product_link( $permalink, $post, $leavename ) {
|
|
1069 |
$permalink = user_trailingslashit( $permalink, 'single' );
|
1070 |
$permalink = home_url( $permalink );
|
1071 |
}
|
1072 |
-
return $permalink;
|
1073 |
}
|
1074 |
add_filter( 'post_type_link', 'wpsc_product_link', 10, 3 );
|
1075 |
|
1025 |
if ( (isset( $wp_query->query_vars['products'] ) && $wp_query->query_vars['products'] != null) && in_array( $wp_query->query_vars['products'], $product_category_slugs ) ) {
|
1026 |
$product_category = $wp_query->query_vars['products'];
|
1027 |
} else {
|
1028 |
+
if ( ( $current_cat = get_query_var( 'wpsc_product_category' ) ) && in_array( $current_cat, $product_category_slugs ) )
|
1029 |
$link = $current_cat;
|
1030 |
else
|
1031 |
$link = $product_categories[0]->slug;
|
1069 |
$permalink = user_trailingslashit( $permalink, 'single' );
|
1070 |
$permalink = home_url( $permalink );
|
1071 |
}
|
1072 |
+
return apply_filters( 'wpsc_product_permalink', $permalink, $post->ID );
|
1073 |
}
|
1074 |
add_filter( 'post_type_link', 'wpsc_product_link', 10, 3 );
|
1075 |
|
wpsc-includes/ajax.functions.php
CHANGED
@@ -436,7 +436,7 @@ function wpsc_update_product_price() {
|
|
436 |
}
|
437 |
|
438 |
// execute on POST and GET
|
439 |
-
if ( isset( $_REQUEST['update_product_price'] ) && ($_REQUEST['update_product_price'] == 'true') && is_numeric( $_POST['product_id'] ) ) {
|
440 |
add_action( 'init', 'wpsc_update_product_price' );
|
441 |
}
|
442 |
|
@@ -656,6 +656,7 @@ function wpsc_submit_checkout() {
|
|
656 |
), array( 'id' => $purchase_log_id ) );
|
657 |
$_SESSION['gateway'] = 'google';
|
658 |
wp_redirect(get_option( 'shopping_cart_url' ));
|
|
|
659 |
}
|
660 |
}
|
661 |
}
|
@@ -806,11 +807,11 @@ function wpsc_change_tax() {
|
|
806 |
$form_selected_region = null;
|
807 |
$onchange_function = null;
|
808 |
|
809 |
-
if ( ($_POST['billing_country'] != 'undefined'
|
810 |
$form_selected_country = $wpsc_selected_country;
|
811 |
$form_selected_region = $wpsc_selected_region;
|
812 |
$onchange_function = 'set_billing_country';
|
813 |
-
} else if ( ($_POST['shipping_country'] != 'undefined'
|
814 |
$form_selected_country = $wpsc_delivery_country;
|
815 |
$form_selected_region = $wpsc_delivery_region;
|
816 |
$onchange_function = 'set_shipping_country';
|
@@ -871,7 +872,6 @@ function wpsc_change_tax() {
|
|
871 |
}
|
872 |
echo "jQuery('#checkout_tax').html(\"<span class='pricedisplay'>" . wpsc_cart_tax() . "</span>\");\n\r";
|
873 |
echo "jQuery('#checkout_total').html(\"{$total}<input id='shopping_cart_total_price' type='hidden' value='{$total_input}' />\");\n\r";
|
874 |
-
echo "if(jQuery(\"#shippingSameBilling\").is(\":checked\")) wpsc_shipping_same_as_billing();";
|
875 |
exit();
|
876 |
}
|
877 |
|
436 |
}
|
437 |
|
438 |
// execute on POST and GET
|
439 |
+
if ( isset( $_REQUEST['update_product_price'] ) && ($_REQUEST['update_product_price'] == 'true') && ! empty( $_POST['product_id'] ) && is_numeric( $_POST['product_id'] ) ) {
|
440 |
add_action( 'init', 'wpsc_update_product_price' );
|
441 |
}
|
442 |
|
656 |
), array( 'id' => $purchase_log_id ) );
|
657 |
$_SESSION['gateway'] = 'google';
|
658 |
wp_redirect(get_option( 'shopping_cart_url' ));
|
659 |
+
exit;
|
660 |
}
|
661 |
}
|
662 |
}
|
807 |
$form_selected_region = null;
|
808 |
$onchange_function = null;
|
809 |
|
810 |
+
if ( ! empty( $_POST['billing_country'] ) && $_POST['billing_country'] != 'undefined' && !isset( $_POST['shipping_country'] ) ) {
|
811 |
$form_selected_country = $wpsc_selected_country;
|
812 |
$form_selected_region = $wpsc_selected_region;
|
813 |
$onchange_function = 'set_billing_country';
|
814 |
+
} else if ( ! empty( $_POST['shipping_country'] ) && $_POST['shipping_country'] != 'undefined' && !isset( $_POST['billing_country'] ) ) {
|
815 |
$form_selected_country = $wpsc_delivery_country;
|
816 |
$form_selected_region = $wpsc_delivery_region;
|
817 |
$onchange_function = 'set_shipping_country';
|
872 |
}
|
873 |
echo "jQuery('#checkout_tax').html(\"<span class='pricedisplay'>" . wpsc_cart_tax() . "</span>\");\n\r";
|
874 |
echo "jQuery('#checkout_total').html(\"{$total}<input id='shopping_cart_total_price' type='hidden' value='{$total_input}' />\");\n\r";
|
|
|
875 |
exit();
|
876 |
}
|
877 |
|
wpsc-includes/cart.class.php
CHANGED
@@ -262,9 +262,10 @@ function wpsc_the_cart_item_key() {
|
|
262 |
* cart item name function, no parameters
|
263 |
* @return string the cart item name
|
264 |
*/
|
265 |
-
function wpsc_cart_item_name() {
|
266 |
-
|
267 |
-
|
|
|
268 |
}
|
269 |
/**
|
270 |
* cart item quantity function, no parameters
|
@@ -332,7 +333,7 @@ function wpsc_cart_item_shipping($forDisplay = true) {
|
|
332 |
*/
|
333 |
function wpsc_cart_item_url() {
|
334 |
global $wpsc_cart;
|
335 |
-
return $wpsc_cart->cart_item->product_url;
|
336 |
}
|
337 |
|
338 |
/**
|
@@ -1229,7 +1230,7 @@ class wpsc_cart {
|
|
1229 |
function calculate_base_shipping() {
|
1230 |
global $wpdb, $wpsc_shipping_modules;
|
1231 |
if($this->uses_shipping()) {
|
1232 |
-
if ( isset( $this->shipping_quotes ) && empty( $this->shipping_quotes ) && isset( $
|
1233 |
$this->shipping_quotes = $wpsc_shipping_modules[$this->selected_shipping_method]->getQuote();
|
1234 |
}
|
1235 |
if($this->selected_shipping_option == null){
|
262 |
* cart item name function, no parameters
|
263 |
* @return string the cart item name
|
264 |
*/
|
265 |
+
function wpsc_cart_item_name( $context = 'display' ) {
|
266 |
+
global $wpsc_cart;
|
267 |
+
$product_name = apply_filters( 'wpsc_cart_item_name', $wpsc_cart->cart_item->product_name, $wpsc_cart->cart_item->product_id );
|
268 |
+
return esc_html( $product_name );
|
269 |
}
|
270 |
/**
|
271 |
* cart item quantity function, no parameters
|
333 |
*/
|
334 |
function wpsc_cart_item_url() {
|
335 |
global $wpsc_cart;
|
336 |
+
return apply_filters( 'wpsc_cart_item_url', $wpsc_cart->cart_item->product_url, $wpsc_cart->cart_item->product_id );
|
337 |
}
|
338 |
|
339 |
/**
|
1230 |
function calculate_base_shipping() {
|
1231 |
global $wpdb, $wpsc_shipping_modules;
|
1232 |
if($this->uses_shipping()) {
|
1233 |
+
if ( isset( $this->shipping_quotes ) && empty( $this->shipping_quotes ) && isset( $wpsc_shipping_modules[$this->selected_shipping_method] ) && is_callable( array( $wpsc_shipping_modules[$this->selected_shipping_method], "getQuote" ) ) ) {
|
1234 |
$this->shipping_quotes = $wpsc_shipping_modules[$this->selected_shipping_method]->getQuote();
|
1235 |
}
|
1236 |
if($this->selected_shipping_option == null){
|
wpsc-includes/category.functions.php
CHANGED
@@ -509,7 +509,8 @@ function wpsc_get_terms_category_sort_filter($terms){
|
|
509 |
|
510 |
foreach($terms as $term){
|
511 |
if(!is_object($term)) return $terms;
|
512 |
-
|
|
|
513 |
|
514 |
if(isset($term_order) && is_numeric($term_order) && !isset($new_terms[$term_order])){
|
515 |
$term->sort_order = $term_order;
|
@@ -530,7 +531,8 @@ function wpsc_get_terms_category_sort_filter($terms){
|
|
530 |
}
|
531 |
|
532 |
}
|
533 |
-
|
|
|
534 |
return $new_terms;
|
535 |
}
|
536 |
add_filter('get_terms','wpsc_get_terms_category_sort_filter');
|
509 |
|
510 |
foreach($terms as $term){
|
511 |
if(!is_object($term)) return $terms;
|
512 |
+
|
513 |
+
$term_order = $term->taxonomy == 'wpsc_product_category' ? wpsc_get_meta($term->term_id,'sort_order', 'wpsc_category') : 0;
|
514 |
|
515 |
if(isset($term_order) && is_numeric($term_order) && !isset($new_terms[$term_order])){
|
516 |
$term->sort_order = $term_order;
|
531 |
}
|
532 |
|
533 |
}
|
534 |
+
if ( $term_order )
|
535 |
+
ksort($new_terms);
|
536 |
return $new_terms;
|
537 |
}
|
538 |
add_filter('get_terms','wpsc_get_terms_category_sort_filter');
|
wpsc-includes/checkout.class.php
CHANGED
@@ -596,6 +596,7 @@ class wpsc_checkout {
|
|
596 |
*/
|
597 |
function form_field() {
|
598 |
global $wpdb, $user_ID;
|
|
|
599 |
if ( ($user_ID > 0) ){
|
600 |
if(!isset($_SESSION['wpsc_checkout_saved_values']))
|
601 |
$_SESSION['wpsc_checkout_saved_values'] = get_user_meta( $user_ID, 'wpshpcrt_usr_profile',1 );
|
@@ -793,7 +794,8 @@ class wpsc_checkout {
|
|
793 |
$value = '';
|
794 |
|
795 |
if( isset( $_POST['collected_data'][$form_data->id] ) )
|
796 |
-
$value = $_POST['collected_data'][$form_data->id];
|
|
|
797 |
$_SESSION['wpsc_checkout_saved_values'][$form_data->id] = $value;
|
798 |
$bad_input = false;
|
799 |
if ( ($form_data->mandatory == 1) || ($form_data->type == "coupon") ) {
|
596 |
*/
|
597 |
function form_field() {
|
598 |
global $wpdb, $user_ID;
|
599 |
+
|
600 |
if ( ($user_ID > 0) ){
|
601 |
if(!isset($_SESSION['wpsc_checkout_saved_values']))
|
602 |
$_SESSION['wpsc_checkout_saved_values'] = get_user_meta( $user_ID, 'wpshpcrt_usr_profile',1 );
|
794 |
$value = '';
|
795 |
|
796 |
if( isset( $_POST['collected_data'][$form_data->id] ) )
|
797 |
+
$value = stripslashes_deep( $_POST['collected_data'][$form_data->id] );
|
798 |
+
|
799 |
$_SESSION['wpsc_checkout_saved_values'][$form_data->id] = $value;
|
800 |
$bad_input = false;
|
801 |
if ( ($form_data->mandatory == 1) || ($form_data->type == "coupon") ) {
|
wpsc-includes/coupons.class.php
CHANGED
@@ -69,6 +69,20 @@ class wpsc_coupons {
|
|
69 |
$this->errormsg = false;
|
70 |
return false;
|
71 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
$this->value = $coupon_data['value'];
|
73 |
$this->is_percentage = $coupon_data['is-percentage'];
|
74 |
$this->conditions = unserialize($coupon_data['condition']);
|
@@ -109,14 +123,25 @@ class wpsc_coupons {
|
|
109 |
global $wpdb, $wpsc_cart;
|
110 |
|
111 |
$wpsc_cart->clear_cache();
|
112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
//Calculates the discount for the whole cart if there is no condition on this coupon.
|
114 |
if ($this->conditions == '' || count($this->conditions) == 0) {
|
115 |
-
|
116 |
-
// $this->is_percentage == '2' means "Free Shipping"
|
117 |
-
if ($this->is_percentage == '2'){
|
118 |
-
return $wpsc_cart->calculate_total_shipping();
|
119 |
-
}
|
120 |
|
121 |
// $this->is_percentage == '1' means "%" discount
|
122 |
if ($this->is_percentage == '1') {
|
@@ -229,6 +254,18 @@ class wpsc_coupons {
|
|
229 |
return true;
|
230 |
break;
|
231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
case 'not_contain'://Checks if the product name contains the condition value
|
233 |
preg_match("/(.*)".$c['value']."(.*)/", $product_data->post_title, $match);
|
234 |
if (empty($match))
|
69 |
$this->errormsg = false;
|
70 |
return false;
|
71 |
} else {
|
72 |
+
$coupon_data = array_merge( array(
|
73 |
+
'value' => '',
|
74 |
+
'is-percentage' => '',
|
75 |
+
'condition' => '',
|
76 |
+
'is-used' => '',
|
77 |
+
'active' => '',
|
78 |
+
'use-once' => '',
|
79 |
+
'use-x-times' => '',
|
80 |
+
'free-shipping' => '',
|
81 |
+
'start' => '',
|
82 |
+
'expiry' => '',
|
83 |
+
'every_product' => '',
|
84 |
+
), $coupon_data );
|
85 |
+
|
86 |
$this->value = $coupon_data['value'];
|
87 |
$this->is_percentage = $coupon_data['is-percentage'];
|
88 |
$this->conditions = unserialize($coupon_data['condition']);
|
123 |
global $wpdb, $wpsc_cart;
|
124 |
|
125 |
$wpsc_cart->clear_cache();
|
126 |
+
|
127 |
+
$return = 0;
|
128 |
+
|
129 |
+
// $this->is_percentage == '2' means "Free Shipping"
|
130 |
+
if ($this->is_percentage == '2'){
|
131 |
+
|
132 |
+
$discount_country = $this->free_shipping_details['discount_country'];
|
133 |
+
$discount_region = $this->free_shipping_details['discount_region'];
|
134 |
+
$delivery_country = $wpsc_cart->delivery_country;
|
135 |
+
$delivery_region = $wpsc_cart->delivery_region;
|
136 |
+
|
137 |
+
//if there is no region we just compare the countries otherwise compaire both the regions
|
138 |
+
//and countries or if there are no country/region limitation then its free shipping for everywhere
|
139 |
+
if (empty($discount_region) && ($discount_country == $delivery_country) || ($discount_country == $delivery_country) && ($delivery_region == $discount_region) || empty($this->free_shipping_details))
|
140 |
+
return $wpsc_cart->calculate_total_shipping();
|
141 |
+
}
|
142 |
+
|
143 |
//Calculates the discount for the whole cart if there is no condition on this coupon.
|
144 |
if ($this->conditions == '' || count($this->conditions) == 0) {
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
// $this->is_percentage == '1' means "%" discount
|
147 |
if ($this->is_percentage == '1') {
|
254 |
return true;
|
255 |
break;
|
256 |
|
257 |
+
case 'category'://Checks if the product category is the condition value
|
258 |
+
if ( $product_data->post_parent ) {
|
259 |
+
$categories = wp_get_post_terms( $product_data->post_parent, 'wpsc_product_category' );
|
260 |
+
} else {
|
261 |
+
$categories = wp_get_post_terms( $product_data->ID, 'wpsc_product_category' );
|
262 |
+
}
|
263 |
+
foreach ( $categories as $cat ) {
|
264 |
+
if ( strtolower( $cat->name ) == strtolower( $c['value'] ) )
|
265 |
+
return true;
|
266 |
+
}
|
267 |
+
break;
|
268 |
+
|
269 |
case 'not_contain'://Checks if the product name contains the condition value
|
270 |
preg_match("/(.*)".$c['value']."(.*)/", $product_data->post_title, $match);
|
271 |
if (empty($match))
|
wpsc-includes/display.functions.php
CHANGED
@@ -187,11 +187,12 @@ function external_link( $product_id ) {
|
|
187 |
|
188 |
function wpsc_add_to_cart_button( $product_id, $replaced_shortcode = false ) {
|
189 |
global $wpdb,$wpsc_variations;
|
|
|
190 |
if ( $product_id > 0 ) {
|
191 |
// grab the variation form fields here
|
192 |
$wpsc_variations = new wpsc_variations( $product_id );
|
193 |
-
|
194 |
-
$output .= "<form
|
195 |
/** the variation group HTML and loop */
|
196 |
$output .= "<div class='wpsc_variation_forms'>";
|
197 |
while (wpsc_have_variation_groups()) : wpsc_the_variation_group();
|
@@ -212,12 +213,8 @@ function wpsc_add_to_cart_button( $product_id, $replaced_shortcode = false ) {
|
|
212 |
$output .= "<input type='hidden' name='wpsc_ajax_action' value='add_to_cart' />";
|
213 |
$output .= "<input type='hidden' name='product_id' value='" . $product_id . "' />";
|
214 |
$output .= "<input type='hidden' name='item' value='" . $product_id . "' />";
|
215 |
-
|
216 |
-
|
217 |
-
} else {
|
218 |
-
$output .= "<input type='submit' id='product_" . $product['id'] . "_submit_button' class='wpsc_buy_button' name='Buy' value='" . __( 'Add To Cart', 'wpsc' ) . "' />";
|
219 |
-
}
|
220 |
-
$output .= '</form>';
|
221 |
if ( $replaced_shortcode == true ) {
|
222 |
return $output;
|
223 |
} else {
|
187 |
|
188 |
function wpsc_add_to_cart_button( $product_id, $replaced_shortcode = false ) {
|
189 |
global $wpdb,$wpsc_variations;
|
190 |
+
$output = '';
|
191 |
if ( $product_id > 0 ) {
|
192 |
// grab the variation form fields here
|
193 |
$wpsc_variations = new wpsc_variations( $product_id );
|
194 |
+
$output .= "<div class='wpsc-add-to-cart-button'>";
|
195 |
+
$output .= "<form class = 'wpsc-add-to-cart-button-form' id='product_" . $product_id . "' action='' method='post'>";
|
196 |
/** the variation group HTML and loop */
|
197 |
$output .= "<div class='wpsc_variation_forms'>";
|
198 |
while (wpsc_have_variation_groups()) : wpsc_the_variation_group();
|
213 |
$output .= "<input type='hidden' name='wpsc_ajax_action' value='add_to_cart' />";
|
214 |
$output .= "<input type='hidden' name='product_id' value='" . $product_id . "' />";
|
215 |
$output .= "<input type='hidden' name='item' value='" . $product_id . "' />";
|
216 |
+
$output .= "<input type='submit' id='product_" . $product_id . "_submit_button' class='wpsc_buy_button' name='Buy' value='" . __( 'Add To Cart', 'wpsc' ) . "' />";
|
217 |
+
$output .= '</form></div>';
|
|
|
|
|
|
|
|
|
218 |
if ( $replaced_shortcode == true ) {
|
219 |
return $output;
|
220 |
} else {
|
wpsc-includes/misc.functions.php
CHANGED
@@ -136,19 +136,9 @@ function wpsc_change_canonical_url( $url = '' ) {
|
|
136 |
global $wpdb, $wp_query, $wpsc_page_titles;
|
137 |
|
138 |
if ( $wp_query->is_single == true && 'wpsc-product' == $wp_query->query_vars['post_type']) {
|
139 |
-
$
|
140 |
-
if(count($categories) > 1){
|
141 |
-
foreach($categories as $category){
|
142 |
-
if(isset($wp_query->query_vars['wpsc_product_category']) && $category->slug == $wp_query->query_vars['wpsc_product_category'])continue;
|
143 |
-
if(isset($wp_query->query_vars['wpsc_product_category']) && $category->slug != $wp_query->query_vars['wpsc_product_category']){
|
144 |
-
return home_url($wpsc_page_titles['products'].'/'.$category->slug.'/'.$wp_query->query_vars['wpsc-product']);
|
145 |
-
}
|
146 |
-
|
147 |
-
}
|
148 |
-
}
|
149 |
-
|
150 |
}
|
151 |
-
return $url;
|
152 |
}
|
153 |
|
154 |
add_filter( 'aioseop_canonical_url', 'wpsc_change_canonical_url' );
|
136 |
global $wpdb, $wp_query, $wpsc_page_titles;
|
137 |
|
138 |
if ( $wp_query->is_single == true && 'wpsc-product' == $wp_query->query_vars['post_type']) {
|
139 |
+
$url = get_permalink( $wp_query->get_queried_object()->ID );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
+
return apply_filters( 'wpsc_change_canonical_url', $url );
|
142 |
}
|
143 |
|
144 |
add_filter( 'aioseop_canonical_url', 'wpsc_change_canonical_url' );
|
wpsc-includes/processing.functions.php
CHANGED
@@ -9,14 +9,15 @@
|
|
9 |
* @return void
|
10 |
*/
|
11 |
function wpsc_currency_display( $price_in, $args = null ) {
|
12 |
-
global $wpdb
|
13 |
$currency_code = '';
|
14 |
$args = apply_filters( 'wpsc_toggle_display_currency_code', $args );
|
15 |
$query = shortcode_atts( array(
|
16 |
'display_currency_symbol' => true,
|
17 |
'display_decimal_point' => true,
|
18 |
'display_currency_code' => false,
|
19 |
-
'display_as_html' => true
|
|
|
20 |
), $args );
|
21 |
|
22 |
// No decimal point, no decimals
|
@@ -39,12 +40,18 @@ function wpsc_currency_display( $price_in, $args = null ) {
|
|
39 |
// Format the price for output
|
40 |
$price_out = number_format( (double)$price_in, $decimals, $decimal_separator, $thousands_separator );
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
// Figure out the currency code
|
50 |
if ( $query['display_currency_code'] )
|
@@ -284,7 +291,7 @@ function wpsc_check_stock($state, $product) {
|
|
284 |
$state['state'] = false;
|
285 |
$state['messages'] = array();
|
286 |
$out_of_stock = false;
|
287 |
-
$is_parent = wpsc_product_has_children( $product->ID );
|
288 |
if( !$is_parent ){
|
289 |
$stock_count = get_product_meta( $product->ID, 'stock',true );
|
290 |
// only do anything if the quantity is limited.
|
@@ -335,7 +342,7 @@ function wpsc_check_weight($state, $product) {
|
|
335 |
$has_no_weight = false;
|
336 |
$shipping_modules = array();
|
337 |
$product_meta = get_product_meta( $product->ID, 'product_metadata',true );
|
338 |
-
if(wpsc_product_has_children($product->ID)) return $state;
|
339 |
// only do anything if UPS is on and shipping is used
|
340 |
if( array_search( 'ups', $custom_shipping ) !== false )
|
341 |
$shipping_modules[] = 'UPS';
|
9 |
* @return void
|
10 |
*/
|
11 |
function wpsc_currency_display( $price_in, $args = null ) {
|
12 |
+
global $wpdb;
|
13 |
$currency_code = '';
|
14 |
$args = apply_filters( 'wpsc_toggle_display_currency_code', $args );
|
15 |
$query = shortcode_atts( array(
|
16 |
'display_currency_symbol' => true,
|
17 |
'display_decimal_point' => true,
|
18 |
'display_currency_code' => false,
|
19 |
+
'display_as_html' => true,
|
20 |
+
'isocode' => false,
|
21 |
), $args );
|
22 |
|
23 |
// No decimal point, no decimals
|
40 |
// Format the price for output
|
41 |
$price_out = number_format( (double)$price_in, $decimals, $decimal_separator, $thousands_separator );
|
42 |
|
43 |
+
if ( ! $query['isocode'] ) {
|
44 |
+
// Get currency settings
|
45 |
+
$currency_type = get_option( 'currency_type' );
|
46 |
+
|
47 |
+
if ( ! $wpsc_currency_data = wp_cache_get( $currency_type, 'wpsc_currency_id' ) ) {
|
48 |
+
$wpsc_currency_data = $wpdb->get_row( "SELECT `symbol`, `symbol_html`, `code` FROM `" . WPSC_TABLE_CURRENCY_LIST . "` WHERE `id` = '" . $currency_type . "' LIMIT 1", ARRAY_A );
|
49 |
+
wp_cache_set( $currency_type, $wpsc_currency_data, 'wpsc_currency_id' );
|
50 |
+
}
|
51 |
+
} elseif ( ! $wpsc_currency_data = wp_cache_get( $query['isocode'], 'wpsc_currency_isocode' ) ) {
|
52 |
+
$wpsc_currency_data = $wpdb->get_row( "SELECT `symbol`, `symbol_html`, `code` FROM `" . WPSC_TABLE_CURRENCY_LIST . "` WHERE `isocode` = '" . $query['isocode'] . "' LIMIT 1", ARRAY_A );
|
53 |
+
wp_cache_set( $query['isocode'], $wpsc_currency_data, 'wpsc_currency_isocode' );
|
54 |
+
}
|
55 |
|
56 |
// Figure out the currency code
|
57 |
if ( $query['display_currency_code'] )
|
291 |
$state['state'] = false;
|
292 |
$state['messages'] = array();
|
293 |
$out_of_stock = false;
|
294 |
+
$is_parent = ! $product->post_parent && wpsc_product_has_children( $product->ID );
|
295 |
if( !$is_parent ){
|
296 |
$stock_count = get_product_meta( $product->ID, 'stock',true );
|
297 |
// only do anything if the quantity is limited.
|
342 |
$has_no_weight = false;
|
343 |
$shipping_modules = array();
|
344 |
$product_meta = get_product_meta( $product->ID, 'product_metadata',true );
|
345 |
+
if(! $product->post_parent && wpsc_product_has_children($product->ID)) return $state;
|
346 |
// only do anything if UPS is on and shipping is used
|
347 |
if( array_search( 'ups', $custom_shipping ) !== false )
|
348 |
$shipping_modules[] = 'UPS';
|
wpsc-includes/product-template.php
CHANGED
@@ -1202,7 +1202,8 @@ function wpsc_the_product_thumbnail( $width = null, $height = null, $product_id
|
|
1202 |
// regenerate size metadata in case it's missing
|
1203 |
if ( ! image_get_intermediate_size( $thumbnail_id, $custom_thumbnail ) ) {
|
1204 |
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
1205 |
-
$metadata = wp_get_attachment_metadata( $thumbnail_id )
|
|
|
1206 |
$file = get_attached_file( $thumbnail_id );
|
1207 |
$generated = wp_generate_attachment_metadata( $thumbnail_id, $file );
|
1208 |
$metadata['sizes'] = array_merge( $generated['sizes'], $metadata['sizes'] );
|
@@ -1388,7 +1389,7 @@ function wpsc_product_has_multicurrency() {
|
|
1388 |
global $wpdb, $wpsc_query;
|
1389 |
|
1390 |
$currency = get_product_meta(get_the_ID(),'currency',true);
|
1391 |
-
if (
|
1392 |
return true;
|
1393 |
else
|
1394 |
return false;
|
@@ -1400,15 +1401,7 @@ function wpsc_display_product_multicurrency() {
|
|
1400 |
$results = get_product_meta(get_the_ID(),'currency',true);
|
1401 |
if ( count( $results ) > 0 ) {
|
1402 |
foreach ( (array)$results as $isocode => $curr ) {
|
1403 |
-
|
1404 |
-
|
1405 |
-
if ( $currency_data['symbol'] != '' )
|
1406 |
-
$currency_sign = $currency_data['symbol_html'];
|
1407 |
-
else
|
1408 |
-
$currency_sign = $currency_data['code'];
|
1409 |
-
|
1410 |
-
if ( !empty( $currency_sign ) )
|
1411 |
-
echo '<span class="wpscsmall pricefloatright pricedisplay">' . $isocode . ' ' . wpsc_currency_display( $curr["meta_value"] ) . '</span><br />';
|
1412 |
}
|
1413 |
}
|
1414 |
|
1202 |
// regenerate size metadata in case it's missing
|
1203 |
if ( ! image_get_intermediate_size( $thumbnail_id, $custom_thumbnail ) ) {
|
1204 |
require_once( ABSPATH . 'wp-admin/includes/image.php' );
|
1205 |
+
if ( ! $metadata = wp_get_attachment_metadata( $thumbnail_id ) )
|
1206 |
+
$metadata = array();
|
1207 |
$file = get_attached_file( $thumbnail_id );
|
1208 |
$generated = wp_generate_attachment_metadata( $thumbnail_id, $file );
|
1209 |
$metadata['sizes'] = array_merge( $generated['sizes'], $metadata['sizes'] );
|
1389 |
global $wpdb, $wpsc_query;
|
1390 |
|
1391 |
$currency = get_product_meta(get_the_ID(),'currency',true);
|
1392 |
+
if ( ! empty( $currency ) )
|
1393 |
return true;
|
1394 |
else
|
1395 |
return false;
|
1401 |
$results = get_product_meta(get_the_ID(),'currency',true);
|
1402 |
if ( count( $results ) > 0 ) {
|
1403 |
foreach ( (array)$results as $isocode => $curr ) {
|
1404 |
+
echo apply_filters( 'wpsc_display_product_multicurrency', '<span class="wpscsmall pricefloatright pricedisplay">' . $isocode . ': ' . wpsc_currency_display( $curr, array( 'isocode' => $isocode ) ) . '</span><br />', $isocode, $curr );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1405 |
}
|
1406 |
}
|
1407 |
|
wpsc-includes/purchaselogs.class.php
CHANGED
@@ -362,7 +362,7 @@ function wpsc_purchaselog_details_total() {
|
|
362 |
global $purchlogitem;
|
363 |
$total = 0;
|
364 |
$total += ( $purchlogitem->purchitem->price * $purchlogitem->purchitem->quantity);
|
365 |
-
$total += ( $purchlogitem->purchitem->pnp
|
366 |
$purchlogitem->totalAmount += $total;
|
367 |
return $total;
|
368 |
}
|
@@ -414,7 +414,7 @@ function wpsc_display_purchlog_shipping( $numeric = false ) {
|
|
414 |
$per_item_shipping = 0;
|
415 |
foreach ( (array)$purchlogitem->allcartcontent as $cart_item ) {
|
416 |
if ( $cart_item->pnp > 0 ) {
|
417 |
-
$per_item_shipping += ( $cart_item->pnp
|
418 |
}
|
419 |
}
|
420 |
$total_shipping = $per_item_shipping + $base_shipping;
|
362 |
global $purchlogitem;
|
363 |
$total = 0;
|
364 |
$total += ( $purchlogitem->purchitem->price * $purchlogitem->purchitem->quantity);
|
365 |
+
$total += ( $purchlogitem->purchitem->pnp );
|
366 |
$purchlogitem->totalAmount += $total;
|
367 |
return $total;
|
368 |
}
|
414 |
$per_item_shipping = 0;
|
415 |
foreach ( (array)$purchlogitem->allcartcontent as $cart_item ) {
|
416 |
if ( $cart_item->pnp > 0 ) {
|
417 |
+
$per_item_shipping += ( $cart_item->pnp );
|
418 |
}
|
419 |
}
|
420 |
$total_shipping = $per_item_shipping + $base_shipping;
|
wpsc-includes/theme.functions.php
CHANGED
@@ -407,7 +407,7 @@ function wpsc_single_template( $content ) {
|
|
407 |
|
408 |
//if we are a paged page
|
409 |
if(isset($wpsc_query->query['paged']) && $wpsc_query->post_count <= 1 && $wp_query->is_single != 1){
|
410 |
-
remove_filter( "the_content", "wpsc_single_template" );
|
411 |
list($wp_query, $wpsc_query) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
412 |
$GLOBALS['nzshpcrt_activateshpcrt'] = true;
|
413 |
// get the display type for the productspage
|
@@ -435,7 +435,7 @@ function wpsc_single_template( $content ) {
|
|
435 |
}
|
436 |
// If we are a single products page
|
437 |
if ( 'wpsc-product' == $wp_query->post->post_type && !is_archive() && $wp_query->post_count <= 1 ) {
|
438 |
-
remove_filter( "the_content", "wpsc_single_template" );
|
439 |
$single_theme_path = wpsc_get_template_file_path( 'wpsc-single_product.php' );
|
440 |
if( isset( $wp_query->query_vars['preview'] ) && $wp_query->query_vars['preview'])
|
441 |
$is_preview = 'true';
|
@@ -452,7 +452,7 @@ function wpsc_single_template( $content ) {
|
|
452 |
|
453 |
}elseif( is_archive() && wpsc_is_viewable_taxonomy() || ($wp_query->post_count > 1 && 1 == $wp_query->is_product)){
|
454 |
// If we are a category page
|
455 |
-
remove_filter( "the_content", "wpsc_single_template" );
|
456 |
list( $wp_query, $wpsc_query ) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
457 |
if(isset($wp_query->query['pagename']))
|
458 |
$display_type = get_option( 'product_view' );
|
@@ -1211,7 +1211,7 @@ function wpec_get_the_post_id_by_shortcode($shortcode){
|
|
1211 |
global $wpdb;
|
1212 |
$sql = "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` IN('page','post') AND `post_content` LIKE '%$shortcode%' LIMIT 1";
|
1213 |
$page_id = $wpdb->get_var($sql);
|
1214 |
-
return $page_id;
|
1215 |
}
|
1216 |
|
1217 |
function wpec_remap_shop_subpages($vars) {
|
@@ -1272,6 +1272,7 @@ add_filter('request', 'wpsc_remove_page_from_query_string');
|
|
1272 |
|
1273 |
function add_to_cart_shortcode( $content = '' ) {
|
1274 |
//exit($content);
|
|
|
1275 |
if ( preg_match_all( "/\[add_to_cart=([\d]+)\]/", $content, $matches ) ) {
|
1276 |
foreach ( $matches[1] as $key => $product_id ) {
|
1277 |
$original_string = $matches[0][$key];
|
@@ -1279,6 +1280,10 @@ function add_to_cart_shortcode( $content = '' ) {
|
|
1279 |
$content = str_replace( $original_string, $output, $content );
|
1280 |
}
|
1281 |
}
|
|
|
|
|
|
|
|
|
1282 |
return $content;
|
1283 |
}
|
1284 |
function wpsc_enable_page_filters( $excerpt = '' ) {
|
407 |
|
408 |
//if we are a paged page
|
409 |
if(isset($wpsc_query->query['paged']) && $wpsc_query->post_count <= 1 && $wp_query->is_single != 1){
|
410 |
+
remove_filter( "the_content", "wpsc_single_template", 12 );
|
411 |
list($wp_query, $wpsc_query) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
412 |
$GLOBALS['nzshpcrt_activateshpcrt'] = true;
|
413 |
// get the display type for the productspage
|
435 |
}
|
436 |
// If we are a single products page
|
437 |
if ( 'wpsc-product' == $wp_query->post->post_type && !is_archive() && $wp_query->post_count <= 1 ) {
|
438 |
+
remove_filter( "the_content", "wpsc_single_template", 12 );
|
439 |
$single_theme_path = wpsc_get_template_file_path( 'wpsc-single_product.php' );
|
440 |
if( isset( $wp_query->query_vars['preview'] ) && $wp_query->query_vars['preview'])
|
441 |
$is_preview = 'true';
|
452 |
|
453 |
}elseif( is_archive() && wpsc_is_viewable_taxonomy() || ($wp_query->post_count > 1 && 1 == $wp_query->is_product)){
|
454 |
// If we are a category page
|
455 |
+
remove_filter( "the_content", "wpsc_single_template", 12 );
|
456 |
list( $wp_query, $wpsc_query ) = array( $wpsc_query, $wp_query ); // swap the wpsc_query object
|
457 |
if(isset($wp_query->query['pagename']))
|
458 |
$display_type = get_option( 'product_view' );
|
1211 |
global $wpdb;
|
1212 |
$sql = "SELECT `ID` FROM `{$wpdb->posts}` WHERE `post_type` IN('page','post') AND `post_content` LIKE '%$shortcode%' LIMIT 1";
|
1213 |
$page_id = $wpdb->get_var($sql);
|
1214 |
+
return apply_filters( 'wpec_get_the_post_id_by_shortcode', $page_id );
|
1215 |
}
|
1216 |
|
1217 |
function wpec_remap_shop_subpages($vars) {
|
1272 |
|
1273 |
function add_to_cart_shortcode( $content = '' ) {
|
1274 |
//exit($content);
|
1275 |
+
static $fancy_notification_output = false;
|
1276 |
if ( preg_match_all( "/\[add_to_cart=([\d]+)\]/", $content, $matches ) ) {
|
1277 |
foreach ( $matches[1] as $key => $product_id ) {
|
1278 |
$original_string = $matches[0][$key];
|
1280 |
$content = str_replace( $original_string, $output, $content );
|
1281 |
}
|
1282 |
}
|
1283 |
+
if ( ! $fancy_notification_output ) {
|
1284 |
+
$content .= fancy_notifications();
|
1285 |
+
$fancy_notification_output = true;
|
1286 |
+
}
|
1287 |
return $content;
|
1288 |
}
|
1289 |
function wpsc_enable_page_filters( $excerpt = '' ) {
|
wpsc-merchants/chronopay.php
CHANGED
@@ -116,7 +116,7 @@ function gateway_chronopay($separator, $sessionid)
|
|
116 |
|
117 |
$local_currency_productprice = $item['price'];
|
118 |
|
119 |
-
$local_currency_shipping = $item['pnp']
|
120 |
|
121 |
|
122 |
$chronopay_currency_productprice = $local_currency_productprice;
|
116 |
|
117 |
$local_currency_productprice = $item['price'];
|
118 |
|
119 |
+
$local_currency_shipping = $item['pnp'];
|
120 |
|
121 |
|
122 |
$chronopay_currency_productprice = $local_currency_productprice;
|
wpsc-merchants/paypal-standard.merchant.php
CHANGED
@@ -237,7 +237,18 @@ class wpsc_merchant_paypal_standard extends wpsc_merchant {
|
|
237 |
'cmd' => '_ext-enter',
|
238 |
'redirect_cmd' => '_cart',
|
239 |
);
|
240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
if($add_tax)
|
242 |
$paypal_vars['tax_cart'] = $this->convert( $this->cart_data['cart_tax'] );
|
243 |
|
@@ -249,7 +260,7 @@ class wpsc_merchant_paypal_standard extends wpsc_merchant {
|
|
249 |
// Stick the cart item values together here
|
250 |
$i = 1;
|
251 |
|
252 |
-
if (!$
|
253 |
foreach ($this->cart_items as $cart_row) {
|
254 |
$paypal_vars += array(
|
255 |
"item_name_$i" => $cart_row['name'],
|
@@ -265,6 +276,9 @@ class wpsc_merchant_paypal_standard extends wpsc_merchant {
|
|
265 |
);
|
266 |
++$i;
|
267 |
}
|
|
|
|
|
|
|
268 |
} else {
|
269 |
$paypal_vars['item_name_'.$i] = "Your Shopping Cart";
|
270 |
$paypal_vars['amount_'.$i] = $this->convert( $this->cart_data['total_price'] ) - $this->convert( $this->cart_data['base_shipping'] );
|
237 |
'cmd' => '_ext-enter',
|
238 |
'redirect_cmd' => '_cart',
|
239 |
);
|
240 |
+
|
241 |
+
$free_shipping = false;
|
242 |
+
if ( isset( $_SESSION['coupon_numbers'] ) ) {
|
243 |
+
$coupon = new wpsc_coupons( $_SESSION['coupon_numbers'] );
|
244 |
+
$free_shipping = $coupon->is_percentage == '2';
|
245 |
+
}
|
246 |
+
|
247 |
+
if ( $this->cart_data['has_discounts'] && $free_shipping )
|
248 |
+
$handling = 0;
|
249 |
+
else
|
250 |
+
$handling = $this->cart_data['base_shipping'];
|
251 |
+
|
252 |
if($add_tax)
|
253 |
$paypal_vars['tax_cart'] = $this->convert( $this->cart_data['cart_tax'] );
|
254 |
|
260 |
// Stick the cart item values together here
|
261 |
$i = 1;
|
262 |
|
263 |
+
if (!$aggregate) {
|
264 |
foreach ($this->cart_items as $cart_row) {
|
265 |
$paypal_vars += array(
|
266 |
"item_name_$i" => $cart_row['name'],
|
276 |
);
|
277 |
++$i;
|
278 |
}
|
279 |
+
|
280 |
+
if ( $this->cart_data['has_discounts'] && ! $free_shipping )
|
281 |
+
$paypal_vars['discount_amount_cart'] = $this->convert( $this->cart_data['cart_discount_value'] );
|
282 |
} else {
|
283 |
$paypal_vars['item_name_'.$i] = "Your Shopping Cart";
|
284 |
$paypal_vars['amount_'.$i] = $this->convert( $this->cart_data['total_price'] ) - $this->convert( $this->cart_data['base_shipping'] );
|
wpsc-theme/functions/wpsc-transaction_results_functions.php
CHANGED
@@ -53,7 +53,7 @@ function wpsc_transaction_theme() {
|
|
53 |
case 'dps':
|
54 |
$sessionid = decrypt_dps_response();
|
55 |
break;
|
56 |
-
|
57 |
case 'paystation':
|
58 |
$ec = $_GET['ec'];
|
59 |
$result= $_GET['em'];
|
@@ -62,9 +62,9 @@ function wpsc_transaction_theme() {
|
|
62 |
$processed_id = '3';
|
63 |
|
64 |
if($result == 'Insufficient Funds' && $ec == 5){
|
65 |
-
|
66 |
|
67 |
-
|
68 |
}
|
69 |
if($processed_id){
|
70 |
$wpdb->update( WPSC_TABLE_PURCHASE_LOGS, array('processed' => $processed_id),array('sessionid'=>$sessionid), array('%f') );
|
@@ -180,7 +180,7 @@ function transaction_results( $sessionid, $display_to_screen = true, $transactio
|
|
180 |
do_action( 'wpsc_confirm_checkout', $purchase_log['id'] );
|
181 |
|
182 |
$total = 0;
|
183 |
-
$shipping = $row['pnp']
|
184 |
$total_shipping += $shipping;
|
185 |
|
186 |
$total += ( $row['price'] * $row['quantity']);
|
53 |
case 'dps':
|
54 |
$sessionid = decrypt_dps_response();
|
55 |
break;
|
56 |
+
//paystation was not updating the purchase logs for successful payment - this is ugly as need to have the databse update done in one place by all gatways on a sucsessful transaction hook not some within the gateway and some within here and some not at all??? This is getting a major overhaul but for here and now it just needs to work for the gold cart people!
|
57 |
case 'paystation':
|
58 |
$ec = $_GET['ec'];
|
59 |
$result= $_GET['em'];
|
62 |
$processed_id = '3';
|
63 |
|
64 |
if($result == 'Insufficient Funds' && $ec == 5){
|
65 |
+
$processed_id = '6';
|
66 |
|
67 |
+
$payment_instructions = printf( __( 'Sorry your transaction was not accepted due to insufficient funds <br /><a href="%1$s">Click here to go back to checkout page</a>.', 'wpsc' ), get_option( "shopping_cart_url" ) );
|
68 |
}
|
69 |
if($processed_id){
|
70 |
$wpdb->update( WPSC_TABLE_PURCHASE_LOGS, array('processed' => $processed_id),array('sessionid'=>$sessionid), array('%f') );
|
180 |
do_action( 'wpsc_confirm_checkout', $purchase_log['id'] );
|
181 |
|
182 |
$total = 0;
|
183 |
+
$shipping = $row['pnp'];
|
184 |
$total_shipping += $shipping;
|
185 |
|
186 |
$total += ( $row['price'] * $row['quantity']);
|
wpsc-theme/wpsc-default.css
CHANGED
@@ -93,10 +93,14 @@ Author URI: http://instinct.co.nz
|
|
93 |
}
|
94 |
|
95 |
.default_product_display .imagecol {
|
96 |
-
margin:0px 5px 0px 0px;
|
97 |
-
float:left;
|
98 |
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
|
102 |
.default_product_display .imagecol img.product_image {
|
@@ -109,8 +113,8 @@ Author URI: http://instinct.co.nz
|
|
109 |
}
|
110 |
|
111 |
.default_product_display .productcol {
|
112 |
-
|
113 |
-
|
114 |
}
|
115 |
|
116 |
.default_product_display h2.prodtitle, #content .default_product_display h2.prodtitle {
|
@@ -309,13 +313,16 @@ Author URI: http://instinct.co.nz
|
|
309 |
cursor: -moz-zoom-in;
|
310 |
}
|
311 |
|
312 |
-
|
313 |
-
#content .default_product_display .wpsc_buy_button_container,
|
314 |
.single_product_display form.product_form .wpsc_buy_button_container,
|
315 |
#content .single_product_display form.product_form .wpsc_buy_button_container{
|
316 |
text-align: right;
|
317 |
}
|
318 |
|
|
|
|
|
|
|
|
|
319 |
/*-----LIST VIEW PRODUCT DISPLAY-----*/
|
320 |
#list_view_products_page_container {
|
321 |
/* width:650px; */
|
@@ -354,7 +361,7 @@ table.list_productdisplay .quantity_container {
|
|
354 |
display:inline;
|
355 |
}
|
356 |
|
357 |
-
#content
|
358 |
font-size: 12px;
|
359 |
}
|
360 |
|
@@ -446,11 +453,6 @@ table.list_productdisplay p.soldout {
|
|
446 |
display:block;
|
447 |
}
|
448 |
|
449 |
-
.productcol {
|
450 |
-
float:left;
|
451 |
-
/* width:70%; */
|
452 |
-
position:relative;
|
453 |
-
}
|
454 |
|
455 |
.single_product_display .product_description, .single_product_display .single_additional_description {
|
456 |
font-size:14px;
|
93 |
}
|
94 |
|
95 |
.default_product_display .imagecol {
|
|
|
|
|
96 |
|
97 |
+
text-align: right;
|
98 |
+
display: table-cell;
|
99 |
+
vertical-align: middle;
|
100 |
+
min-height: 50px;
|
101 |
+
height: 100%;
|
102 |
+
overflow: auto;
|
103 |
+
|
104 |
}
|
105 |
|
106 |
.default_product_display .imagecol img.product_image {
|
113 |
}
|
114 |
|
115 |
.default_product_display .productcol {
|
116 |
+
vertical-align: middle;
|
117 |
+
min-height: 50px;
|
118 |
}
|
119 |
|
120 |
.default_product_display h2.prodtitle, #content .default_product_display h2.prodtitle {
|
313 |
cursor: -moz-zoom-in;
|
314 |
}
|
315 |
|
316 |
+
|
|
|
317 |
.single_product_display form.product_form .wpsc_buy_button_container,
|
318 |
#content .single_product_display form.product_form .wpsc_buy_button_container{
|
319 |
text-align: right;
|
320 |
}
|
321 |
|
322 |
+
.default_product_display .wpsc_buy_button_container{
|
323 |
+
float:right;
|
324 |
+
}
|
325 |
+
|
326 |
/*-----LIST VIEW PRODUCT DISPLAY-----*/
|
327 |
#list_view_products_page_container {
|
328 |
/* width:650px; */
|
361 |
display:inline;
|
362 |
}
|
363 |
|
364 |
+
#content input.wpsc_buy_button{
|
365 |
font-size: 12px;
|
366 |
}
|
367 |
|
453 |
display:block;
|
454 |
}
|
455 |
|
|
|
|
|
|
|
|
|
|
|
456 |
|
457 |
.single_product_display .product_description, .single_product_display .single_additional_description {
|
458 |
font-size:14px;
|
wpsc-theme/wpsc-products_page.php
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
<?php
|
2 |
global $wp_query;
|
|
|
3 |
/*
|
4 |
* Most functions called in this page can be found in the wpsc_query.php file
|
5 |
*/
|
@@ -73,7 +74,7 @@ global $wp_query;
|
|
73 |
<?php endif; ?>
|
74 |
</h2>
|
75 |
<?php if(wpsc_show_thumbnails()) :?>
|
76 |
-
<div class="imagecol" id="imagecol_<?php echo wpsc_the_product_id(); ?>">
|
77 |
<?php if(wpsc_the_product_thumbnail()) :
|
78 |
?>
|
79 |
<a rel="<?php echo wpsc_the_product_title(); ?>" class="<?php echo wpsc_the_product_image_link_classes(); ?>" href="<?php echo wpsc_the_product_image(); ?>">
|
@@ -92,7 +93,7 @@ global $wp_query;
|
|
92 |
?>
|
93 |
</div><!--close imagecol-->
|
94 |
<?php endif; ?>
|
95 |
-
<div class="productcol">
|
96 |
|
97 |
|
98 |
|
1 |
<?php
|
2 |
global $wp_query;
|
3 |
+
$image_width = get_option('product_image_width');
|
4 |
/*
|
5 |
* Most functions called in this page can be found in the wpsc_query.php file
|
6 |
*/
|
74 |
<?php endif; ?>
|
75 |
</h2>
|
76 |
<?php if(wpsc_show_thumbnails()) :?>
|
77 |
+
<div class="imagecol" style="width:<?php echo $image_width; ?>;" id="imagecol_<?php echo wpsc_the_product_id(); ?>">
|
78 |
<?php if(wpsc_the_product_thumbnail()) :
|
79 |
?>
|
80 |
<a rel="<?php echo wpsc_the_product_title(); ?>" class="<?php echo wpsc_the_product_image_link_classes(); ?>" href="<?php echo wpsc_the_product_image(); ?>">
|
93 |
?>
|
94 |
</div><!--close imagecol-->
|
95 |
<?php endif; ?>
|
96 |
+
<div class="productcol" style="margin-left:<?php echo $image_width + 20; ?>px;" >
|
97 |
|
98 |
|
99 |
|
wpsc-theme/wpsc-shopping_cart_page.php
CHANGED
@@ -302,7 +302,7 @@ endif;
|
|
302 |
elseif(isset($_POST['submit']) && !isset($_POST['shippingSameBilling']))
|
303 |
$_SESSION['shippingSameBilling'] = false;
|
304 |
|
305 |
-
if($_SESSION['shippingSameBilling'] == 'true')
|
306 |
$checked = 'checked="checked"';
|
307 |
?>
|
308 |
<label for='shippingSameBilling'><?php _e('Same as billing address:','wpsc'); ?></label>
|
302 |
elseif(isset($_POST['submit']) && !isset($_POST['shippingSameBilling']))
|
303 |
$_SESSION['shippingSameBilling'] = false;
|
304 |
|
305 |
+
if( isset( $_SESSION['shippingSameBilling'] ) && $_SESSION['shippingSameBilling'] == 'true' )
|
306 |
$checked = 'checked="checked"';
|
307 |
?>
|
308 |
<label for='shippingSameBilling'><?php _e('Same as billing address:','wpsc'); ?></label>
|
wpsc-widgets/donations_widget.php
CHANGED
@@ -132,6 +132,8 @@ function wpsc_donations( $args = null ) {
|
|
132 |
AND `m`.`meta_value` IN( '1' )
|
133 |
ORDER BY RAND( )
|
134 |
LIMIT 1", ARRAY_A );
|
|
|
|
|
135 |
|
136 |
if ( $products != null ) {
|
137 |
foreach ( $products as $product ) {
|
132 |
AND `m`.`meta_value` IN( '1' )
|
133 |
ORDER BY RAND( )
|
134 |
LIMIT 1", ARRAY_A );
|
135 |
+
|
136 |
+
$output = '';
|
137 |
|
138 |
if ( $products != null ) {
|
139 |
foreach ( $products as $product ) {
|