Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Merge branch '2022.5.3_rc' of github.com:OPEN-DSI/ecommerceng_woosync…
Browse files Browse the repository at this point in the history
… into 2022.5.3
  • Loading branch information
kkhelifa-opendsi committed Sep 29, 2023
2 parents 1b41282 + d1506ad commit c71e98d
Show file tree
Hide file tree
Showing 27 changed files with 1,315 additions and 669 deletions.
15 changes: 14 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# ChangeLog

## 4.1.57.0
- Ajout du support de l'extension woocommerce "WooCommerce Multi Locations Inventory Management".
- Correction synchro attribut de produit de dolibarr vers le site.
- Correction synchro stock avec l'extension "Stock Locations for WooCommerce" du site vers dolibarr.

## 4.1.56.0
- Correction d'une erreur lors de la mise a jour d'une catégorie synchronisée
- Ajout du support avec WPML dans la config du site onglet "produit" et non plus avec la variable globale ECOMMERCENG_WOOCOMMERCE_WPML_SUPPORT.
- Ajout du support multilingue Dolibarr avec le support multilingue WooCommerce (via le plugin WPML)
- Le dictionnaire de correspondance des langues entre dolibarr et WooCommerce apprais seulement si le multilingue est activé dans dolibarr. Il n'est utilisé que si l'option WPML est aussi activé dans la configuration du site.
- Configuration du modele de mail par langue dans la configuration des commandes du site si le multilingue dolibarr et WPML sont activées
- Lors de la synchro de la commande, définie la langue du tiers (si celle-ci n'est pas définie) avec celle de la commande (grace au dico de correspondance des langues)
- Force le libellé et description lors de la synchro des commandes avec celle WooCommerce dans la langue de la commande
- Génère le PDF de la commande et de la facture dans la langue de la commande WooCommerce
- Envoie le mail de la facture avec le modele dans la langue de la commande WooCommerce
- Mise a jour des libellé des produits dans chaque langues WooCommerce -> Dolibarr et Dolibarr -> WooCommerce (seule les langues existante coté WooCommerce sont mise à jour)

## 4.1.55.0
- Correction d'une erreur lors de la mise a jour d'une catégorie synchronisée
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.56
4.1.57
39 changes: 26 additions & 13 deletions admin/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@
setEventMessages($eCommercePaymentGateways->error, $eCommercePaymentGateways->errors, 'errors');
}

$language_list = $object->getLanguages();
$language_list = array_flip(array_flip(array_values($language_list)));

/*
* Actions
*/
Expand Down Expand Up @@ -227,8 +230,11 @@
$payment_gateways[$key]['bank_account_id'] = GETPOST('bank_account_id_' . $key, 'int');
$payment_gateways[$key]['bank_account_id'] = $payment_gateways[$key]['bank_account_id'] > 0 ? $payment_gateways[$key]['bank_account_id'] : 0;
$payment_gateways[$key]['create_invoice_payment'] = GETPOST('create_invoice_payment_' . $key, 'int') ? 1 : 0;
$payment_gateways[$key]['mail_model_for_send_invoice'] = GETPOST('mail_model_for_send_invoice_' . $key, 'int');
$payment_gateways[$key]['mail_model_for_send_invoice'] = $payment_gateways[$key]['mail_model_for_send_invoice'] > 0 ? $payment_gateways[$key]['mail_model_for_send_invoice'] : 0;
if (!is_array($payment_gateways[$key]['mail_model_for_send_invoice'])) $payment_gateways[$key]['mail_model_for_send_invoice'] = array();
foreach ($language_list as $lang) {
$value = GETPOST('mail_model_for_send_invoice_' . $lang . '_' . $key, 'int');
$payment_gateways[$key]['mail_model_for_send_invoice'][$lang] = $value > 0 ? $value : 0;
}
$payment_gateways[$key]['supplier_id'] = GETPOST('supplier_id_' . $key, 'int');
$payment_gateways[$key]['supplier_id'] = $payment_gateways[$key]['supplier_id'] > 0 ? $payment_gateways[$key]['supplier_id'] : 0;
$payment_gateways[$key]['product_id_for_fee'] = GETPOST('product_id_for_fee_' . $key, 'int');
Expand Down Expand Up @@ -611,12 +617,12 @@
}
foreach ($formmail->lines_model as $line) {
if (preg_match('/\((.*)\)/', $line->label, $reg)) {
$email_templates[$line->id] = $langs->trans($reg[1]); // langs->trans when label is __(xxx)__
$email_templates[$line->lang][$line->id] = $langs->trans($reg[1]); // langs->trans when label is __(xxx)__
} else {
$email_templates[$line->id] = $line->label;
$email_templates[$line->lang][$line->id] = $line->label;
}
if ($line->lang) $email_templates[$line->id] .= ' (' . $line->lang . ')';
if ($line->private) $email_templates[$line->id] .= ' - ' . $langs->trans("Private");
if ($line->lang) $email_templates[$line->lang][$line->id] .= ' (' . $line->lang . ')';
if ($line->private) $email_templates[$line->lang][$line->id] .= ' - ' . $langs->trans("Private");
}

