Skip to content

Commit 7b745c9

Browse files
committed
To 1.2.1: various tidy-up tasks.
1 parent 62af3d7 commit 7b745c9

5 files changed

+70
-60
lines changed

classes/Academe_Multiple_Packages.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ public function __construct()
3838
);
3939

4040
// Extract some of the settings we will need.
41-
$this->enabled = !empty($settings['multi_packages_enabled']);
41+
$this->enabled = !empty($settings['enabled']);
4242

4343
$this->multi_packages_free_shipping =
44-
isset($settings['multi_packages_free_shipping'])
45-
? $settings['multi_packages_free_shipping']
44+
isset($settings['free_shipping'])
45+
? $settings['free_shipping']
4646
: '';
4747

4848
$this->multi_packages_type =
49-
isset($settings['multi_packages_type'])
50-
? $settings['multi_packages_type']
49+
isset($settings['type'])
50+
? $settings['type']
5151
: '';
5252

5353
$this->multi_packages_meta_field =
54-
isset($settings['multi_packages_meta_field'])
55-
? $settings['multi_packages_meta_field']
54+
isset($settings['meta_field'])
55+
? $settings['meta_field']
5656
: '';
5757

5858
$this->shipping_restrictions_classes =

classes/Academe_Multiple_Packages_Settings.php

+34-35
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public function __construct()
77
$this->id = 'academe_multiple_packages';
88

99
// Title shown in admin
10-
$this->method_title = __('Package Grouping');
10+
$this->method_title = __('Packages Grouping');
1111

1212
// Description shown in admin
1313
$this->method_description = __('Group products in an order into shipping packages');
@@ -92,73 +92,72 @@ function get_settings($current_section = '')
9292
$shipping_classes = $this->get_shipping_classes();
9393

