Changeset 2406712
- Timestamp:
- 10/26/2020 11:41:31 AM (5 years ago)
- Location:
- avecdo-for-woocommerce
- Files:
-
- 8 edited
- 1 copied
-
tags/1.4.12 (copied) (copied from avecdo-for-woocommerce/trunk)
-
tags/1.4.12/avecdo.php (modified) (3 diffs)
-
tags/1.4.12/models/Model.php (modified) (2 diffs)
-
tags/1.4.12/models/WooQueries.php (modified) (3 diffs)
-
tags/1.4.12/readme.txt (modified) (2 diffs)
-
trunk/avecdo.php (modified) (3 diffs)
-
trunk/models/Model.php (modified) (2 diffs)
-
trunk/models/WooQueries.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
avecdo-for-woocommerce/tags/1.4.12/avecdo.php
r2365645 r2406712 4 4 * Plugin URI: https://avecdo.com/ 5 5 * Description: avecdo connector plugin for WooCommerce 6 * Version: 1.4.1 16 * Version: 1.4.12 7 7 * Author: Modified Solutions ApS 8 8 * Author URI: https://www.modified.dk/ … … 10 10 * Developer URI: https://www.modified.dk/ 11 11 * Requires at least: 3.5 12 * Tested up to: 5.5. 012 * Tested up to: 5.5.1 13 13 * WC requires at least: 2.5.0 14 * WC tested up to: 4. 2.014 * WC tested up to: 4.6.0 15 15 * 16 16 * Text Domain: avecdo-for-woocommerce … … 31 31 * @var string Version string 32 32 */ 33 define('AVECDO_WOOCOMMERCE_PLUGIN_VERSION', '1.4.1 1');33 define('AVECDO_WOOCOMMERCE_PLUGIN_VERSION', '1.4.12'); 34 34 35 35 /** -
avecdo-for-woocommerce/tags/1.4.12/models/Model.php
r2365645 r2406712 392 392 // starts with 'attribute_' 393 393 $this->assignAvecdoProductMetaData_Attribute($metaRow, $avecdoProduct); 394 395 // Set the Discount Rule sale price if any. 396 $this->setDiscountRuleSalePrice($productId, $avecdoProduct); 394 397 break; 395 398 } … … 1242 1245 // If the shippingId is sat to 0, then we will use global costs, else we add the shipping price, with the class price. 1243 1246 if($shippingId == 0) { 1244 $rate = (float)$shipping_method->instance_settings["cost"] + (float)$shipping_method->instance_settings["no_class_cost"]; 1247 if(isset($shipping_method->instance_settings["no_class_cost"])){ 1248 $rate = (float)$shipping_method->instance_settings["cost"] + (float)$shipping_method->instance_settings["no_class_cost"]; 1249 } else { 1250 $rate = (float)$shipping_method->instance_settings["cost"]; 1251 } 1245 1252 } else { 1246 1253 $rate = (float)$shipping_method->instance_settings["cost"] + (float)$shipping_method->instance_settings["class_cost_".$shippingId]; -
avecdo-for-woocommerce/tags/1.4.12/models/WooQueries.php
r2081150 r2406712 2 2 3 3 namespace Avecdo; 4 5 use AvecdoSDK\POPO\Product; 4 6 5 7 if (!defined('ABSPATH')) { … … 468 470 protected function getSalePrice($productId) 469 471 { 472 $discountRulesPrice = $this->getDiscountRulesSalePrice($productId); 473 if (!empty($discountRulesPrice)) { 474 return $discountRulesPrice; 475 } 476 470 477 $query = " 471 478 SELECT … … 534 541 return $GLOBALS['woocommerce']; 535 542 } 543 544 // Check if the Discount Rules plugin is enabled. 545 // https://wordpress.org/plugins/woo-discount-rules 546 public function isDiscountRulesEnabled() 547 { 548 if ( ! function_exists( 'is_plugin_active' ) ) 549 require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 550 551 return \is_plugin_active('woo-discount-rules/woo-discount-rules.php'); 552 } 553 554 /** 555 * @param $productId 556 * @author Kasper Færch Mikkelsen <kasper@modified.dk> 557 * @date 13/10/20 558 * 559 * Check if Discount Rules plugin is active, and then get the sale price for the selected product. 560 */ 561 public function getDiscountRulesSalePrice($productId) 562 { 563 if ($this->isDiscountRulesEnabled()) { 564 $product = wc_get_product($productId); 565 566 $discount = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', (float)$product->get_price(), $product, 1, 0, 'discounted_price', true, false); 567 if (!empty($discount)) { 568 return (float)$discount; 569 } 570 571 return $product->get_sale_price(); 572 } 573 574 return null; 575 } 576 577 // Set the sale price for a product to the value from the Discount Rules plugin. 578 public function setDiscountRuleSalePrice($productId, Product $avecdoProduct) 579 { 580 $avecdoProduct->setPriceSale($this->getDiscountRulesSalePrice($productId)); 581 } 536 582 } -
avecdo-for-woocommerce/tags/1.4.12/readme.txt
r2365645 r2406712 3 3 Tags: feed, service, avecdo, Facebook, Google Shopping, shopping, woocommerce, kelkoo, miinto, Pricerunner, Partner-ads, ecommerce, e-commerce 4 4 Requires at least: 3.5 5 Tested up to: 5.5. 06 Stable tag: 1.4.1 15 Tested up to: 5.5.1 6 Stable tag: 1.4.12 7 7 License: Mozilla Public License Version 2.0 8 8 License URI: https://www.mozilla.org/en-US/MPL/2.0/ … … 45 45 46 46 == Changelog == 47 48 = 1.4.12 = 49 * Support for version 2.x of the plugin 'Discount Rules for WooCommerce'. 50 * Minor bug fix related to shipping prices. 51 * Tested with latest Wordpress and WooCommerce versions. 47 52 48 53 = 1.4.11 = -
avecdo-for-woocommerce/trunk/avecdo.php
r2365645 r2406712 4 4 * Plugin URI: https://avecdo.com/ 5 5 * Description: avecdo connector plugin for WooCommerce 6 * Version: 1.4.1 16 * Version: 1.4.12 7 7 * Author: Modified Solutions ApS 8 8 * Author URI: https://www.modified.dk/ … … 10 10 * Developer URI: https://www.modified.dk/ 11 11 * Requires at least: 3.5 12 * Tested up to: 5.5. 012 * Tested up to: 5.5.1 13 13 * WC requires at least: 2.5.0 14 * WC tested up to: 4. 2.014 * WC tested up to: 4.6.0 15 15 * 16 16 * Text Domain: avecdo-for-woocommerce … … 31 31 * @var string Version string 32 32 */ 33 define('AVECDO_WOOCOMMERCE_PLUGIN_VERSION', '1.4.1 1');33 define('AVECDO_WOOCOMMERCE_PLUGIN_VERSION', '1.4.12'); 34 34 35 35 /** -
avecdo-for-woocommerce/trunk/models/Model.php
r2365645 r2406712 392 392 // starts with 'attribute_' 393 393 $this->assignAvecdoProductMetaData_Attribute($metaRow, $avecdoProduct); 394 395 // Set the Discount Rule sale price if any. 396 $this->setDiscountRuleSalePrice($productId, $avecdoProduct); 394 397 break; 395 398 } … … 1242 1245 // If the shippingId is sat to 0, then we will use global costs, else we add the shipping price, with the class price. 1243 1246 if($shippingId == 0) { 1244 $rate = (float)$shipping_method->instance_settings["cost"] + (float)$shipping_method->instance_settings["no_class_cost"]; 1247 if(isset($shipping_method->instance_settings["no_class_cost"])){ 1248 $rate = (float)$shipping_method->instance_settings["cost"] + (float)$shipping_method->instance_settings["no_class_cost"]; 1249 } else { 1250 $rate = (float)$shipping_method->instance_settings["cost"]; 1251 } 1245 1252 } else { 1246 1253 $rate = (float)$shipping_method->instance_settings["cost"] + (float)$shipping_method->instance_settings["class_cost_".$shippingId]; -
avecdo-for-woocommerce/trunk/models/WooQueries.php
r2081150 r2406712 2 2 3 3 namespace Avecdo; 4 5 use AvecdoSDK\POPO\Product; 4 6 5 7 if (!defined('ABSPATH')) { … … 468 470 protected function getSalePrice($productId) 469 471 { 472 $discountRulesPrice = $this->getDiscountRulesSalePrice($productId); 473 if (!empty($discountRulesPrice)) { 474 return $discountRulesPrice; 475 } 476 470 477 $query = " 471 478 SELECT … … 534 541 return $GLOBALS['woocommerce']; 535 542 } 543 544 // Check if the Discount Rules plugin is enabled. 545 // https://wordpress.org/plugins/woo-discount-rules 546 public function isDiscountRulesEnabled() 547 { 548 if ( ! function_exists( 'is_plugin_active' ) ) 549 require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 550 551 return \is_plugin_active('woo-discount-rules/woo-discount-rules.php'); 552 } 553 554 /** 555 * @param $productId 556 * @author Kasper Færch Mikkelsen <kasper@modified.dk> 557 * @date 13/10/20 558 * 559 * Check if Discount Rules plugin is active, and then get the sale price for the selected product. 560 */ 561 public function getDiscountRulesSalePrice($productId) 562 { 563 if ($this->isDiscountRulesEnabled()) { 564 $product = wc_get_product($productId); 565 566 $discount = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', (float)$product->get_price(), $product, 1, 0, 'discounted_price', true, false); 567 if (!empty($discount)) { 568 return (float)$discount; 569 } 570 571 return $product->get_sale_price(); 572 } 573 574 return null; 575 } 576 577 // Set the sale price for a product to the value from the Discount Rules plugin. 578 public function setDiscountRuleSalePrice($productId, Product $avecdoProduct) 579 { 580 $avecdoProduct->setPriceSale($this->getDiscountRulesSalePrice($productId)); 581 } 536 582 } -
avecdo-for-woocommerce/trunk/readme.txt
r2365645 r2406712 3 3 Tags: feed, service, avecdo, Facebook, Google Shopping, shopping, woocommerce, kelkoo, miinto, Pricerunner, Partner-ads, ecommerce, e-commerce 4 4 Requires at least: 3.5 5 Tested up to: 5.5. 06 Stable tag: 1.4.1 15 Tested up to: 5.5.1 6 Stable tag: 1.4.12 7 7 License: Mozilla Public License Version 2.0 8 8 License URI: https://www.mozilla.org/en-US/MPL/2.0/ … … 45 45 46 46 == Changelog == 47 48 = 1.4.12 = 49 * Support for version 2.x of the plugin 'Discount Rules for WooCommerce'. 50 * Minor bug fix related to shipping prices. 51 * Tested with latest Wordpress and WooCommerce versions. 47 52 48 53 = 1.4.11 =
Note: See TracChangeset
for help on using the changeset viewer.