Changeset 2975391
- Timestamp:
- 10/06/2023 03:30:45 AM (2 years ago)
- Location:
- bread-finance/trunk
- Files:
-
- 11 deleted
- 6 edited
-
README.md (modified) (2 diffs)
-
assets/css/bread.css (deleted)
-
assets/css/main.scss (deleted)
-
assets/css/rbc.css (deleted)
-
assets/js/v2/main.js (modified) (1 diff)
-
bin (deleted)
-
bread-finance.php (modified) (2 diffs)
-
classes/class-bread-finance-api-factory.php (deleted)
-
classes/class-bread-finance-options-category.php (modified) (2 diffs)
-
classes/class-bread-finance-options-product.php (modified) (5 diffs)
-
classes/class-bread-finance-plugin.php (modified) (1 diff)
-
composer.lock (deleted)
-
config (deleted)
-
package.json (deleted)
-
phpunit.xml.dist (deleted)
-
tests (deleted)
-
vendor (deleted)
Legend:
- Unmodified
- Added
- Removed
-
bread-finance/trunk/README.md
r2966824 r2975391 4 4 Requires at least: 4.9 5 5 Tested up to: 6.1.1 6 Stable tag: 3.3. 56 Stable tag: 3.3.6 7 7 Requires PHP: 5.6 8 8 WC requires at least: 3.0 … … 73 73 == Changelog == 74 74 75 = 3.3.6 76 * Current release 77 * Compatiblity with WooCommerce Composite Products and Product Bundles 78 75 79 = 3.3.5 76 * Current release77 80 * Added unit tests 78 81 * Added Embedded Checkout feature to display on same page instead of modal -
bread-finance/trunk/assets/js/v2/main.js
r2966782 r2975391 358 358 359 359 var self = this, 360 validators = {361 simple: function() {362 return true;363 },364 365 grouped: function () {366 return self.$form.find('input.qty').filter(function (index, element) {367 return parseInt(element.value)> 0;368 }).length > 0;369 },370 371 variable: function () {372 return self.variation !== undefined;373 },374 375 composite: function () {376 return (self.composite && self.composite.api.get_composite_validation_status() === 'pass');377 }378 };360 validators = { 361 simple: function() { 362 return true; 363 }, 364 grouped: function() { 365 return self.$form.find('input.qty').filter(function(index, element) { 366 return parseInt(element.value) > 0; 367 }).length > 0; 368 }, 369 variable: function() { 370 return self.variation !== undefined; 371 }, 372 composite: function() { 373 return (self.composite && self.composite.api.get_composite_validation_status() === 'pass'); 374 }, 375 bundle: function () { 376 return true; 377 }, 378 }; 379 379 380 380 if (!validators[breadController.local.product_type]) { -
bread-finance/trunk/bread-finance.php
r2966782 r2975391 6 6 * Author: Bread Pay 7 7 * Author URI: https://payments.breadfinancial.com/ 8 * Version: 3.3. 58 * Version: 3.3.6 9 9 * Text Domain: bread-finance 10 10 * Domain Path: /i18n/languages/ … … 22 22 23 23 //Require minimums and constants 24 define('WC_BREAD_FINANCE_VERSION', '3.3. 5');24 define('WC_BREAD_FINANCE_VERSION', '3.3.6'); 25 25 define('WC_BREAD_FINANCE_MIN_PHP_VER', '5.6.0'); 26 26 define('WC_BREAD_FINANCE_MIN_WC_VER', '3.4.0'); -
bread-finance/trunk/classes/class-bread-finance-options-category.php
r2966782 r2975391 98 98 case 'composite': 99 99 return $this->getItemsComposite($options, $config); 100 case 'bundle': 101 return $this->getItemsBundle($options, $config); 100 102 default: 101 103 return array(); … … 177 179 } 178 180 181 public function getItemsBundle(&$options, $config) { 182 183 /** @var \WC_Product_Bundle $product */ 184 $product = wc_get_product($config['productId']); 185 $bundlePrice = $product->get_bundle_price() ?: 0; 186 $productTotal = $product->get_price() ?: 0; 187 188 $options['allowCheckout'] = false; 189 $options['asLowAs'] = true; 190 $options['customTotal'] = $this->bread_finance_utilities->priceToCents($bundlePrice) ?: $this->bread_finance_utilities->priceToCents($productTotal); 191 192 return array(); 193 } 194 179 195 } -
bread-finance/trunk/classes/class-bread-finance-options-product.php
r2886136 r2975391 103 103 $productType = $config['productType']; 104 104 $customTotal = 0; 105 106 $product = wc_get_product($config['productId']); 105 107 106 108 //Simple products 107 109 if($productType === 'simple') { 108 $product = wc_get_product($config['productId']);109 110 110 111 if (!is_object($product)) { … … 120 121 //Variable products 121 122 if ($productType === 'variable') { 122 $product = wc_get_product($config['productId']);123 123 124 124 if (!is_object($product)) { … … 147 147 if($productType === 'grouped') { 148 148 $customTotal = 0; 149 $product = wc_get_product($config['productId']);150 149 151 150 if (!is_object($product)) { … … 175 174 176 175 if($productType === 'composite') { 177 $product = wc_get_product($config['productId']); 178 $item = $this->getItem($product, $quantity); 176 $item = $this->getItemForPlatform($product, $options['currency'], $quantity); 179 177 $compositePrice = $product->get_composite_price() ?: 0; 180 178 $item['unitPrice']['value'] = $this->bread_finance_utilities->priceToCents($compositePrice); … … 182 180 $customTotal = $item['unitPrice']['value']; 183 181 $options['customTotal'] = $customTotal; 182 } 183 184 if (class_exists('WC_Product_Bundle') && $productType === 'bundle') { 185 $item = $this->getItemForPlatform($product, $options['currency'], $quantity); 186 $bundlePrice = $product->get_bundle_price() ?: 0; 187 $item['unitPrice']['value'] = $this->bread_finance_utilities->priceToCents($bundlePrice); 188 $options['items'][] = $item; 189 $options['customTotal'] = $item['unitPrice']['value'] * $item['quantity']; 184 190 } 185 191 -
bread-finance/trunk/classes/class-bread-finance-plugin.php
r2726687 r2975391 27 27 * @var array Supported product-types 28 28 */ 29 public $supported_products = array('simple', 'grouped', 'variable', 'composite' );29 public $supported_products = array('simple', 'grouped', 'variable', 'composite', 'bundle'); 30 30 31 31 /**
Note: See TracChangeset
for help on using the changeset viewer.