9494
$settings = apply_filters('woocommerce_multi_packages_settings', array(
95-
'multi_packages_options' => array(
96-
'id' => 'multi_packages_options',
97-
'type' => 'title',
98-
'title' => __('Multiple Packages for Shipping', 'woocommerce'),
99-
'desc' => __('Separate your customer\'s shopping cart into groups or per product to display multiple shipping select boxes', 'woocommerce'),
100-
),
101-
102-
'multi_packages_enabled' => array(
103-
'id' => 'multi_packages_enabled',
95+
'enabled' => array(
10496
'type' => 'checkbox',
105-
'title' => __('Enable Package Grouping', 'bolder-multi-package-woo'),
97+
'title' => __('Enable Package Grouping', 'academe-package-config-woo'),
10698
'default' => 'yes',
107-
'desc' => __('Enable Multiple Shipping Packages', 'bolder-multi-package-woo'),
99+
'desc' => __('Enable Multiple Shipping Packages', 'academe-package-config-woo'),
100+
),
101+
102+
/*
103+
// The title is not used anywhere, as this is not a distinct shipping method.
104+
'title' => array(
105+
'title' => __('Method Title', 'academe-package-config-woo'),
106+
'type' => 'text',
107+
'description' => __('This controls the title which the user sees during checkout.', 'academe-package-config-woo'),
108+
'default' => __('Packages Grouping', 'academe-package-config-woo'),
109+
'desc_tip' => true
108110
),
111+
*/
109112

110-
'multi_packages_type' => array(
111-
'id' => 'multi_packages_type',
113+
'type' => array(
112114
'type' => 'select',
113-
'title' => __('Group By', 'bolder-multi-package-woo'),
114-
'desc' => __('How packages are defined, in groups or per product', 'bolder-multi-package-woo'),
115+
'title' => __('Group By', 'academe-package-config-woo'),
116+
'desc' => __('How packages are defined, in groups or per product', 'academe-package-config-woo'),
115117
'default' => 'shipping-class',
116118
'class' => 'chosen_select',
117119
'desc_tip' => true,
118120
'options' => array(
119-
'shipping-class' => __('Shipping Class', 'bolder-multi-package-woo'),
120-
'per-product' => __('Product (individual)', 'bolder-multi-package-woo'),
121-
'per-owner' => __('Product Owner (vendor)', 'bolder-multi-package-woo'),
122-
'product-meta' => __('Custom Product Field', 'bolder-multi-package-woo'),
123-
'product-meta_printtrail_package' => __('Printtrail Package Names', 'bolder-multi-package-woo'),
121+
'shipping-class' => __('Shipping Class', 'academe-package-config-woo'),
122+
'per-product' => __('Product (individual)', 'academe-package-config-woo'),
123+
'per-owner' => __('Product Owner (vendor)', 'academe-package-config-woo'),
124+
'product-meta' => __('Custom Product Field', 'academe-package-config-woo'),
125+
'product-meta_printtrail_package' => __('Printtrail Package Names', 'academe-package-config-woo'),
124126
),
125127
),
126128

127129
// TODO: validate and transform the value entered here.
128130
// It should be a valid metafield key. The documentation is
129131
// silent on what is "valid", but all examples seem to be
130132
// lower-case ASCII with underscores for spaces.
131-
'multi_packages_meta_field' => array(
132-
'id' => 'multi_packages_meta_field',
133+
'meta_field' => array(
133134
'type' => 'text',
134135
'class' => '',
135136
'css' => 'min-width:300px;',
136-
'title' => __('Custom Field to Group By', 'bolder-multi-package-woo'),
137-
'desc' => '<em>' . __('Custom product field key', 'bolder-multi-package-woo') . '</em>',
138-
'default' => __('', 'bolder-multi-package-woo'),
139-
'desc_tip' => __('The custom product meta field name (key) used to group the products into shipping packages.', 'bolder-multi-package-woo'),
137+
'title' => __('Custom Field to Group By', 'academe-package-config-woo'),
138+
'desc' => '<em>' . __('Custom product field key', 'academe-package-config-woo') . '</em>',
139+
'default' => __('', 'academe-package-config-woo'),
140+
'desc_tip' => __('The custom product meta field name (key) used to group the products into shipping packages.', 'academe-package-config-woo'),
140141
),
141142

142-
'multi_packages_free_shipping' => array(
143-
'id' => 'multi_packages_free_shipping',
143+
'free_shipping' => array(
144144
'type' => 'multiselect',
145145
'class' => 'chosen_select',
146-
'title' => __('Free Shipping Classes', 'bolder-multi-package-woo'),
147-
'desc' => '<em>' . __('\'Free_Shipping\' method must be enabled', 'bolder-multi-package-woo') . '</em>',
148-
'default' => __('Let me know when this item is back in stock!', 'bolder-multi-package-woo'),
149-
'desc_tip' => __('Exclude the selected shipping classes from being charged shipping', 'bolder-multi-package-woo'),
146+
'title' => __('Free Shipping Classes', 'academe-package-config-woo'),
147+
'desc' => '<em>' . __('\'Free_Shipping\' method must be enabled', 'academe-package-config-woo') . '</em>',
148+
'default' => __('Let me know when this item is back in stock!', 'academe-package-config-woo'),
149+
'desc_tip' => __('Exclude the selected shipping classes from being charged shipping', 'academe-package-config-woo'),
150150
'options' => $shipping_classes,
151151
),
152152

153-
'multi_packages_method_settings' => array(
153+
'method_settings' => array(
154154
'id' => 'multi_packages_method_settings',
155155
'type' => 'title',
156156
'title' => __('Shipping Method Restrictions When Grouping by Class', 'woocommerce'),
157157
'desc' => __('Select which shipping methods will be used for each shipping class package', 'woocommerce'),
158158
),
159159

160160
'shipping_restrictions_classes' => array(
161-
'id' => 'shipping_restrictions_classes',
162161
'type' => 'shipping_restrictions_classes',
163162
),
164163
));

multiple-packages-shipping.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22
/*
3-
Plugin Name: Multiple Packages Configuration for WooCommerce
3+
Plugin Name: Packages Configuration for WooCommerce
44
Plugin URI: https://github.com/academe/wc-multiple-packages
5-
Description: Configure product grouping for shipping packages for WooCommerce.
5+
Description: Configure how products are grouped into shipping packages for WooCommerce.
66
Author: Jason Judge [email protected]
77
Author: Erica Dion [email protected]
88
Author URI: https://github.com/judgej
99
Author URI: http://www.bolderelements.net/
10-
Version: 1.2.0
10+
Version: 1.2.1
1111
1212
Copyright: © 2014 Bolder Elements, © 2015 Academe Computing
1313
License: GPLv2 or later
@@ -67,6 +67,8 @@ function academe_wc_multiple_packages_init()
6767

6868
/**
6969
* Add the shipping method to the WC list of methods.
70+
* It is not strictly a shipping method itself, but a tool for grouping other
71+
* shipping methods.
7072
*/
7173
function academe_add_wc_multiple_packages($methods)
7274
{

readme.txt

+17-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link:
44
Tags: woocommerce, shipping, packages
55
Requires at least: 3.8
66
Tested up to: 4.2.2
7-
Stable tag: 1.2.0
7+
Stable tag: 1.2.1
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -29,15 +29,23 @@ This plugin is designed as a simplistic UI for users who want to ship their cart
2929
The actual functionality of multiple shipping options is provided through WooCommerce 2.1+ but it has no
3030
GUI out-of-the-box.
3131

32+
The project is maintained on github, and issues are tracked there:
33+
34+
<https://github.com/academe/wc-multiple-packages>
35+
36+
The plugin can be downloaded from wordpress.org here:
37+
38+
<https://wordpress.org/plugins/packages-configuration-for-woocommerce/>
39+
3240
== Installation ==
3341

34-
<h4>Minimum Requirements</h4>
42+
= Minimum Requirements =
3543

3644
* WooCommerce 2.1 or greater
3745
* WordPress 3.8 or greater
3846
* PHP version 5.3 or greater
3947

40-
<h4>Installation through FTP</h4>
48+
= Installation through FTP =
4149

4250
1. Upload the entire `wc-multiple-packages` folder to the `wp-content/plugins/` directory
4351
1. Activate the plugin through the 'Plugins' menu in WordPress
@@ -59,14 +67,15 @@ meta fields for the shipping lines.
5967

6068
== Screenshots ==
6169

62-
1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
63-
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
64-
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
65-
(or jpg, jpeg, gif).
66-
2. This is the second screen shot
70+
TBC
6771

6872
== Changelog ==
6973

74+
= 1.2.1 =
75+
* Change of name for consistency with wordpress.org slug.
76+
* Added link to github project page.
77+
* Added experimental composer.json file.
78+
7079
= 1.2.0 =
7180
* Issue #1: change order line shipping link fields to hidden fields.
7281

views/shipping_class_method_restrictions.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<style>
22
#shipping_package_restrictions_classes .restriction_rows th, #shipping_package_restrictions_classes .restriction_rows td {text-align: center;}
3-
#shipping_package_restrictions_classes .class_name {font-weight: bold;text-align: left;}
3+
#shipping_package_restrictions_classes .class_name {font-weight: bold; text-align: left;}
44
</style>
55

66
<table>
77
<tr valign="top" id="shipping_package_restrictions_classes">
88
<th scope="row" class="titledesc">
9-
<?php _e('Shipping Methods', 'bolder-multi-package-woo'); ?>
10-
<a class="tips" data-tip="<?php _e('If separating by shipping class, select which shipping methods to use for each class','bolder-multi-package-woo'); ?>">[?]</a>
9+
<?php _e('Shipping Methods', 'academe-package-config-woo'); ?>
10+
<a class="tips" data-tip="<?php _e('If separating by shipping class, select which shipping methods to use for each class','academe-package-config-woo'); ?>">[?]</a>
1111
</th>
1212
<td class="forminp" id="<?php echo $this->id; ?>_restrictions_classes">
13-
<table class="restriction_rows widefat" style="width: 60%;min-width:550px;" cellspacing="0">
13+
<table class="restriction_rows widefat" style="width: 60%; min-width:550px;" cellspacing="0">
1414
<thead>
1515
<tr>
1616
<th>&nbsp;</th>
1717
<?php foreach ($shipping_methods as $key => $method) : ?>
18-
<th><?php _e( $method->get_title(), 'bolder-multi-package-woo' ); ?></th>
18+
<th><?php _e( $method->get_title(), 'academe-package-config-woo' ); ?></th>
1919
<?php endforeach; ?>
2020
</tr>
2121
</thead>
2222

2323
<tfoot>
2424
<tr>
25-
<td colspan="<?php echo $total_shipping_methods; ?>"><em><?php _e('If left blank, all active shipping methods will be used for each shipping class', 'bolder-multi-package-woo');?> </em></td>
25+
<td colspan="<?php echo $total_shipping_methods; ?>"><em><?php _e('If left blank, all active shipping methods will be used for each shipping class', 'academe-package-config-woo');?> </em></td>
2626
</tr>
2727
</tfoot>
2828

@@ -42,7 +42,7 @@
4242
<?php
4343
endforeach;
4444
else :
45-
echo '<tr colspan="'.$total_shipping_methods.'">' . _e( 'No shipping classes have been created yet...', 'bolder-multi-package-woo' ) . '</tr>';
45+
echo '<tr colspan="'.$total_shipping_methods.'">' . _e( 'No shipping classes have been created yet...', 'academe-package-config-woo' ) . '</tr>';
4646
endif;
4747
?>
4848
</tbody>

0 commit comments

Comments
 (0)