diff --git a/Makefile b/Makefile index 8b1254e6bdfcc8e86e01c198816e0212669dd9bf..ea839e0a72f2a71d23282194358ec61f60df46cf 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -BASE=shippingbyrules +BASE=shipping-by-rules PLATTFORM=woocommerce VENDOR=opentools VERSION=1.0 @@ -6,8 +6,8 @@ DIR = $(shell pwd) SVNDIR=wordpress-plugin-svn BUILDDIR=.build/ -BASICBUILDDIR=$(VENDOR)-$(PLATTFORM)-$(BASE)-basic -ADVBUILDDIR=$(VENDOR)-$(PLATTFORM)-$(BASE)-advanced +BASICBUILDDIR=$(PLATTFORM)-$(BASE) +ADVBUILDDIR=$(PLATTFORM)-advanced-$(BASE) PLUGINFILES=library assets includes LICENSE.txt BASICPLUGINFILES=woocommerce-shipping-by-rules.php readme.txt @@ -15,8 +15,8 @@ ADVPLUGINFILES=woocommerce-advanced-shipping-by-rules.php readme-adv.txt opentoo TRANSLATIONS= -ZIPFILE=$(VENDOR)-$(PLATTFORM)-$(BASE)-basic_v$(VERSION).zip -ADVZIPFILE=$(VENDOR)-$(PLATTFORM)-$(BASE)-advanced_v$(VERSION).zip +ZIPFILE=$(VENDOR)-$(PLATTFORM)-$(BASE)_v$(VERSION).zip +ADVZIPFILE=$(VENDOR)-$(PLATTFORM)-advanced-$(BASE)_v$(VERSION).zip all: zip @@ -28,7 +28,7 @@ zip: $(PLUGINFILES) $(ADVPLUGINFILES) $(BASICPLUGINFILES) $(TRANSLATIONS) cd $(BUILDDIR) && zip -r $(DIR)/$(ZIPFILE) $(BASICBUILDDIR) # @zip -r mkdir -p $(BUILDDIR)/$(ADVBUILDDIR) - echo `pwd`mak + echo `pwd` cp --parents -r $(PLUGINFILES) $(ADVPLUGINFILES) $(TRANSLATIONS) $(BUILDDIR)/$(ADVBUILDDIR) cp readme-adv.txt $(BUILDDIR)/$(ADVBUILDDIR)/readme.txt cd $(BUILDDIR) && zip -r $(DIR)/$(ADVZIPFILE) $(ADVBUILDDIR) diff --git a/includes/admin/html/html-upgrade-nag.php b/includes/admin/html/html-upgrade-nag.php new file mode 100644 index 0000000000000000000000000000000000000000..c557306a0f2909076ef7cf927ebeac60a9f59875 --- /dev/null +++ b/includes/admin/html/html-upgrade-nag.php @@ -0,0 +1,28 @@ +<?php + +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +?> + <div id="opentools-shippingbyrules-upgrade" class="rules_shipping rules_shipping_upgrade rules_shipping_meta_box rules_shipping_settings_meta_box postbox"> + <?php if (isset($settings['title'])) { ?><h3><?php echo esc_html($settings['title']); ?></h3><?php } ?> + <div class="contents"> + <div class="logoleft"><a href="<?php echo esc_html($settings['link']); ?>"><img src="<?php echo plugins_url('../../../assets/images/advlogo100.png', __FILE__); ?>"></a></div> + <!--p>Advanced features not included in the free plugin include:</p--> + <ul> + <li><b>Mathematical expressions</b>: shipping costs calculated from mathematical expressions (depending on weight, dimensions, amount, etc.): + <ul style="font-size: smaller"> + <li>Shipping costs per kg</li> + <li>Percentage shipping cost on the amount, etc.</li> + </ul> + <li><b>List functions</b>: conditions on certain products, categories, tags or shipping classes</li> + <li><b>Conditions for product subsets</b>: Conditions and shipping costs depending on values evaluated only for particular products, categories, tags or shipping classes + <li><b>Alphanumeric Postcodes</b>: Conditions on UK and Canadian postcodes</li> + <li><b>Coupon Codes</b>: conditions on coupon codes</li> + <li>...</li> + </ul> + <p>More information and purchase: <a class="button-primary" href="<?php echo esc_html($settings['link']); ?>" target="_blank">Get Support and advanced features</a></p> + </div> + </div> +<?php diff --git a/includes/admin/settings/meta-box-help.php b/includes/admin/settings/meta-box-help.php index d865cb335a87b8b2d5a27a87cff088f9945d7b37..80e53fad133fdee890c283cd06460f1e559259a4 100644 --- a/includes/admin/settings/meta-box-help.php +++ b/includes/admin/settings/meta-box-help.php @@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?><div class='rules_shipping rules_shipping_help rules_shipping_meta_box rules_shipping_help_meta_box'> - <p>See also the the <a href='http://open-tools.net/documentation/shipping-by-rules-plugins-for-virtuemart.html'>Plugin's documentation</a> and <a href='http://open-tools.net/component/content/article.html?id=46'>Rules Examples</a>.</p> + <p>See also the the <a href='http://open-tools.net/documentation/advanced-shipping-by-rules-for-woocommerce.html'>Plugin's documentation</a> and <a href='http://open-tools.net/documentation/shipping-by-rules-plugins-for-virtuemart/rules-examples.html'>Rules Examples</a>.</p> <ul class='otsr_list'> <li>One rule per line, rule parts separated by Semicolon (;)</li> <li>Rules are evaluated sequentially, first matching rule is offered</li> diff --git a/includes/rules_shipping_framework_woocommerce.php b/includes/rules_shipping_framework_woocommerce.php index 678fafb8d9db760818b45572849b34255672ac1f..79ea7b8b1d9ef33d82b97d46328ec82fd0160ca1 100644 --- a/includes/rules_shipping_framework_woocommerce.php +++ b/includes/rules_shipping_framework_woocommerce.php @@ -11,26 +11,6 @@ if ( !defined( 'ABSPATH' ) ) { } require_once( plugin_dir_path( __FILE__ ) . '/../library/rules_shipping_framework.php'); -/** - * Throw debugging output into Debug My Plugin (3rd party plugin) - * - * @param string $panel the panel name, default is 'main' - * @param string $type the type 'pr' or 'msg' - * @param string $hdr the message header - * @param mixed $msg the variable to dump ('pr') or print ('msg') - * @param string $file __FILE__ from calling location - * @param string $line __LINE__ from calling location - * @return null - */ -function render_ToDebugBar($hdr,$msg,$file=null,$line=null) { - if (!isset($GLOBALS['DebugMyPlugin'])) { return; } - if (is_string($msg)) { - $GLOBALS['DebugMyPlugin']->panels['main']->addMessage($hdr,$msg,$file,$line); - } else { - $GLOBALS['DebugMyPlugin']->panels['main']->addPR($hdr,$msg,$file,$line); - } -} - class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { protected static $_method_ordering = 'woocommerce_shipping_rules_ordering'; @@ -349,28 +329,7 @@ class RulesShippingFrameworkWooCommerce extends RulesShippingFramework { } public function printUpgradeNagBox($settings) { - ?> - <div id="opentools-shippingbyrules-upgrade" class="rules_shipping rules_shipping_upgrade rules_shipping_meta_box rules_shipping_settings_meta_box postbox"> - <?php if (isset($settings['title'])) { ?><h3><?php echo esc_html($settings['title']); ?></h3><? } ?> - <div class="contents"> - <div class="logoleft"><a href="<?php echo esc_html($settings['link']); ?>"><img src="<?php echo plugins_url('../assets/images/advlogo100.png', __FILE__); ?>"></a></div> - <!--p>Advanced features not included in the free plugin include:</p--> - <ul> - <li><b>Mathematical expressions</b>: shipping costs calculated from mathematical expressions (depending on weight, dimensions, amount, etc.): - <ul style="font-size: smaller"> - <li>Shipping costs per kg</li> - <li>Percentage shipping cost on the amount, etc.</li> - </ul> - <li><b>List functions</b>: conditions on certain products, categories, tags or shipping classes</li> - <li><b>Conditions for product subsets</b>: Conditions and shipping costs depending on values evaluated only for particular products, categories, tags or shipping classes - <li><b>Alphanumeric Postcodes</b>: Conditions on UK and Canadian postcodes</li> - <li><b>Coupon Codes</b>: conditions on coupon codes</li> - <li>...</li> - </ul> - <p>More information and purchase: <a class="button-primary" href="<?php echo esc_html($settings['link']); ?>" target="_blank">Get Support and advanced features</a></p> - </div> - </div> - <?php + include plugin_dir_path( __FILE__ ) . 'admin/html/html-upgrade-nag.php'; } diff --git a/readme.txt b/readme.txt index b86311fe03facc3e0f56c7fa472ffe40a61b67d4..001705850aa2052f0f843f08aab55e88591ba263 100644 --- a/readme.txt +++ b/readme.txt @@ -1,6 +1,6 @@ -=== WooCommerce Shipping by Rules === +=== Shipping by Rules for WooCommerce === Contributors: opentools -Tags: WooCommerce, Shipment, Shipping +Tags: WooCommerce, Shipment, Shipping, Rules shipping Requires at least: 4.0 Tested up to: 4.4.1 Stable tag: 1.0 @@ -37,7 +37,7 @@ This set of rules describes three shipping costs: Orders of 100€ and more are * The plugin does NOT sum the results of all rules, but uses the FIRST matching rule it finds. * The plugin does NOT use the lowest result of all rules, but it uses the FIRST matching rule it finds. (In particular, if you want to provide free shipping under certain conditions, you usually need to place the rule for free shipping FIRST rather than last, because the last rule will only be used if none of the other rules matches). -For the full documentation of both the basic and the advanced ordernumbers plugin for WooCommerce, see: +For the full documentation of the Shipping by Rules plugin for WooCommerce see: http://open-tools.net/documentation/advanced-shipping-by-rules-for-woocommerce.html @@ -54,9 +54,9 @@ http://open-tools.net/documentation/advanced-shipping-by-rules-for-woocommerce.h == Frequently Asked Questions == -= What about invoice numbers? = += Where can I get further rule examples or help? = -The Advanced Ordernumbers for WooCommerce plugin supports some invoicing plugins. This functionality is not available in the free version, though. +Please see our support forum at http://open-tools.net/forum/. It might also be a good idea to check the support forum of the Shipping by Rules plugin for VirtueMart. The basic concepts of these plugins are identical, so most solutions for VirtueMart will also work in the WooCommerce shipping plugin. == Screenshots == diff --git a/releases/opentools-woocommerce-advanced-shipping-by-rules_v1.0.zip b/releases/opentools-woocommerce-advanced-shipping-by-rules_v1.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..3822984604161188638a3cd93ac2dc2cc86beb22 Binary files /dev/null and b/releases/opentools-woocommerce-advanced-shipping-by-rules_v1.0.zip differ diff --git a/releases/opentools-woocommerce-shipping-by-rules_v1.0.zip b/releases/opentools-woocommerce-shipping-by-rules_v1.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..6fd7ba4f6c3e9898f39b4f2212e71d6f1077befa Binary files /dev/null and b/releases/opentools-woocommerce-shipping-by-rules_v1.0.zip differ diff --git a/woocommerce-advanced-shipping-by-rules.php b/woocommerce-advanced-shipping-by-rules.php index 35314ec1fffdcb5a1d94241a969676975c204103..1289b65379a355244de5b6f5c69c094361b71617 100644 --- a/woocommerce-advanced-shipping-by-rules.php +++ b/woocommerce-advanced-shipping-by-rules.php @@ -147,7 +147,9 @@ class WooCommerce_Shipping_By_Rules_Advanced { $this->helper = RulesShippingFrameworkWooCommerceAdvanced::getHelper(); // Shipping method post type definition: - require_once plugin_dir_path( __FILE__ ) . 'includes/rules-shipping-post-type.php'; + if (!class_exists("Shipping_Rules_post_type")) { + require_once plugin_dir_path( __FILE__ ) . 'includes/rules-shipping-post-type.php'; + } $this->post_type = new Shipping_Rules_post_type($this->helper); // Links to docs and config in the plugin page @@ -242,7 +244,9 @@ class WooCommerce_Shipping_By_Rules_Advanced { * @since 1.0.0 */ public function shipping_by_rules_init() { - require_once plugin_dir_path( __FILE__ ) . 'includes/rules-shipping-method.php'; + if (!class_exists('Shipping_by_Rules')) { + require_once plugin_dir_path( __FILE__ ) . 'includes/rules-shipping-method.php'; + } $this->rule_shipping_method = new Shipping_by_Rules(); $this->rule_shipping_method->setHelper($this->helper); } diff --git a/woocommerce-shipping-by-rules.php b/woocommerce-shipping-by-rules.php index 04a91e5ebc190b26d33cccb727e1fa3044d2a5c3..a86c09965804582e31150c47c7684dd86c7ce65b 100644 --- a/woocommerce-shipping-by-rules.php +++ b/woocommerce-shipping-by-rules.php @@ -119,7 +119,9 @@ class WooCommerce_Shipping_By_Rules { $this->helper = RulesShippingFrameworkWooCommerce::getHelper(); // Shipping method post type definition: - require_once plugin_dir_path( __FILE__ ) . 'includes/rules-shipping-post-type.php'; + if (!class_exists("Shipping_Rules_post_type")) { + require_once plugin_dir_path( __FILE__ ) . 'includes/rules-shipping-post-type.php'; + } $this->post_type = new Shipping_Rules_post_type($this->helper); // Links to docs and config in the plugin page @@ -218,7 +220,9 @@ class WooCommerce_Shipping_By_Rules { * @since 1.0.0 */ public function shipping_by_rules_init() { - require_once plugin_dir_path( __FILE__ ) . 'includes/rules-shipping-method.php'; + if (!class_exists('Shipping_by_Rules')) { + require_once plugin_dir_path( __FILE__ ) . 'includes/rules-shipping-method.php'; + } $this->rule_shipping_method = new Shipping_by_Rules(); }