Skip to content

Commit

Permalink
Merge pull request #26 from wuunder/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
TimD90 authored Sep 19, 2019
2 parents 2851803 + 8780a42 commit 6706d1f
Show file tree
Hide file tree
Showing 21 changed files with 171 additions and 8,329 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.DS_Store
vendor
composer.lock
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).

## Un-released

## 2019-08-20
## Released

## [2.7.2](https://github.com/kabisa/wuunder-webshopplugin-woocommerce/tag/2.7.2) - 2019-09-19

### Fix

- Code styling and typo fixes
- Checkout validation parcelshop locator bugfixed [@timoj](https://github.com/timoj) [WWE-97](https://wuunder.atlassian.net/secure/RapidBoard.jspa?rapidView=6&projectKey=WWE&modal=detail&selectedIssue=WWE-97)
- Code styling [@timoj](https://github.com/timoj) [WWE-97](https://wuunder.atlassian.net/secure/RapidBoard.jspa?rapidView=6&projectKey=WWE&modal=detail&selectedIssue=WWE-97)

## Released
### Added

- Translations checkout text parcelshop locator text [WWE-97](https://wuunder.atlassian.net/secure/RapidBoard.jspa?rapidView=6&projectKey=WWE&modal=detail&selectedIssue=WWE-97)


## [2.7.0](https://github.com/kabisa/wuunder-webshopplugin-woocommerce/tag/2.7.0) - 2019-04-01

Expand Down
12 changes: 8 additions & 4 deletions assets/css/wuunder-checkout.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
.woocommerce-page form .form-row-quart,
.woocommerce form .form-row-quart-first,
.woocommerce-page form .form-row-quart-first {
float: left;
width: 22%;
overflow: visible;
float: left;
width: 22%;
overflow: visible;
}

.woocommerce-page form .form-row-quart-first,
.woocommerce form .form-row-quart-first {


}

.wuunder-hidden-checkout-field {
display: none;
}
11 changes: 8 additions & 3 deletions assets/js/parcelshop.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ var baseUrl;
var baseUrlApi;
var availableCarrierList;

function initParcelshopLocator(url, apiUrl, carrierList) {
var chooseParcelshopText;
var chosenParcelshopText;

function initParcelshopLocator(url, apiUrl, carrierList, chooseParcelshopTxt, chosenParcelshopTxt) {
baseUrl = url;
baseUrlApi = apiUrl;
availableCarrierList = carrierList;
chooseParcelshopText = chooseParcelshopTxt;
chosenParcelshopText = chosenParcelshopTxt;

if (parcelshopShippingMethodElem) {
parcelshopShippingMethodElem.onchange = _onShippingMethodChange;
Expand All @@ -24,7 +29,7 @@ function _onShippingMethodChange() {
if (parcelshopShippingMethodElem.checked) {
var container = document.createElement('tr');
container.className += "chooseParcelshop";
container.innerHTML = '<td></td><td><div id="parcelshopsSelectedContainer" onclick="_showParcelshopLocator()"><a href="#/" id="selectParcelshop">Klik hier om een parcelshop te kiezen</a></div></td>';
container.innerHTML = '<td></td><td><div id="parcelshopsSelectedContainer" onclick="_showParcelshopLocator()"><a href="#/" id="selectParcelshop">' + chooseParcelshopText + '</a></div></td>';
// window.parent.document.getElementsByClassName('shipping')[0].appendChild(container);
window.parent.document.getElementsByClassName('woocommerce-shipping-totals')[0].parentNode.insertBefore(container, window.parent.document.getElementsByClassName('woocommerce-shipping-totals shipping')[0].nextSibling);

Expand All @@ -44,7 +49,7 @@ function _printParcelshopAddress() {
}
var currentParcelshop = document.createElement('div');
currentParcelshop.className += 'parcelshopInfo';
currentParcelshop.innerHTML = '<br/><strong>Ophalen in parcelshop:</strong><br/>' + parcelshopAddress;
currentParcelshop.innerHTML = '<br/><strong>' + chosenParcelshopText + ':</strong><br/>' + parcelshopAddress;
window.parent.document.getElementById('parcelshopsSelectedContainer').appendChild(currentParcelshop);
window.parent.document.getElementById('parcelshop_country').value = rawParcelshopAddress.address.alpha2;
}
Expand Down
77 changes: 0 additions & 77 deletions composer.lock

This file was deleted.

20 changes: 13 additions & 7 deletions includes/checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@

add_action('wp_enqueue_scripts', 'wcwp_callback_for_setting_up_scripts');
// add_action('woocommerce_review_order_before_submit', 'parcelshop_html');
add_action('woocommerce_review_order_after_submit', 'parcelshop_html');
add_action('woocommerce_review_order_after_submit', 'wcwp_parcelshop_html');

function wcwp_callback_for_setting_up_scripts() {
if ( class_exists('WC_wuunder_parcelshop' ) ) {
$style_file = dirname ( plugin_dir_url( __FILE__ ) ) . '/assets/css/parcelshop.css';
$style_file_parcelshop_locator = dirname ( plugin_dir_url( __FILE__ ) ) . '/assets/css/parcelshop.css';
$style_file_checkout_fields = dirname ( plugin_dir_url( __FILE__ ) ) . '/assets/css/wuunder-checkout.css';
$google_api_key = get_option( 'wc_wuunder_google_maps_api_key' );
$script_file = '//maps.googleapis.com/maps/api/js?key=' . $google_api_key;
wp_register_style( 'wuunderCSS', $style_file );
wp_enqueue_style( 'wuunderCSS' );
wp_register_style( 'wuunderCSSParcelshopLocator', $style_file_parcelshop_locator );
wp_enqueue_style( 'wuunderCSSParcelshopLocator' );
wp_register_style( 'wuunderCSSCheckout', $style_file_checkout_fields );
wp_enqueue_style( 'wuunderCSSCheckout' );

wp_register_script( 'googleMapsJS', $script_file );
wp_enqueue_script( 'googleMapsJS' );
Expand All @@ -39,10 +42,13 @@ function wcwp_parcelshop_html()
$availableCarriers = implode(',', array_keys($defaultCarrierConfig));
}

$chooseParcelshopText = __('Click here to select a parcelshop', 'woocommerce-wuunder');
$chosenParcelshopText = __('Pickup in parcelshop', 'woocommerce-wuunder');

echo <<<EOT
<script type="text/javascript" data-cfasync="false" src="$pluginPathJS"></script>
<script type="text/javascript">
initParcelshopLocator("$baseWebshopUrl", "$baseApiUrl", "$availableCarriers");
initParcelshopLocator("$baseWebshopUrl", "$baseApiUrl", "$availableCarriers", "$chooseParcelshopText", "$chosenParcelshopText");
</script>
EOT;
}
Expand All @@ -53,14 +59,14 @@ function wcwp_add_parcelshop_id_field($checkout ) {
woocommerce_form_field('parcelshop_id', array(
'type' => 'text',
'class' => array(
'my-field-class form-row-wide'
'wuunder-hidden-checkout-field form-row-wide'
),
), $checkout->get_value( 'parcelshop_id' ) );

woocommerce_form_field('parcelshop_country', array(
'type' => 'text',
'class' => array(
'my-field-class form-row-wide'
'wuunder-hidden-checkout-field form-row-wide'
),
), $checkout->get_value( 'parcelshop_country' ) );
}
Expand Down
2 changes: 1 addition & 1 deletion includes/wcwuunder-create.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct() {
$this->version_obj = array(
'product' => 'Woocommerce extension',
'version' => array(
'build' => '2.6.3',
'build' => '2.7.2',
'plugin' => '2.0' ),
'platform' => array(
'name' => 'Woocommerce',
Expand Down
7 changes: 6 additions & 1 deletion includes/wcwuunder-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ public function __construct() {
// Add setting tab "Reatiler" on woocommerce settings page
add_filter( 'woocommerce_settings_tabs_array', array( &$this, 'wcwp_add_settings_tab' ), 50 );
add_action( 'woocommerce_settings_tabs_wuunder', array( &$this, 'wcwp_settings_tab' ) );
add_action( 'woocommerce_update_options_wuunder', array(&$this, 'wcwp_update_settings' ) );
if ( version_compare( WC_VERSION, '3.7', '<' )) {
add_action('woocommerce_update_options_wuunder', array(&$this, 'wcwp_update_settings'));
}
}

public static function wcwp_save_action_for_update_settings() {
add_action( 'woocommerce_update_options_wuunder', array(WC_Wuunder_Settings::class,'wcwp_update_settings' ));
}

public static function wcwp_add_settings_tab($settings_tabs ) {
Expand Down
Binary file removed lang/nl_NL.mo
Binary file not shown.
Loading

0 comments on commit 6706d1f

Please sign in to comment.