Skip to content

Commit

Permalink
Fixed minor pickup delivery display bugs. Prevent warning. Version bu…
Browse files Browse the repository at this point in the history
…mp 3.3.0.
  • Loading branch information
dennisnissle committed May 22, 2024
1 parent afcacb3 commit 3caae11
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 58 deletions.
96 changes: 52 additions & 44 deletions assets/css/pickup-locations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,71 @@
margin-right: 5px; padding: 0 3px;
}

.woocommerce form {
#current_pickup_location_field {
display: none;
}
.woocommerce-checkout, .woocommerce-account {
.woocommerce form {
#current_pickup_location_field {
display: none;
}

.pickup_location_notice {
margin-top: -.5rem;

.pickup_location_notice {
margin-top: -.5rem;
p {
margin: 0;
padding: 0;
}

p {
margin: 0;
padding: 0;
a.pickup-location-remove {
color: var(--wc-subtext);
font-size: 0.9em;
margin-top: 1rem;
}
}

a.pickup-location-remove {
color: var(--wc-subtext);
font-size: 0.9em;
margin-top: 1rem;
.wc-gzd-shipments-managed-by-pickup-location {
position: relative;
}
}

.wc-gzd-shipments-managed-by-pickup-location {
position: relative;
}
}
.wc-gzd-shipments-managed-by-pickup-location {
.woocommerce-input-wrapper {
input.input-text:read-only {
background-color: #eee;
}
}

.wc-gzd-shipments-managed-by-pickup-location {
select + .select2-container {
pointer-events: none;
touch-action: none;
select + .select2-container {
pointer-events: none;
touch-action: none;

.select2-selection {
background: #eee;
box-shadow: none;
}
.select2-selection {
background: #eee;
box-shadow: none;
}

.select2-selection__arrow,
.select2-selection__clear {
display: none;
.select2-selection__arrow,
.select2-selection__clear {
display: none;
}
}

select {
pointer-events: none;
touch-action: none;
}
}
}

select {
pointer-events: none;
touch-action: none;
.wc-gzd-shipments-managed-by-pickup-location-notice {
font-size: 0.7em;
color: var(--wc-subtext);
line-height: 1em;
position: absolute;
right: 0;
bottom: auto;
margin-top: -1.5rem;
}
}
}

.wc-gzd-shipments-managed-by-pickup-location-notice {
font-size: 0.7em;
color: var(--wc-subtext);
line-height: 1em;
position: absolute;
right: 0;
bottom: auto;
margin-top: -1.5rem;
}

body.wc-gzd-body-modal-active {
overflow: hidden;
}
Expand Down Expand Up @@ -190,5 +198,5 @@ body.wc-gzd-body-modal-active {
}

.wc-gzd-modal-background.active, .wc-gzd-modal-content.active {
display: block;
display: block !important;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "woocommerce-germanized-shipments",
"title": "Shipments for WooCommerce",
"version": "3.2.4",
"version": "3.3.0",
"homepage": "https://vendidero.de",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Package {
*
* @var string
*/
const VERSION = '3.2.4';
const VERSION = '3.3.0';

public static $upload_dir_suffix = '';

Expand Down
19 changes: 8 additions & 11 deletions src/PickupDelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function init() {

add_action( 'wp_enqueue_scripts', array( __CLASS__, 'register_assets' ), 100 );

add_action( 'woocommerce_after_edit_address_form_shipping', array( __CLASS__, 'register_customer_address_modal' ) );
add_action( 'woocommerce_after_edit_account_address_form', array( __CLASS__, 'register_customer_address_modal' ) );
add_action( 'woocommerce_after_save_address_validation', array( __CLASS__, 'register_customer_address_validation' ), 10, 4 );
add_filter( 'woocommerce_address_to_edit', array( __CLASS__, 'register_customer_address_fields' ), 10, 2 );

Expand Down Expand Up @@ -235,7 +235,7 @@ public static function pickup_location_search_modal( $context = 'checkout' ) {
?>
<div class="wc-gzd-modal-background"></div>

<div class="wc-gzd-modal-content" data-id="pickup-location">
<div class="wc-gzd-modal-content" data-id="pickup-location" style="display: none;">
<div class="wc-gzd-modal-content-inner">
<header>
<h4><?php echo esc_html_x( 'Choose a pickup location', 'shipments', 'woocommerce-germanized-shipments' ); ?></h4>
Expand Down Expand Up @@ -616,15 +616,12 @@ public static function register_order_review_fragments( $fragments ) {
}

$pickup_delivery_data = self::get_pickup_location_data( 'checkout', true );
$locations = array();

if ( ! empty( $pickup_delivery_data['locations'] ) ) {
$new_locations = array();

foreach ( $pickup_delivery_data['locations'] as $location ) {
$new_locations[ $location->get_code() ] = $location->get_data();
$locations[ $location->get_code() ] = $location->get_data();
}

$locations = $new_locations;
}

$fragments['.gzd-shipments-pickup-locations'] = wp_json_encode( $locations );
Expand Down Expand Up @@ -684,7 +681,7 @@ public static function search_pickup_locations() {
protected static function is_edit_address_page() {
global $wp;

return is_account_page() && isset( $wp->query_vars['edit-address'] ) && 'shipping' === $wp->query_vars['edit-address'];
return is_account_page() && isset( $wp->query_vars['edit-address'] );
}

public static function register_assets() {
Expand Down Expand Up @@ -985,9 +982,9 @@ public static function register_order_address_customer_number( $address, $addres
}

public static function formatted_shipping_replacements( $fields, $args ) {
if ( ! self::is_enabled() ) {
return $fields;
}
if ( ! self::is_enabled() ) {
return $fields;
}

if ( isset( $args['pickup_location_customer_number'] ) && ! empty( $args['pickup_location_customer_number'] ) ) {
$fields['{name}'] = $fields['{name}'] . "\n" . $args['pickup_location_customer_number'];
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-germanized-shipments.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: The Germanized Shipments integration, installed as a feature plugin for development and testing purposes.
* Author: vendidero
* Author URI: https://vendidero.de
* Version: 3.2.4
* Version: 3.3.0
* Requires PHP: 5.6
* License: GPLv3
*
Expand Down

0 comments on commit 3caae11

Please sign in to comment.