Changeset 3111836
- Timestamp:
- 07/03/2024 03:22:06 PM (21 months ago)
- Location:
- simpler-checkout
- Files:
-
- 18 edited
- 1 copied
-
tags/1.0.3 (copied) (copied from simpler-checkout/trunk)
-
tags/1.0.3/README.txt (modified) (2 diffs)
-
tags/1.0.3/includes/Services/CartHelper.php (modified) (1 diff)
-
tags/1.0.3/includes/button.php (modified) (3 diffs)
-
tags/1.0.3/includes/constants.php (modified) (1 diff)
-
tags/1.0.3/simpler.php (modified) (1 diff)
-
tags/1.0.3/vendor/autoload.php (modified) (1 diff)
-
tags/1.0.3/vendor/composer/autoload_real.php (modified) (3 diffs)
-
tags/1.0.3/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/1.0.3/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/includes/Services/CartHelper.php (modified) (1 diff)
-
trunk/includes/button.php (modified) (3 diffs)
-
trunk/includes/constants.php (modified) (1 diff)
-
trunk/simpler.php (modified) (1 diff)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (3 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simpler-checkout/tags/1.0.3/README.txt
r3108447 r3111836 5 5 Tested up to: 6.5 6 6 Requires PHP: 7.0 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 35 35 36 36 == Changelog == 37 38 == 1.0.3 39 Feat: handle bundle discounted products 37 40 38 41 == 1.0.2 -
simpler-checkout/tags/1.0.3/includes/Services/CartHelper.php
r3009471 r3111836 37 37 apply_filters('simplerwc_get_cart_item_data', [], $item) 38 38 ); 39 40 // Woo Product Bundles configured through Linked Products 41 foreach ($item->get_bundle_configuration() as $bundled) { 42 \WC()->cart->add_to_cart( 43 $bundled['product_id'], 44 $bundled['quantity'], 45 NULL, 46 $bundled['attributes'], 47 apply_filters('simplerwc_get_cart_item_data', ['bundle_sell_of' => $productAdded], $bundled) 48 ); 49 } 50 if (class_exists('\WC_PB_BS_Cart') && method_exists('\WC_PB_BS_Cart', 'load_bundle_sells_into_session')) { 51 \WC_PB_BS_Cart::load_bundle_sells_into_session(\WC()->cart); 52 } 39 53 } 40 54 -
simpler-checkout/tags/1.0.3/includes/button.php
r3099259 r3111836 240 240 241 241 // we'll bundle this in its container 242 if ( function_exists('wc_pb_is_bundled_cart_item') && \wc_pb_is_bundled_cart_item($cart_item)) {242 if (simplerwc_cart_item_is_bundled($cart_item)) { 243 243 continue; 244 244 } … … 251 251 array_push($ret['items'], simplerwc_get_cart_item_attributes($cart_item, $bundled_items)); 252 252 } else { 253 array_push($ret['items'], simplerwc_get_cart_item_attributes($cart_item)); 253 $bundled_items = []; 254 $cross_sell_items = $cart_item["bundle_sells"] ?? []; 255 foreach ($cross_sell_items as $id) { 256 $bundled_items[] = $cart->get_cart_item($id); 257 } 258 array_push($ret['items'], simplerwc_get_cart_item_attributes($cart_item, $bundled_items)); 254 259 } 255 260 } … … 337 342 return count(array_intersect($excludedRoles, $roles)) === 0; 338 343 } 344 345 function simplerwc_cart_item_is_bundled($item) 346 { 347 // check if is bundle product 348 if (function_exists('wc_pb_is_bundled_cart_item') && \wc_pb_is_bundled_cart_item($item)) { 349 return true; 350 } 351 352 if (array_key_exists('bundle_sell_of', $item)) { 353 return true; 354 } 355 356 return false; 357 } -
simpler-checkout/tags/1.0.3/includes/constants.php
r3108447 r3111836 1 1 <?php 2 2 3 const SIMPLERWC_VERSION = '1.0. 2';3 const SIMPLERWC_VERSION = '1.0.3'; 4 4 5 5 function simplerwc_get_sdk_uri() -
simpler-checkout/tags/1.0.3/simpler.php
r3108447 r3111836 8 8 * Description: Simpler Checkout lets your customers complete their purchases in seconds, with any payment method they want, in any device or browser and without a password. 9 9 * Tags: woocommerce, checkout, payments, conversion rate 10 * Version: 1.0. 210 * Version: 1.0.3 11 11 * Requires at least: 5.1 12 12 * Tested up to: 6.3.1 -
simpler-checkout/tags/1.0.3/vendor/autoload.php
r3108447 r3111836 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 33a782d480020f15a6bee803fbf8b475::getLoader();7 return ComposerAutoloaderInit8ccea03f492624d6b0f57bd68947a7e7::getLoader(); -
simpler-checkout/tags/1.0.3/vendor/composer/autoload_real.php
r3108447 r3111836 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 33a782d480020f15a6bee803fbf8b4755 class ComposerAutoloaderInit8ccea03f492624d6b0f57bd68947a7e7 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 33a782d480020f15a6bee803fbf8b475', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit8ccea03f492624d6b0f57bd68947a7e7', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 33a782d480020f15a6bee803fbf8b475', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit8ccea03f492624d6b0f57bd68947a7e7', 'loadClassLoader')); 30 30 31 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 33 33 require __DIR__ . '/autoload_static.php'; 34 34 35 call_user_func(\Composer\Autoload\ComposerStaticInit 33a782d480020f15a6bee803fbf8b475::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7::getInitializer($loader)); 36 36 } else { 37 37 $map = require __DIR__ . '/autoload_namespaces.php'; -
simpler-checkout/tags/1.0.3/vendor/composer/autoload_static.php
r3108447 r3111836 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 33a782d480020f15a6bee803fbf8b4757 class ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 85 85 { 86 86 return \Closure::bind(function () use ($loader) { 87 $loader->prefixLengthsPsr4 = ComposerStaticInit 33a782d480020f15a6bee803fbf8b475::$prefixLengthsPsr4;88 $loader->prefixDirsPsr4 = ComposerStaticInit 33a782d480020f15a6bee803fbf8b475::$prefixDirsPsr4;89 $loader->classMap = ComposerStaticInit 33a782d480020f15a6bee803fbf8b475::$classMap;87 $loader->prefixLengthsPsr4 = ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7::$prefixLengthsPsr4; 88 $loader->prefixDirsPsr4 = ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7::$prefixDirsPsr4; 89 $loader->classMap = ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7::$classMap; 90 90 91 91 }, null, ClassLoader::class); -
simpler-checkout/tags/1.0.3/vendor/composer/installed.php
r3108447 r3111836 1 1 <?php return array( 2 2 'root' => array( 3 'pretty_version' => '1.0. 2',4 'version' => '1.0. 2.0',3 'pretty_version' => '1.0.3', 4 'version' => '1.0.3.0', 5 5 'type' => 'wordpress-plugin', 6 6 'install_path' => __DIR__ . '/../../', 7 7 'aliases' => array(), 8 'reference' => ' 3d73f2f0fc565e737572f1acd880d8eef955432a',8 'reference' => '536e09bb7371b7c25e3f5971d47c33442459664e', 9 9 'name' => 'simpler-checkout/woo', 10 10 'dev' => false, … … 12 12 'versions' => array( 13 13 'simpler-checkout/woo' => array( 14 'pretty_version' => '1.0. 2',15 'version' => '1.0. 2.0',14 'pretty_version' => '1.0.3', 15 'version' => '1.0.3.0', 16 16 'type' => 'wordpress-plugin', 17 17 'install_path' => __DIR__ . '/../../', 18 18 'aliases' => array(), 19 'reference' => ' 3d73f2f0fc565e737572f1acd880d8eef955432a',19 'reference' => '536e09bb7371b7c25e3f5971d47c33442459664e', 20 20 'dev_requirement' => false, 21 21 ), -
simpler-checkout/trunk/README.txt
r3108447 r3111836 5 5 Tested up to: 6.5 6 6 Requires PHP: 7.0 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 35 35 36 36 == Changelog == 37 38 == 1.0.3 39 Feat: handle bundle discounted products 37 40 38 41 == 1.0.2 -
simpler-checkout/trunk/includes/Services/CartHelper.php
r3009471 r3111836 37 37 apply_filters('simplerwc_get_cart_item_data', [], $item) 38 38 ); 39 40 // Woo Product Bundles configured through Linked Products 41 foreach ($item->get_bundle_configuration() as $bundled) { 42 \WC()->cart->add_to_cart( 43 $bundled['product_id'], 44 $bundled['quantity'], 45 NULL, 46 $bundled['attributes'], 47 apply_filters('simplerwc_get_cart_item_data', ['bundle_sell_of' => $productAdded], $bundled) 48 ); 49 } 50 if (class_exists('\WC_PB_BS_Cart') && method_exists('\WC_PB_BS_Cart', 'load_bundle_sells_into_session')) { 51 \WC_PB_BS_Cart::load_bundle_sells_into_session(\WC()->cart); 52 } 39 53 } 40 54 -
simpler-checkout/trunk/includes/button.php
r3099259 r3111836 240 240 241 241 // we'll bundle this in its container 242 if ( function_exists('wc_pb_is_bundled_cart_item') && \wc_pb_is_bundled_cart_item($cart_item)) {242 if (simplerwc_cart_item_is_bundled($cart_item)) { 243 243 continue; 244 244 } … … 251 251 array_push($ret['items'], simplerwc_get_cart_item_attributes($cart_item, $bundled_items)); 252 252 } else { 253 array_push($ret['items'], simplerwc_get_cart_item_attributes($cart_item)); 253 $bundled_items = []; 254 $cross_sell_items = $cart_item["bundle_sells"] ?? []; 255 foreach ($cross_sell_items as $id) { 256 $bundled_items[] = $cart->get_cart_item($id); 257 } 258 array_push($ret['items'], simplerwc_get_cart_item_attributes($cart_item, $bundled_items)); 254 259 } 255 260 } … … 337 342 return count(array_intersect($excludedRoles, $roles)) === 0; 338 343 } 344 345 function simplerwc_cart_item_is_bundled($item) 346 { 347 // check if is bundle product 348 if (function_exists('wc_pb_is_bundled_cart_item') && \wc_pb_is_bundled_cart_item($item)) { 349 return true; 350 } 351 352 if (array_key_exists('bundle_sell_of', $item)) { 353 return true; 354 } 355 356 return false; 357 } -
simpler-checkout/trunk/includes/constants.php
r3108447 r3111836 1 1 <?php 2 2 3 const SIMPLERWC_VERSION = '1.0. 2';3 const SIMPLERWC_VERSION = '1.0.3'; 4 4 5 5 function simplerwc_get_sdk_uri() -
simpler-checkout/trunk/simpler.php
r3108447 r3111836 8 8 * Description: Simpler Checkout lets your customers complete their purchases in seconds, with any payment method they want, in any device or browser and without a password. 9 9 * Tags: woocommerce, checkout, payments, conversion rate 10 * Version: 1.0. 210 * Version: 1.0.3 11 11 * Requires at least: 5.1 12 12 * Tested up to: 6.3.1 -
simpler-checkout/trunk/vendor/autoload.php
r3108447 r3111836 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 33a782d480020f15a6bee803fbf8b475::getLoader();7 return ComposerAutoloaderInit8ccea03f492624d6b0f57bd68947a7e7::getLoader(); -
simpler-checkout/trunk/vendor/composer/autoload_real.php
r3108447 r3111836 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 33a782d480020f15a6bee803fbf8b4755 class ComposerAutoloaderInit8ccea03f492624d6b0f57bd68947a7e7 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 33a782d480020f15a6bee803fbf8b475', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit8ccea03f492624d6b0f57bd68947a7e7', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 33a782d480020f15a6bee803fbf8b475', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit8ccea03f492624d6b0f57bd68947a7e7', 'loadClassLoader')); 30 30 31 31 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 33 33 require __DIR__ . '/autoload_static.php'; 34 34 35 call_user_func(\Composer\Autoload\ComposerStaticInit 33a782d480020f15a6bee803fbf8b475::getInitializer($loader));35 call_user_func(\Composer\Autoload\ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7::getInitializer($loader)); 36 36 } else { 37 37 $map = require __DIR__ . '/autoload_namespaces.php'; -
simpler-checkout/trunk/vendor/composer/autoload_static.php
r3108447 r3111836 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 33a782d480020f15a6bee803fbf8b4757 class ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 85 85 { 86 86 return \Closure::bind(function () use ($loader) { 87 $loader->prefixLengthsPsr4 = ComposerStaticInit 33a782d480020f15a6bee803fbf8b475::$prefixLengthsPsr4;88 $loader->prefixDirsPsr4 = ComposerStaticInit 33a782d480020f15a6bee803fbf8b475::$prefixDirsPsr4;89 $loader->classMap = ComposerStaticInit 33a782d480020f15a6bee803fbf8b475::$classMap;87 $loader->prefixLengthsPsr4 = ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7::$prefixLengthsPsr4; 88 $loader->prefixDirsPsr4 = ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7::$prefixDirsPsr4; 89 $loader->classMap = ComposerStaticInit8ccea03f492624d6b0f57bd68947a7e7::$classMap; 90 90 91 91 }, null, ClassLoader::class); -
simpler-checkout/trunk/vendor/composer/installed.php
r3108447 r3111836 1 1 <?php return array( 2 2 'root' => array( 3 'pretty_version' => '1.0. 2',4 'version' => '1.0. 2.0',3 'pretty_version' => '1.0.3', 4 'version' => '1.0.3.0', 5 5 'type' => 'wordpress-plugin', 6 6 'install_path' => __DIR__ . '/../../', 7 7 'aliases' => array(), 8 'reference' => ' 3d73f2f0fc565e737572f1acd880d8eef955432a',8 'reference' => '536e09bb7371b7c25e3f5971d47c33442459664e', 9 9 'name' => 'simpler-checkout/woo', 10 10 'dev' => false, … … 12 12 'versions' => array( 13 13 'simpler-checkout/woo' => array( 14 'pretty_version' => '1.0. 2',15 'version' => '1.0. 2.0',14 'pretty_version' => '1.0.3', 15 'version' => '1.0.3.0', 16 16 'type' => 'wordpress-plugin', 17 17 'install_path' => __DIR__ . '/../../', 18 18 'aliases' => array(), 19 'reference' => ' 3d73f2f0fc565e737572f1acd880d8eef955432a',19 'reference' => '536e09bb7371b7c25e3f5971d47c33442459664e', 20 20 'dev_requirement' => false, 21 21 ),
Note: See TracChangeset
for help on using the changeset viewer.