Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 43 additions & 10 deletions assets/css/lengow-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -562,13 +562,13 @@ body.page-sidebar-closed .lengow-nav-bottom {
/* ACCORDION */
/*************************************************/

#marketplaceAccordion .accordion-header {
.marketplace-accordion .accordion-header {
background-color: #f7f7f7;
padding: 10px 15px;
cursor: pointer;
}

#marketplaceAccordion .accordion-button {
.marketplace-accordion .accordion-button {
background-color: transparent;
border: none;
font-size: 16px;
Expand All @@ -579,36 +579,69 @@ body.page-sidebar-closed .lengow-nav-bottom {
cursor: pointer;
}

#marketplaceAccordion .accordion-button:focus {
.marketplace-accordion .accordion-button:focus {
outline: none;
}

#marketplaceAccordion .accordion-button[aria-expanded="true"] {
.marketplace-accordion .accordion-button[aria-expanded="true"] {
color: #00aeef;
}

#marketplaceAccordion .accordion-button[aria-expanded="true"] .dashicons {
.marketplace-accordion .accordion-button[aria-expanded="true"] .dashicons {
transform: rotate(0.5turn);
transition: all 0.2s ease;
}

#marketplaceAccordion .accordion-button[aria-expanded="false"] .dashicons {
.marketplace-accordion .accordion-button[aria-expanded="false"] .dashicons {
transform: rotate(0turn);
transition: all 0.2s ease;
}

#marketplaceAccordion .accordion-collapse {
.marketplace-accordion .accordion-collapse {
display: none;
}

#marketplaceAccordion .accordion-body {
.marketplace-accordion .accordion-body {
padding: 15px;
}

#marketplaceAccordion .accordion-body h3 {
.marketplace-accordion .accordion-body h3 {
padding-top: 30px;
}

#marketplaceAccordion .accordion-collapse.show {
.marketplace-accordion .accordion-collapse.show {
display: block;
}

.tooltip-trigger {
display: inline-block;
margin-left: 5px;
cursor: pointer;
position: relative;
font-size: 30px;
color: #2e6592;
margin-top: -5px;
}

.tooltip-trigger::after {
content: attr(data-tooltip);
position: absolute;
left: 50%;
bottom: 100%;
transform: translateX(-50%);
background-color: #cdf1ff;
color: #2e6592;
padding: 5px 5px 10px;
border-radius: 3px;
opacity: 0;
visibility: hidden;
transition: opacity 0.2s;
white-space: normal;
font-size: 15px;
width: 600px;
}

.tooltip-trigger:hover::after {
opacity: 1;
visibility: visible;
}
131 changes: 92 additions & 39 deletions includes/admin/views/order-settings/html-admin-carrier-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ function lgw_print_carrier_options( array $carriers, ?string $selected = null, b
</div>
</div>
<div class="lgw-box">
<h2><?php echo esc_html( $locale->t( 'carrier_setting.screen.title' ) ); ?></h2>
<h2>
<?php echo esc_html( $locale->t( 'carrier_setting.screen.title' ) ); ?>
<span class="tooltip-trigger dashicons dashicons-editor-help" data-tooltip="<?php echo esc_attr( $locale->t( 'carrier_setting.screen.tooltip' ) ); ?>"></span>
</h2>
<p><?php echo esc_html( $locale->t( 'carrier_setting.screen.description' ) ); ?></p>
<span class="legend blue-frame" style="display:block;">
<?php echo esc_html( $locale->t( 'carrier_setting.screen.shipping_method_mapping_help' ) ); ?>
Expand All @@ -95,7 +98,7 @@ function lgw_print_carrier_options( array $carriers, ?string $selected = null, b
</span>
<br/>
<div class="form-group lengow_import_shipping_methods">
<div id="marketplaceAccordion">
<div class="marketplace-accordion">
<?php foreach ( $marketplaces as $marketplace_code => $marketplace ) : ?>
<div class="accordion-item">
<h2 class="accordion-header" id="heading<?php echo esc_attr( $marketplace_code ); ?>">
Expand All @@ -109,7 +112,7 @@ function lgw_print_carrier_options( array $carriers, ?string $selected = null, b
<?php /* DEFAULT WOOCOMMERCE SHIPPING METHOD */ ?>
<div class="form-group">
<label>
<?php echo esc_html( sprintf( $keys[ Lengow_Configuration::IMPORT_SHIPPING_METHODS ][ Lengow_Configuration::PARAM_LABEL ], $marketplace->name ) ); ?>
<?php echo esc_html( $keys[ Lengow_Configuration::IMPORT_SHIPPING_METHODS ][ Lengow_Configuration::PARAM_LABEL ] ); ?>
</label>
<select class="js-select lengow_select" name="<?php echo Lengow_Configuration::IMPORT_SHIPPING_METHODS; ?>[<?php echo esc_attr( $marketplace_code ); ?>][__default]">
<?php
Expand All @@ -122,26 +125,9 @@ function lgw_print_carrier_options( array $carriers, ?string $selected = null, b
</select>
</div>
<?php endif; ?>
<?php if (!empty((array)$marketplace->orders->carriers) && count((array)$marketplace->orders->carriers) !== 1 && count($shipping_methods) !== 1) : ?>
<?php // DEFAULT MARKETPLACE CARRIER ?>
<div class="form-group">
<label>
<?php echo esc_html( sprintf( $keys[ Lengow_Configuration::SHIPPING_METHOD_CARRIERS ][ Lengow_Configuration::PARAM_LABEL ], $marketplace->name ) ); ?>
</label>
<select class="js-select lengow_select" name="<?php echo Lengow_Configuration::SHIPPING_METHOD_CARRIERS; ?>[<?php echo esc_attr( $marketplace_code ); ?>][__default]">
<?php
lgw_print_carrier_options(
(array)$marketplace->orders->carriers,
$shipping_method_carriers[ $marketplace_code ]['__default'] ?? null,
true
);
?>
</select>
</div>
<?php endif;?>
<?php /* WOOCOMMERCE SHIPPING METHOD BY MARKETPLACE */ ?>
<?php if (count((array)$marketplace->orders->shipping_methods) > 0) : ?>
<h3><?php echo esc_html( sprintf( $locale->t( 'lengow_settings.lengow_import_shipping_methods_title' ), $marketplace->name ) ); ?></h3>
<h3><?php echo esc_html( $locale->t( 'lengow_settings.lengow_import_shipping_methods_title' ) ); ?></h3>
<?php foreach ( $marketplace->orders->shipping_methods as $shipping_code => $shipping_method ) : ?>
<div class="form-group">
<label>
Expand All @@ -159,26 +145,92 @@ function lgw_print_carrier_options( array $carriers, ?string $selected = null, b
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php /* MARKETPLACE CARRIER BY WOOCOMMERCE SHIPPING METHOD */ ?>
<?php if (count((array)$marketplace->orders->carriers) > 1) : ?>
<h3><?php echo esc_html( sprintf( $locale->t( 'lengow_settings.lengow_shipping_method_carriers_title' ), $marketplace->name ) ); ?></h3>
<?php foreach ( $shipping_methods as $shipping_code => $shipping_method ) : ?>
<div class="lengow_main_setting_block_content">
<div class="pull-left">
<button type="submit" class="lgw-btn lgw-btn-progression lengow_submit_main_setting">
<div class="btn-inner">
<div class="btn-step default">
<?php echo esc_html( $locale->t( 'global_setting.screen.button_save' ) ); ?>
</div>
<div class="btn-step loading">
<?php echo esc_html( $locale->t( 'global_setting.screen.setting_saving' ) ); ?>
</div>
<div class="btn-step done" data-success="Saved!" data-error="Error">
<?php echo esc_html( $locale->t( 'global_setting.screen.setting_saved' ) ); ?>
</div>
</div>
</button>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<?php
$carrier_marketplaces = array_filter( (array) $marketplaces, function ( $marketplace ) {
return count( (array) $marketplace->orders->carriers ) > 0;
} );
if (count($carrier_marketplaces)) :
?>
<div class="lgw-box">
<h2>
<?php echo esc_html( $locale->t( 'carrier_setting.screen.carrier_title' ) ); ?>
<span class="tooltip-trigger dashicons dashicons-editor-help" data-tooltip="<?php echo esc_attr( $locale->t( 'carrier_setting.screen.carrier_tooltip' ) ); ?>"></span>
</h2>
<p><?php echo esc_html( $locale->t( 'carrier_setting.screen.carrier_description' ) ); ?></p>
<br/>
<div class="form-group lengow_import_shipping_methods">
<div class="marketplace-accordion">
<?php foreach ( $carrier_marketplaces as $marketplace_code => $marketplace ) : ?>
<div class="accordion-item">
<h2 class="accordion-header" id="carrier_heading<?php echo esc_attr( $marketplace_code ); ?>">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#carrier_collapse<?php echo esc_attr( $marketplace_code ); ?>" aria-expanded="false" aria-controls="collapse<?php echo esc_attr( $marketplace_code ); ?>">
<span class="dashicons dashicons-arrow-down-alt2"></span> <?php echo esc_html( $marketplace->name ); ?>
</button>
</h2>
<div id="carrier_collapse<?php echo esc_attr( $marketplace_code ); ?>" class="accordion-collapse collapse" aria-labelledby="heading<?php echo esc_attr( $marketplace_code ); ?>" data-bs-parent="#marketplaceAccordion">
<div class="accordion-body">
<?php if (!empty((array)$marketplace->orders->carriers) && count((array)$marketplace->orders->carriers) !== 1 && count($shipping_methods) !== 1) : ?>
<?php // DEFAULT MARKETPLACE CARRIER ?>
<div class="form-group">
<label>
<?php echo esc_html( $keys[ Lengow_Configuration::SHIPPING_METHOD_CARRIERS ][ Lengow_Configuration::PARAM_LABEL ] ); ?>
</label>
<select class="js-select lengow_select" name="<?php echo Lengow_Configuration::SHIPPING_METHOD_CARRIERS; ?>[<?php echo esc_attr( $marketplace_code ); ?>][__default]">
<?php
lgw_print_carrier_options(
(array)$marketplace->orders->carriers,
$shipping_method_carriers[ $marketplace_code ]['__default'] ?? null,
true
);
?>
</select>
</div>
<?php endif;?>
<?php /* MARKETPLACE CARRIER BY WOOCOMMERCE SHIPPING METHOD */ ?>
<?php if (count((array)$marketplace->orders->carriers) > 1) : ?>
<h3><?php echo esc_html( $locale->t( 'lengow_settings.lengow_shipping_method_carriers_title' ) ); ?></h3>
<?php foreach ( $shipping_methods as $shipping_code => $shipping_method ) : ?>
<div class="form-group">
<label>
<?php echo esc_html( $shipping_method ); ?>
<?php echo esc_html( $shipping_method ); ?>
</label>
<select class="js-select lengow_select" name="<?php echo Lengow_Configuration::SHIPPING_METHOD_CARRIERS; ?>[<?php echo esc_attr( $marketplace_code ); ?>][<?php echo esc_attr( $shipping_code ); ?>]">
<?php
lgw_print_carrier_options(
(array)$marketplace->orders->carriers,
$shipping_method_carriers[ $marketplace_code ][ $shipping_code ] ?? null,
true
);
?>
<?php
lgw_print_carrier_options(
(array)$marketplace->orders->carriers,
$shipping_method_carriers[ $marketplace_code ][ $shipping_code ] ?? null,
true
);
?>
</select>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<div class="lengow_main_setting_block_content">
<div class="pull-left">
<button type="submit" class="lgw-btn lgw-btn-progression lengow_submit_main_setting">
Expand All @@ -198,12 +250,13 @@ function lgw_print_carrier_options( array $carriers, ?string $selected = null, b
<div class="clear"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
</form>
</div>
</div>
Expand Down
28 changes: 16 additions & 12 deletions translations/en_GB.csv
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,18 @@ order_setting.screen.anonymize_email|Anonymize customer's emails addresses
order_setting.screen.type_anonymize_email_label|Choose the type of anonymization
order_setting.screen.type_anonymize_email_encrypted|Encrypted, example: 1ec4a32af2ebee7db7ffa687e0271e39@lengow.com
order_setting.screen.type_anonymize_email_not_encrypted|Plaintext, example:123456789-amazon_fr@lengow.com
carrier_setting.screen.default_shipping_method_title|Manage shipping methods
carrier_setting.screen.default_shipping_method_description|Select a default shipping method to apply to your orders
carrier_setting.screen.shipping_method_mapping_help|The choice of the shipping method is made as follows:
carrier_setting.screen.shipping_method_mapping_help_1|If a method is defined for the marketplace shipping method, it will be used.
carrier_setting.screen.shipping_method_mapping_help_2|If a method is defined for the default marketplace shipping method, it will be used.
carrier_setting.screen.shipping_method_mapping_help_3|Otherwise, the default shipping method will be used.
carrier_setting.screen.title|Manage shipping methods by marketplace
carrier_setting.screen.description|Choose the different shipping methods to assign to each of your orders here. You can do this for the different marketplaces activated in your account.
carrier_setting.screen.default_shipping_method_title|Default shipping method definition
carrier_setting.screen.default_shipping_method_description|Select a default shipping method to apply to all your orders, regardless of the marketplace.
carrier_setting.screen.shipping_method_mapping_help|When an order is imported, the shipping method is applied in the following order:
carrier_setting.screen.shipping_method_mapping_help_1|Shipping methods defined by marketplace. If a match is defined, it is used as a priority.
carrier_setting.screen.shipping_method_mapping_help_2|Otherwise, the default shipping method of the marketplace is applied.
carrier_setting.screen.shipping_method_mapping_help_3|If no specific configuration exists, the default method for all orders is used.
carrier_setting.screen.title|Mapping of Delivery Methods by Marketplaces
carrier_setting.screen.tooltip|This step ensures the automatic assignment of the correct shipping method for each order imported into WooCommerce.
carrier_setting.screen.description|Map the delivery methods of the marketplaces to your own WooCommerce delivery methods.
carrier_setting.screen.carrier_title|Mapping of Carriers by Marketplaces
carrier_setting.screen.carrier_tooltip|When you ship an order in WooCommerce, the carrier must match the format expected by the marketplace to avoid any rejection.
carrier_setting.screen.carrier_description|Map your WooCommerce shipping methods to the carriers expected by the marketplaces
global_setting.screen.notification_alert_title|Notifications & alerts
global_setting.screen.security_title|Security
global_setting.screen.shop_title|Store management
Expand Down Expand Up @@ -360,10 +364,10 @@ lengow_settings.lengow_debug_enabled_title|Activate Debug Mode
lengow_settings.lengow_import_in_progress_title|Import in progress
lengow_settings.lengow_last_import_manual_title|Last manual import
lengow_settings.lengow_last_import_cron_title|Last Cron import
lengow_settings.lengow_import_shipping_methods_default_title|Default WooCommerce shipping method for %s
lengow_settings.lengow_shipping_method_carriers_default_title|Default carrier for %s
lengow_settings.lengow_import_shipping_methods_title|Map the %s shipping methods with your WooCommerce shipping methods
lengow_settings.lengow_shipping_method_carriers_title|Map your WooCommerce shipping methods with %s carriers
lengow_settings.lengow_import_shipping_methods_default_title|Default mapping of the shipping method
lengow_settings.lengow_shipping_method_carriers_default_title|Default mapping of the carrier
lengow_settings.lengow_import_shipping_methods_title|Advanced mapping of shipping methods
lengow_settings.lengow_shipping_method_carriers_title|Advanced mapping of carriers
lengow_log.error.rest_time_to_import|Please wait %{rest_time} seconds before re-importing orders
lengow_log.error.nb_order_imported|%{nb_order} order(s) imported
lengow_log.error.nb_order_updated|%{nb_order} order(s) updated
Expand Down
Loading