Changeset 3364556
- Timestamp:
- 09/19/2025 01:01:58 PM (7 months ago)
- Location:
- printess-editor/trunk
- Files:
-
- 2 edited
-
printess.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
printess-editor/trunk/printess.php
r3364022 r3364556 5 5 * Plugin URI: https://printess.com/kb/integrations/woo-commerce/index.html 6 6 * Developer: Bastian Kröger (support@printess.com); Alexander Oser (support@printess.com) 7 * Version: 1.6.6 37 * Version: 1.6.64 8 8 * Author: Printess 9 9 * Author URI: https://printess.com … … 14 14 * Tested up to: 6.8 15 15 * 16 * Woo: 10000:92402 1dfsfhsf8429842386wdff234sfd16 * Woo: 10000:924022dfsfhsf8429842386wdff234sfd 17 17 * WC requires at least: 5.8 18 18 * WC tested up to: 9.8.2 … … 2263 2263 $sorted_cart_contents, 2264 2264 function ( $a, $b ) { 2265 if ( array_key_exists( 'printess_date_added', $a ) && array_key_exists( 'printess_date_added', $b ) ) { 2266 return strcmp( $a['printess_date_added'], $b['printess_date_added'] ) * -1; 2267 } elseif ( array_key_exists( 'printess_date_added', $a ) && ! array_key_exists( 'printess_date_added', $b ) ) { 2265 $a_date = null; 2266 $a_id = null; 2267 $b_date = null; 2268 $b_id = null; 2269 2270 if(is_array($a)) { 2271 if(array_key_exists('printess_date_added', $a)) { 2272 $a_date = $a['printess_date_added']; 2273 } 2274 2275 if(array_key_exists('id', $a)) { 2276 $a_id = $a['id']; 2277 } 2278 } else if(is_object($a)) { 2279 if(property_exists($a, 'printess_date_added')) { 2280 $a_date = $a->printess_date_added; 2281 } 2282 2283 if(property_exists($a, 'id')) { 2284 $a_id = $a->id; 2285 } 2286 } 2287 2288 if(is_array($b)) { 2289 if(array_key_exists('printess_date_added', $b)) { 2290 $b_date = $b['printess_date_added']; 2291 } 2292 2293 if(array_key_exists('id', $b)) { 2294 $b_id = $b['id']; 2295 } 2296 } else if(is_object($b)) { 2297 if(property_exists($b, 'printess_date_added')) { 2298 $b_date = $b->printess_date_added; 2299 } 2300 2301 if(property_exists($b, 'id')) { 2302 $b_id = $b->id; 2303 } 2304 } 2305 2306 if ( null !== $a_date && null !== $b_date ) { 2307 return strcmp( $a_date, $b_date ) * -1; 2308 } elseif ( null !== $a_date && null === $b_date ) { 2268 2309 return -1; 2269 } elseif ( ! array_key_exists( 'printess_date_added', $a ) && array_key_exists( 'printess_date_added', $b ) ) { 2310 } elseif ( null === $a_date && null !== $b_date ) { 2311 return 1; 2312 } else if ( null !== $a_id && null !== $b_id ) { 2313 return $b_id - $a_id; 2314 } elseif ( null !== $a_id && null === $b_id ) { 2315 return -1; 2316 } elseif ( null === $a_id && null !== $b_date ) { 2270 2317 return 1; 2271 2318 } else { 2272 $a_id = -1; 2273 $b_id = -1; 2274 2275 if(property_exists($a, "id")) { 2276 $a_id = $a->id; 2277 } else if(is_array($a) && array_key_exists("id", $a)) { 2278 $a_id = $a["id"]; 2279 } else { 2280 //Give up and sort it at the end 2281 return 1; 2282 } 2283 2284 if(property_exists($b, "id")) { 2285 $a_id = $a->id; 2286 } else if(is_array($b) && array_key_exists("id", $b)) { 2287 $b_id = $b["id"]; 2288 } else { 2289 //Give up and sort it at the end 2290 return -1; 2291 } 2292 2293 return $sort_order[ $a_id ] < $sort_order[ $b_id ] ? -1 : 1; 2319 return 0; 2294 2320 } 2295 2321 } 2296 2322 ); 2323 } catch(\InvalidArgumentException $ex) { 2324 $sorted_cart_contents = $cart_contents; 2297 2325 } catch( \Exception $ex) { 2298 2326 $sorted_cart_contents = $cart_contents; 2299 } 2300 2301 $index = 0; 2327 } catch (TypeError $e) { 2328 $sorted_cart_contents = $cart_contents; 2329 } catch (Throwable $e) { 2330 $sorted_cart_contents = $cart_contents; 2331 } 2332 2333 $index = 0; 2302 2334 $sort_order_changed = false; 2303 2335 -
printess-editor/trunk/readme.txt
r3364022 r3364556 335 335 - Fixed parsing of serialized json configuration for merge templates in case a json string was provided as merge template name 336 336 - Fixed css for saving overlay thats displayed during saving a design to the customer account. 337 338 = 1.6.64 = 339 - Fixed improper handling of cart item sorting for some users that have cart items that are not printess cart items and have object type cart items instead of array type cart items
Note: See TracChangeset
for help on using the changeset viewer.