foreach ($payment_gateways as $key => $infos) {
Expand All @@ -633,13 +639,20 @@
print '<td><input type="checkbox" id="create_invoice_payment_' . $key . '" name="create_invoice_payment_' . $key . '" value="1"' . (!empty($infos['create_invoice_payment']) ? ' checked' : '') . '></td>' . "\n";
if (!empty($object->parameters['order_actions']['send_invoice_by_mail'])) {
print '<td>' . "\n";
// Zone to select email template
if (count($email_templates) > 0) {
print $form->selectarray('mail_model_for_send_invoice_' . $key, $email_templates, $infos['mail_model_for_send_invoice'], 1, 0, 0, '', 0, 0, 0, '', 'minwidth100');
} else {
print '<select name="mail_model_for_send_invoice_' . $key . '" disabled="disabled"><option value="none">' . $langs->trans("NoTemplateDefined") . '</option></select>'; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy.
}
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup') . ' - ' . $langs->transnoentitiesnoconv('EMails')), 1);
print '<table class="nobordernopadding centpercent">' . "\n";
foreach ($language_list as $lang) {
print '<tr><td>' . "\n";
if ($lang != 'ec_none') print $lang . " : ";
// Zone to select email template
if (count($email_templates[$lang == 'ec_none' ? '' : $lang]) > 0) {
print $form->selectarray('mail_model_for_send_invoice_' . $lang . '_' . $key, $email_templates[$lang == 'ec_none' ? '' : $lang], $infos['mail_model_for_send_invoice'][$lang], 1, 0, 0, '', 0, 0, 0, '', ' minwidth200');
} else {
print '<select name="mail_model_for_send_invoice_' . $lang . '_' . $key . '" disabled="disabled"><option value="none">' . $langs->trans("NoTemplateDefined") . '</option></select>'; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy.
}
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup') . ' - ' . $langs->transnoentitiesnoconv('EMails')), 1);
print '</td></tr>' . "\n";
}
print '</table>' . "\n";
print '</td>' . "\n";
}
if (!empty($object->parameters['order_actions']['create_supplier_invoice'])) {
Expand Down
9 changes: 9 additions & 0 deletions admin/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
$object->parameters['product_weight_units'] = empty($conf->global->PRODUCT_DISABLE_WEIGHT) ? GETPOST('product_weight_units', 'int') : 0; // 0 = Kg
$object->parameters['product_dimension_units'] = empty($conf->global->PRODUCT_DISABLE_SIZE) ? GETPOST('product_dimension_units', 'int') : 2; // 2 = cm
$object->parameters['product_variation_mode'] = GETPOST('product_variation_mode', 'az09');
$object->parameters['enable_product_plugin_wpml_support'] = GETPOST('enable_product_plugin_wpml_support', 'int') ? 1 : 0;

if(empty($object->fk_cat_product)) {
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ECommerceCatProduct")), 'errors');
Expand Down Expand Up @@ -446,6 +447,14 @@
print $form->selectarray('product_variation_mode', $variation_modes, $value, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200 centpercent') . "\n";
print '</td></tr>' . "\n";

// Support of WooCommerce plugin : WPML for WooCommerce
print '<tr class="oddeven">' . "\n";
print '<td>' . $langs->trans("ECommerceWoocommerceEnableProductWpmlPluginSupport") . '</td>' . "\n";
print '<td>' . $langs->transnoentities("ECommerceWoocommerceEnableProductWpmlPluginSupportDescription") . '</td>' . "\n";
print '<td class="right">' . "\n";
print '<input type="checkbox" name="enable_product_plugin_wpml_support" value="1"' . (!empty($object->parameters['enable_product_plugin_wpml_support']) ? ' checked' : '') . ' />' . "\n";
print '</td></tr>' . "\n";

print '</table>'."\n";

print '<br>';
Expand Down
Loading

0 comments on commit c71e98d

Please sign in to comment.