diff -ruN oledrion-2.35_RC1/admin/actions/products.php oledrion-2.35_RC2/admin/actions/products.php
--- oledrion-2.35_RC1/admin/actions/products.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/admin/actions/products.php	2019-12-13 14:50:02.056924390 -0500
@@ -65,10 +65,8 @@
         $start = \Xmf\Request::getInt('start', 0, 'GET');
 
         $filter_product_id = $filter_product_cid = $filter_product_recommended = $filter_product_price = $filter_product_online = 0;
-        // B.R. New
         // TODO: Code Reviewers Are these filters neccessary? Not sure what they do.
         $filter_skip_packing = $filter_skip_location = $filter_skip_delivery = 0;
-        // B.R. End
         $filter_product_title = $filter_product_sku = '';
 
         $newFilter = false;
@@ -116,7 +114,6 @@
             $filter_product_price = \Xmf\Request::getInt('filter_product_price', 0, 'POST');
             $newFilter            = true;
         }
-        // B.R. Added: $filter_skip_packing $filter_skip_location $filter_skip_delivery
         if (0 == $filter_product_id && 0 == $filter_product_cid && 0 == $filter_product_recommended && 0 == $filter_product_price && 0 == $filter_product_online && '' === $filter_product_title && '' === $filter_product_sku && 0 == $filter_skip_packing && 0 == $filter_skip_location
             && 0 == $filter_skip_delivery) {
             $newFilter = true;
@@ -131,11 +128,9 @@
             $filter_product_sku         = $_SESSION['filter_product_sku'];
             $filter_product_online      = $_SESSION['filter_product_online'];
             $filter_product_price       = $_SESSION['filter_product_price'];
-            // B.R. New
             $filter_skip_packing  = $_SESSION['filter_skip_packing'];
             $filter_skip_location = $_SESSION['filter_skip_location'];
             $filter_skip_delivery = $_SESSION['filter_skip_delivery'];
-            // B.R. End
         }
 
         $_SESSION['oledrion_filter']            = serialize($criteria);
@@ -146,11 +141,9 @@
         $_SESSION['filter_product_sku']         = $filter_product_sku;
         $_SESSION['filter_product_online']      = $filter_product_online;
         $_SESSION['filter_product_price']       = $filter_product_price;
-        // B.R. New
         $_SESSION['filter_skip_packing']  = $filter_skip_packing;
         $_SESSION['filter_skip_location'] = $filter_skip_location;
         $_SESSION['filter_skip_delivery'] = $filter_skip_delivery;
-        // B.R. End
 
         $itemsCount = $productsHandler->getCount($criteria); // Recherche du nombre total de produits répondants aux critères
         Oledrion\Utility::htitle(_MI_OLEDRION_ADMENU4 . ' (' . $itemsCount . ')', 4);
@@ -165,11 +158,9 @@
         $selectCateg  = $selectCateg0->render();
 
         $onlineSelect = Oledrion\Utility::htmlSelect('filter_product_online', [2 => _YES, 1 => _NO], $filter_product_online);
-        // B.R. New
         $skipPackingSelect  = Oledrion\Utility::htmlSelect('filter_skip_packing', [2 => _YES, 1 => _NO], $filter_skip_packing);
         $skipLocationSelect = Oledrion\Utility::htmlSelect('filter_skip_location', [2 => _YES, 1 => _NO], $filter_skip_location);
         $skipDeliverySelect = Oledrion\Utility::htmlSelect('filter_skip_delivery', [2 => _YES, 1 => _NO], $filter_skip_delivery);
-        // B.R. End
         $recommendedSelect = Oledrion\Utility::htmlSelect('filter_product_recommended', [1 => _YES, 2 => _NO], $filter_product_recommended);
 
         $criteria->setLimit($limit);
@@ -211,11 +202,9 @@
         echo "<th align='center'>" . $selectCateg . "</th>\n";
         echo "<th align='center'><input type='text' size='25' name='filter_product_sku' id='filter_product_sku' value='$filter_product_sku'></th>\n";
         echo "<th align='center'>" . $onlineSelect . "</th>\n";
-        // B.R. Start
         echo "<th align='center'>" . $skipPackingSelect . "</th>\n";
         echo "<th align='center'>" . $skipLocationSelect . "</th>\n";
         echo "<th align='center'>" . $skipDeliverySelect . "</th>\n";
-        // B.R. End
         echo "<th align='center'>" . $recommendedSelect . "</th>\n";
         echo "<th align='center'>&nbsp;</th>\n";
         echo "<th align='center'><input type='text' size='5' name='filter_product_price' id='filter_product_price' value='$filter_product_price'></th>\n";
@@ -240,11 +229,10 @@
             $actions[] = "<a href='$baseurl?op=products&action=copy&id=" . $id . "' title='" . _OLEDRION_DUPLICATE_PRODUCT . "'>" . $icons['copy'] . '</a>';
             $actions[] = "<a href='$baseurl?op=products&action=confdelete&id=" . $id . "' title='" . _OLEDRION_DELETE . "'>" . $icons['delete'] . '</a>';
             $online    = 1 == $item->getVar('product_online') ? _YES : _NO;
-            // B.R. New
             $skipPacking  = 1 == $item->getVar('skip_packing') ? _YES : _NO;
             $skipLocation = 1 == $item->getVar('skip_location') ? _YES : _NO;
             $skipDelivery = 1 == $item->getVar('skip_delivery') ? _YES : _NO;
-            // B.R. End
+
             echo "<tr class='" . $class . "'>\n";
             if (isset($categories[$item->getVar('product_cid')])) {
                 $productCategory = $categories[$item->getVar('product_cid')]->getVar('cat_title');
@@ -293,7 +281,6 @@
         if (isset($pagenav) && is_object($pagenav)) {
             echo "<div align='right'>" . $pagenav->renderNav() . '</div>';
         }
-        //require_once OLEDRION_ADMIN_PATH . 'admin_footer.php';
 
         break;
     // ****************************************************************************************************************
@@ -359,7 +346,7 @@
             if (empty($id)) {
                 Oledrion\Utility::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5);
             }
-            // Item exits ?
+            // Item exists ?
             $item = null;
             $item = $productsHandler->get($id);
             if (!is_object($item)) {
@@ -371,11 +358,9 @@
             $title = _AM_OLEDRION_ADD_PRODUCT;
             $item  = $productsHandler->create(true);
             $item->setVar('product_online', 1);
-            // B.R. Start
             $item->setVar('skip_packing', 0);
             $item->setVar('skip_location', 0);
             $item->setVar('skip_delivery', 0);
-            // B.R. End
             if (OLEDRION_AUTO_FILL_MANUAL_DATE) {
                 $item->setVar('product_date', formatTimestamp(time(), 's'));
             }
@@ -387,7 +372,6 @@
         if (0 === count($categories)) {
             Oledrion\Utility::redirect(_AM_OLEDRION_ERROR_8, $baseurl, 5);
         }
-        // TVA
         $vats = $vatsForDisplay = [];
         $vats = $vatHandler->getAllVats(new Oledrion\Parameters());
         if (0 == count($vats) && Oledrion\Utility::getModuleOption('use_price')) {
@@ -420,12 +404,9 @@
 
         $select_categ = $mytree->makeSelectElement('product_cid', 'cat_title', '-', $item->getVar('product_cid'), true, 0, '', _AM_OLEDRION_CATEG_HLP);
         $sform->addElement($select_categ);
-
-        // B.R. New
         $sform->addElement(new \XoopsFormRadioYN(_OLEDRION_SKIP_PACKING, 'skip_packing', $item->getVar('skip_packing')), true);
         $sform->addElement(new \XoopsFormRadioYN(_OLEDRION_SKIP_LOCATION, 'skip_location', $item->getVar('skip_location')), true);
         $sform->addElement(new \XoopsFormRadioYN(_OLEDRION_SKIP_DELIVERY, 'skip_delivery', $item->getVar('skip_delivery')), true);
-        // End New
 
         $deliveryTime = new \XoopsFormText(_OLEDRION_DELIVERY_TIME, 'product_delivery_time', 5, 5, $item->getVar('product_delivery_time', 'e'));
         $deliveryTime->setDescription(_OLEDRION_IN_DAYS);
@@ -544,7 +525,6 @@
         // ********************************************************************
 
         if (Oledrion\Utility::getModuleOption('use_price')) {
-            // TVA ****************************************************************
             $vatSelect = new \XoopsFormSelect(_OLEDRION_VAT, 'product_vat_id', $item->getVar('product_vat_id'));
             $vatSelect->addOptionArray($vatsForDisplay);
             $sform->addElement($vatSelect, true);
@@ -793,10 +773,6 @@
 
             $id = $item->getVar('product_id');
             // Notifications ******************************************************
-            if (true === $add) {
-                //$plugins = Plugin::getInstance();
-                //$plugins->fireAction(Plugin::EVENT_ON_PRODUCT_CREATE, new Oledrion\Parameters(array('product' => $item)));
-            }
             // Gestion des fabricants ************************************************
             if ($edit) {
                 // Suppression préalable
@@ -950,14 +926,13 @@
         if (empty($id)) {
             Oledrion\Utility::redirect(_AM_OLEDRION_ERROR_1, $baseurl, 5);
         }
-        // Item exits ?
+        // Item exists ?
         $item = null;
         $item = $productsHandler->get($id);
         if (!is_object($item)) {
             Oledrion\Utility::redirect(_AM_OLEDRION_NOT_FOUND, $baseurl, 5);
         }
 
-        //        $criteria = new \Criteria(/*'product_id', $item->getVar('product_id'), '<>'*/);
         $criteria = new \Criteria('product_id', $item->getVar('product_id'), '<>');
         $criteria->setSort('product_title');
         $relatedProducts = $productsHandler->getObjects($criteria);
diff -ruN oledrion-2.35_RC1/ajax.php oledrion-2.35_RC2/ajax.php
--- oledrion-2.35_RC1/ajax.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/ajax.php	2019-12-13 14:50:02.144888254 -0500
@@ -353,6 +353,7 @@
             $cmd_lastname  = \Xmf\Request::getString('cmd_lastname', '', 'POST');
             $cmd_firstname = \Xmf\Request::getString('cmd_firstname', '', 'POST');
             $cmd_adress    = \Xmf\Request::getString('cmd_adress', '', 'POST');
+            $cmd_note      = \Xmf\Request::getString('cmd_note', '', 'POST');
             $cmd_zip       = \Xmf\Request::getString('cmd_zip', '', 'POST');
             $cmd_town      = \Xmf\Request::getString('cmd_town', '', 'POST');
             $cmd_country   = \Xmf\Request::getString('cmd_country', '', 'POST');
@@ -405,6 +406,7 @@
                 $commande->setVar('cmd_lastname', $cmd_lastname);
                 $commande->setVar('cmd_firstname', $cmd_firstname);
                 $commande->setVar('cmd_adress', $cmd_adress);
+                $commande->setVar('cmd_note', $cmd_note);
                 $commande->setVar('cmd_zip', $cmd_zip);
                 $commande->setVar('cmd_town', $cmd_town);
                 $commande->setVar('cmd_country', $cmd_country);
@@ -479,6 +481,7 @@
                     $msg['NOM'] = $commande->getVar('cmd_lastname');
                     $msg['PRENOM'] = $commande->getVar('cmd_firstname');
                     $msg['ADRESSE'] = $commande->getVar('cmd_adress', 'n');
+                    $msg['NOTE'] = $commande->getVar('cmd_note', 'n');
                     $msg['CP'] = $commande->getVar('cmd_zip');
                     $msg['VILLE'] = $commande->getVar('cmd_town');
                     $msg['PAYS'] = $countries[$commande->getVar('cmd_country')];
diff -ruN oledrion-2.35_RC1/checkout.php oledrion-2.35_RC2/checkout.php
--- oledrion-2.35_RC1/checkout.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/checkout.php	2019-12-13 14:50:02.011942869 -0500
@@ -32,7 +32,6 @@
 require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
 require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
 require_once XOOPS_ROOT_PATH . '/class/tree.php';
-// require_once OLEDRION_PATH . 'class/Registryfile.php';
 
 // Get user id
 $uid = Oledrion\Utility::getCurrentUserID();
@@ -67,29 +66,24 @@
 $shippingAmount       = $commandAmount = $vatAmount = $commandAmountTTC = $discountsCount = $commandAmountVAT = 0;
 $goOn                 = '';
 $discountsDescription = [];
-// B.R. New
-$checkoutAttributes = [];
+$checkoutAttributes   = [];
+
 // Assume optional checkout steps skipped (listCart updates)
 $checkoutAttributes['skip_packing']  = 1;
 $checkoutAttributes['skip_location'] = 1;
 $checkoutAttributes['skip_delivery'] = 1;
-// B.R. End
 
 function listCart()
 {
-    // B.R. global $cartForTemplate, $emptyCart, $shippingAmount, $commandAmount, $vatAmount, $goOn, $commandAmountTTC, $discountsDescription;
     global $cartForTemplate, $emptyCart, $shippingAmount, $commandAmount, $vatAmount, $goOn, $commandAmountTTC, $discountsDescription, $checkoutAttributes;
     $reductions = new Oledrion\Reductions();
-    // B.R. $reductions->computeCart($cartForTemplate, $emptyCart, $shippingAmount, $commandAmount, $vatAmount, $goOn, $commandAmountTTC, $discountsDescription, $discountsCount);
     $reductions->computeCart($cartForTemplate, $emptyCart, $shippingAmount, $commandAmount, $vatAmount, $goOn, $commandAmountTTC, $discountsDescription, $discountsCount, $checkoutAttributes);
 }
 
 $oledrionCurrency = Oledrion\Currency::getInstance();
 $countries        = Oledrion\Utility::getCountriesList();
 
-// B.R. New
 listCart();
-// End New
 
 switch ($op) {
     case 'save':
@@ -100,7 +94,6 @@
         if ($caddyHandler->isCartEmpty()) {
             Oledrion\Utility::redirect(_OLEDRION_CART_IS_EMPTY, OLEDRION_URL, 4);
         }
-        // B.R. listCart();
 
         switch ($action) {
             case 'make':
@@ -307,7 +300,7 @@
         if ($caddyHandler->isCartEmpty()) {
             Oledrion\Utility::redirect(_OLEDRION_CART_IS_EMPTY, OLEDRION_URL, 4);
         }
-        // B.R. listCart();
+
         $notFound = true;
         $commande = null;
 
@@ -343,14 +336,13 @@
             $sform->addElement(new \XoopsFormLabel(_OLEDRION_SHIPPING_PRICE, $oledrionCurrency->amountForDisplay($shippingAmount)));
         }
         $sform->addElement(new \XoopsFormText(_OLEDRION_LASTNAME, 'cmd_lastname', 50, 255, $commande->getVar('cmd_lastname', 'e')), true);
-        // B.R. New
         if (0 == $checkoutAttributes['skip_delivery']) {
             // Assume that select delivery implies also need first name, physical address and phone numbers
             $mandatory = true;
         } else {
             $mandatory = false;
         }
-        // B.R. $sform->addElement(new \XoopsFormText(_OLEDRION_FIRSTNAME, 'cmd_firstname', 50, 255, $commande->getVar('cmd_firstname', 'e')), false);
+
         $sform->addElement(new \XoopsFormText(_OLEDRION_FIRSTNAME, 'cmd_firstname', 50, 255, $commande->getVar('cmd_firstname', 'e')), $mandatory);
         if ($uid > 0) {
             $sform->addElement(new \XoopsFormText(_OLEDRION_EMAIL, 'cmd_email', 50, 255, $xoopsUser->getVar('email', 'e')), true);
@@ -367,20 +359,23 @@
             $sform->addElement(new \XoopsFormHidden('cmd_country', OLEDRION_DEFAULT_COUNTRY));
         }
         $sform->addElement(new \XoopsFormText(_OLEDRION_CP, 'cmd_zip', 15, 30, $commande->getVar('cmd_zip', 'e')), true);
-        // B.R. $sform->addElement(new \XoopsFormText(_OLEDRION_MOBILE, 'cmd_mobile', 15, 50, $commande->getVar('cmd_mobile', 'e')), true);
-        // B.R. $sform->addElement(new \XoopsFormText(_OLEDRION_PHONE, 'cmd_telephone', 15, 50, $commande->getVar('cmd_telephone', 'e')), true);
         $sform->addElement(new \XoopsFormText(_OLEDRION_MOBILE, 'cmd_mobile', 15, 50, $commande->getVar('cmd_mobile', 'e')), $mandatory);
         $sform->addElement(new \XoopsFormText(_OLEDRION_PHONE, 'cmd_telephone', 15, 50, $commande->getVar('cmd_telephone', 'e')), $mandatory);
         if (Oledrion\Utility::getModuleOption('ask_vatnumber')) {
             $sform->addElement(new \XoopsFormText(_OLEDRION_VAT_NUMBER, 'cmd_vat_number', 50, 255, $commande->getVar('cmd_vat_number', 'e')), false);
         }
-        if (Oledrion\Utility::getModuleOption('ask_bill')) {
-            // B.R. $sform->addElement(new \XoopsFormRadioYN(_OLEDRION_INVOICE, 'cmd_bill', 0), true);
+        //if (Oledrion\Utility::getModuleOption('ask_bill')) {
+        //    $sform->addElement(new \XoopsFormRadioYN(_OLEDRION_INVOICE, 'cmd_bill', 0), false);
+        //}
+
+        $sform->addElement(new \XoopsFormTextArea(_OLEDRION_STREET, 'cmd_adress', $commande->getVar('cmd_adress', 'e'), 1, 50), $mandatory);
+        $sform->addElement(new \XoopsFormText(_OLEDRION_GIFT, 'cmd_gift', 15, 30, $commande->getVar('cmd_gift', 'e')), false);
+	$sform->addElement(new \XoopsFormTextArea(_OLEDRION_NOTE, 'cmd_note', $commande->getVar('cmd_note', 'e'), 1, 50), false);
+
+	if (Oledrion\Utility::getModuleOption('ask_bill')) {
             $sform->addElement(new \XoopsFormRadioYN(_OLEDRION_INVOICE, 'cmd_bill', 0), false);
         }
-        // B.R. $sform->addElement(new XoopsFormTextArea(_OLEDRION_STREET, 'cmd_adress', $commande->getVar('cmd_adress', 'e'), 3, 50), true);
-        $sform->addElement(new \XoopsFormTextArea(_OLEDRION_STREET, 'cmd_adress', $commande->getVar('cmd_adress', 'e'), 3, 50), $mandatory);
-        $sform->addElement(new \XoopsFormText(_OLEDRION_GIFT, 'cmd_gift', 15, 30, $commande->getVar('cmd_gift', 'e')), false);
+
         $buttonTray = new \XoopsFormElementTray('', '');
         $submit_btn = new \XoopsFormButton('', 'post', _OLEDRION_SAVE_NEXT, 'submit');
         $buttonTray->addElement($submit_btn);
@@ -400,14 +395,11 @@
         // Check checkout level
         if (1 == $checkout_level) {
             Oledrion\Utility::redirect(_OLEDRION_FINAL_CHECKOUT, OLEDRION_URL . 'checkout.php?op=confirm&commend_id=' . $commend_id, 1);
-            // B.R. Start
         } elseif (1 == $checkoutAttributes['skip_packing']) {
             Oledrion\Utility::redirect(_OLEDRION_SELECT_LOCATION, OLEDRION_URL . 'checkout.php?op=location&commend_id=' . $commend_id, 1);
-            // B.R. End
         } elseif (2 == $checkout_level) {
             Oledrion\Utility::redirect(_OLEDRION_SELECT_LOCATION, OLEDRION_URL . 'checkout.php?op=location&commend_id=' . $commend_id, 1);
         }
-        // B.R. listCart();
         $packings = $packingHandler->getPacking();
 
         $sform = new \XoopsThemeForm(_OLEDRION_PACKING_FORM, 'informationfrm', OLEDRION_URL . 'checkout.php', 'post', true);
@@ -440,14 +432,10 @@
         // Check checkout level
         if (1 == $checkout_level) {
             Oledrion\Utility::redirect(_OLEDRION_FINAL_CHECKOUT, OLEDRION_URL . 'checkout.php?op=confirm&commend_id=' . $commend_id, 1);
-            // B.R. Start
         } elseif (1 == $checkoutAttributes['skip_location']) {
-            //$commande = $h_oledrion_commands->get($commend_id);
-            //Oledrion\Utility::redirect(_OLEDRION_SELECT_DELIVERY, OLEDRION_URL . 'checkout.php?op=delivery&commend_id=' . $commande->getVar('cmd_id'), 1);
             Oledrion\Utility::redirect(_OLEDRION_SELECT_DELIVERY, OLEDRION_URL . 'checkout.php?op=delivery&commend_id=' . $commend_id, 1);
-            // B.R. End
         }
-        // B.R. listCart();
+
         switch ($action) {
             case 'default':
 
@@ -503,14 +491,10 @@
         // Check checkout level
         if (1 == $checkout_level) {
             Oledrion\Utility::redirect(_OLEDRION_FINAL_CHECKOUT, OLEDRION_URL . 'checkout.php?op=confirm&commend_id=' . $commend_id, 1);
-            // B.R. Start
         } elseif (1 == $checkoutAttributes['skip_delivery']) {
-            //$commande = $h_oledrion_commands->get($commend_id);
-            //Oledrion\Utility::redirect(_OLEDRION_SELECT_PAYMENT, OLEDRION_URL . 'checkout.php?op=payment&commend_id=' . $commande->getVar('cmd_id'), 1);
             Oledrion\Utility::redirect(_OLEDRION_SELECT_PAYMENT, OLEDRION_URL . 'checkout.php?op=payment&commend_id=' . $commend_id, 1);
-            // B.R. End
         }
-        // B.R. listCart();
+
         $commande    = $commandsHandler->get($commend_id);
         $location_id = $commande->getVar('cmd_location_id');
         $deliveres   = $deliveryHandler->getThisLocationDelivery($location_id);
@@ -546,15 +530,13 @@
         if (1 == $checkout_level) {
             Oledrion\Utility::redirect(_OLEDRION_FINAL_CHECKOUT, OLEDRION_URL . 'checkout.php?op=confirm&commend_id=' . $commend_id, 1);
         }
-        // B.R. listCart();
-        // B.R. Start
+
         $commande = $commandsHandler->get($commend_id);
         if (1 == $checkoutAttributes['skip_delivery']) {
             // Assumes first deliery method is free shipping (else, why skip?)
             // TODO: Consider pre-configuring free shipping as #1
             $delivery_id = 1;
         } else {
-            // B.R. End
             $delivery_id = $commande->getVar('cmd_delivery_id');
         }
         $payments = $paymentHandler->getThisDeliveryPayment($delivery_id);
@@ -589,7 +571,6 @@
         if (0 == $commend_id) {
             Oledrion\Utility::redirect(_OLEDRION_ERROR20, OLEDRION_URL, 4);
         }
-        // B.R. listCart();
 
         $commandAmountTTC += $commandAmountVAT;
 
@@ -612,7 +593,7 @@
 
         // Registering the Cart
         $msgCommande = '';
-        //        $handlers    = HandlerManager::getInstance();
+
         foreach ($cartForTemplate as $line) {
             $panier = $caddyHandler->create(true);
             $panier->setVar('caddy_product_id', $line['product_id']);
@@ -631,7 +612,6 @@
             $msgCommande .= str_pad($line['product_title'], 19, ' ', STR_PAD_LEFT) . ' ';
             $msgCommande .= str_pad($line['product_qty'], 8, ' ', STR_PAD_LEFT) . ' ';
             $msgCommande .= str_pad($oledrionCurrency->amountForDisplay($line['product_price']), 15, ' ', STR_PAD_LEFT) . ' ';
-            //$msgCommande .= str_pad($line['totalPriceFormated'],10,' ', STR_PAD_LEFT) . ' ';
             $msgCommande .= "\n";
             // Attributs
             if ($res && is_array($line['attributes']) && count($line['attributes']) > 0) {
@@ -653,7 +633,6 @@
         }
 
         // General totals
-        //$msgCommande .= "\n\n"._OLEDRION_SHIPPING_PRICE.' '.$oledrionCurrency->amountForDisplay($shippingAmount)."\n";
         $msgCommande .= "\n\n" . _OLEDRION_TOTAL . ' ' . $oledrionCurrency->amountForDisplay($commandAmountTTC) . "\n";
         if (count($discountsDescription) > 0) {
             $msgCommande .= "\n\n" . _OLEDRION_CART4 . "\n";
@@ -667,6 +646,7 @@
         $msg['NOM']          = $commande->getVar('cmd_lastname');
         $msg['PRENOM']       = $commande->getVar('cmd_firstname');
         $msg['ADRESSE']      = $commande->getVar('cmd_adress', 'n');
+        $msg['NOTE']         = $commande->getVar('cmd_note', 'n');
         $msg['CP']           = $commande->getVar('cmd_zip');
         $msg['VILLE']        = $commande->getVar('cmd_town');
         $msg['PAYS']         = $countries[$commande->getVar('cmd_country')];
@@ -680,15 +660,14 @@
             $msg['FACTURE'] = _NO;
         }
         // Send mail to client
-        // B.R. New Rather than sending message before payment approval, save parameters in OLEDRION_UPLOAD_PATH/${cmd_id}_conf_email.serialize
-        // TODO: Make a configuration option?
+        // Rather than sending message before payment approval, save parameters in OLEDRION_UPLOAD_PATH/${cmd_id}_conf_email.parms
+        // TODO: Make a send conf emails before / after payment a configuration option?
         // Then, based on payment approval / disapproval, send email at payment gatewayNotify callback
         $email_name = sprintf('%s/%d%s', OLEDRION_UPLOAD_PATH, $commande->getVar('cmd_id'), OLEDRION_CONFIRMATION_EMAIL_FILENAME_SUFFIX);
         file_put_contents($email_name, serialize($msg));
         //Oledrion\Utility::sendEmailFromTpl('command_client.tpl', $commande->getVar('cmd_email'), sprintf(_OLEDRION_THANKYOU_CMD, $xoopsConfig['sitename']), $msg);
         // Send mail to admin
         //Oledrion\Utility::sendEmailFromTpl('command_shop.tpl', Oledrion\Utility::getEmailsFromGroup(Oledrion\Utility::getModuleOption('grp_sold')), _OLEDRION_NEW_COMMAND, $msg);
-        // End New
 
         // Presentation of the form to send to the payment gateway
         // Final presentation with Cart in hidden variables ******************************
@@ -702,11 +681,8 @@
             $payURL = OLEDRION_URL . 'invoice.php?id=' . $commande->getVar('cmd_id') . '&pass=' . $commande->getVar('cmd_password');
             $sform  = new \XoopsThemeForm(_OLEDRION_FINISH, 'payform', $payURL, 'post', true);
         } else {
-            // B.R. New
             $payment_id = $commande->getVar('cmd_payment_id');
             $payment    = $paymentHandler->get($payment_id);
-            // End new
-            // B.R. if (!isset($payment) || $payment['payment_type'] === 'offline' || $commandAmountTTC == 0) {
             if (0 == $commandAmountTTC || !isset($payment) || 'offline' === $payment->getVar('payment_type')) {
                 $text = $registry->getfile(OLEDRION_TEXTFILE4);
                 $xoopsTpl->append('text', '<br>' . xoops_trim($text));
@@ -714,8 +690,6 @@
                 $sform  = new \XoopsThemeForm(_OLEDRION_FINISH, 'payform', $payURL, 'post', true);
             } else {
                 // Set gateway
-                // B.R. $gateway = \XoopsModules\Oledrion\Gateways::getGatewayObject($payment['payment_gateway']);
-
                 $gatewayName      = \XoopsModules\Oledrion\Gateways::getCurrentGateway();
                 $gatewayClassName = '\XoopsModules\Oledrion\Gateways\\' . $gatewayName . '\\' . $gatewayName . 'Gateway';
                 if (class_exists($gatewayClassName)) {
@@ -751,6 +725,7 @@
         $sform->addElement(new \XoopsFormLabel(_OLEDRION_LASTNAME, $commande->getVar('cmd_lastname')));
         $sform->addElement(new \XoopsFormLabel(_OLEDRION_FIRSTNAME, $commande->getVar('cmd_firstname')));
         $sform->addElement(new \XoopsFormLabel(_OLEDRION_STREET, $commande->getVar('cmd_adress')));
+        $sform->addElement(new \XoopsFormLabel(_OLEDRION_NOTE, $commande->getVar('cmd_note')));
         $sform->addElement(new \XoopsFormLabel(_OLEDRION_CP, $commande->getVar('cmd_zip')));
         $sform->addElement(new \XoopsFormLabel(_OLEDRION_CITY, $commande->getVar('cmd_town')));
         if (Oledrion\Utility::getModuleOption('checkout_country')) {
@@ -783,7 +758,6 @@
             }
         }
         $buttonTray = new \XoopsFormElementTray('', '');
-        //B.R. if (!isset($payment) || $payment['payment_type'] === 'offline' || $commandAmountTTC == 0 || $checkout_level == 1 ) {
         if (0 == $commandAmountTTC || !isset($payment) || 'offline' === $payment->getVar('payment_type') || 1 == $checkout_level) {
             $submit_btn = new \XoopsFormButton('', 'post', _OLEDRION_FINISH, 'submit');
         } else {
diff -ruN oledrion-2.35_RC1/class/CommandsHandler.php oledrion-2.35_RC2/class/CommandsHandler.php
--- oledrion-2.35_RC1/class/CommandsHandler.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/class/CommandsHandler.php	2019-12-13 14:50:02.034933425 -0500
@@ -181,8 +181,6 @@
         $retval = $this->insert($order, true);
         if ($retval) {
             $this->updateStocks($order);
-            // B.R. Validation emails redundant since order emails now sent @gateway (paypal) validation
-            // B.R. $this->notifyOrderValidated($order, $comment);
         }
 
         return $retval;
@@ -406,7 +404,6 @@
     {
         /** @var \XoopsDatabase $db */
         $db = \XoopsDatabaseFactory::getDatabaseConnection();
-        //        $handlers = HandlerManager::getInstance();
         $cmd_id = $order->getVar('cmd_id');
         $res    = $this->delete($order);
         // Suppression des objets associés
diff -ruN oledrion-2.35_RC1/class/Commands.php oledrion-2.35_RC2/class/Commands.php
--- oledrion-2.35_RC1/class/Commands.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/class/Commands.php	2019-12-13 14:50:02.036932603 -0500
@@ -47,6 +47,7 @@
         $this->initVar('cmd_lastname', XOBJ_DTYPE_TXTBOX, null, false);
         $this->initVar('cmd_firstname', XOBJ_DTYPE_TXTBOX, null, false);
         $this->initVar('cmd_adress', XOBJ_DTYPE_OTHER, null, false);
+        $this->initVar('cmd_note', XOBJ_DTYPE_OTHER, null, false);
         $this->initVar('cmd_zip', XOBJ_DTYPE_TXTBOX, null, false);
         $this->initVar('cmd_town', XOBJ_DTYPE_TXTBOX, null, false);
         $this->initVar('cmd_country', XOBJ_DTYPE_TXTBOX, null, false);
diff -ruN oledrion-2.35_RC1/class/Exports/DbaseExport.php oledrion-2.35_RC2/class/Exports/DbaseExport.php
--- oledrion-2.35_RC1/class/Exports/DbaseExport.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/class/Exports/DbaseExport.php	2019-12-13 14:50:02.032934247 -0500
@@ -64,6 +64,7 @@
             ['o_lastname', 'C', 155],
             ['o_firstnam', 'C', 155],
             ['o_adress', 'C', 155],
+            ['o_note', 'C', 155],
             ['o_zip', 'C', 30],
             ['o_town', 'C', 155],
             ['o_country', 'C', 3],
@@ -94,6 +95,7 @@
            * cmd_lastname            o_lastname
            * cmd_firstname           o_firstnam
            * cmd_adress              o_adress
+           * cmd_note                o_note
            * cmd_zip                 o_zip
            * cmd_town                o_town
            * cmd_country             o_country
@@ -148,6 +150,7 @@
                     $order->getVar('cmd_lastname'),
                     $order->getVar('cmd_firstname'),
                     $order->getVar('cmd_adress'),
+                    $order->getVar('cmd_note'),
                     $order->getVar('cmd_zip'),
                     $order->getVar('cmd_town'),
                     $order->getVar('cmd_country'),
diff -ruN oledrion-2.35_RC1/class/Gateways/Paypal/PaypalGateway.php oledrion-2.35_RC2/class/Gateways/Paypal/PaypalGateway.php
--- oledrion-2.35_RC1/class/Gateways/Paypal/PaypalGateway.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/class/Gateways/Paypal/PaypalGateway.php	2019-12-14 10:25:58.585431197 -0500
@@ -181,7 +181,6 @@
         $paypal_email           = $gatewaysOptionsHandler->getGatewayOptionValue($gatewayName, 'paypal_email');
         $use_ipn                = (int)$gatewaysOptionsHandler->getGatewayOptionValue($gatewayName, 'use_ipn');
 
-        // B.R. Start
         // Need array of product_id's for optional DB update
         $caddyHandler = new Oledrion\CaddyHandler($db);
         $caddy        = $caddyHandler->getCaddyFromCommand($order->getVar('cmd_id'));
@@ -190,7 +189,6 @@
             $products[] = $item->getVar('caddy_product_id');
         }
         $product_ids = implode(',', $products);
-        // B.R. End
 
         $ret                     = [];
         $ret['cmd']              = '_xclick';
@@ -202,17 +200,15 @@
         $ret['cpp_header_image'] = XOOPS_URL . '/images/logo.gif';
         $ret['invoice']          = $order->getVar('cmd_id');
 
-        // B.R. $ret['item_name']        = _OLEDRION_COMMAND . $order->getVar('cmd_id') . ' - ' . Oledrion\Utility::makeHrefTitle($xoopsConfig['sitename']);
-        // B.R. Start
         $ret['item_name'] = $product_ids;
-        // B.R. End
 
         $ret['item_number'] = $order->getVar('cmd_id');
+        // TODO: add correct tax, add to email templates also
         $ret['tax']         = 0; // added 25/03/2008
         $ret['amount']      = $this->formatAmount((float)$order->getVar('cmd_total', 'n'));
-        $ret['custom']      = $order->getVar('cmd_id');
-        //$ret['rm'] = 2;   // Resend data by POST (normally)
-        $ret['email'] = $order->getVar('cmd_email');
+        //$ret['custom']      = $order->getVar('cmd_id');
+        $ret['email']       = $order->getVar('cmd_email');
+
         if ('' !== xoops_trim($order->getVar('cmd_cancel'))) {
             // URL to which the client's browser is brought back if the payment is canceled
             $ret['cancel_return'] = OLEDRION_URL . 'cancel-payment.php?id=' . $order->getVar('cmd_cancel');
@@ -247,19 +243,19 @@
         $db                     = \XoopsDatabaseFactory::getDatabaseConnection();
         $gatewaysOptionsHandler = new Oledrion\GatewaysOptionsHandler($db);
         $test_mode              = (int)$gatewaysOptionsHandler->getGatewayOptionValue($this->gatewayInformation['foldername'], 'paypal_test');
+
         if (1 === $test_mode) {
             return 'www.sandbox.paypal.com';
         }
-
         return 'www.paypal.com';
     }
-
     /**
      * Dialogue with the payment gateway to indicate the status of the order
      * The caller is responsible for checking that the log file exists
      *
      * @param  string $gatewaysLogPath The full path to the log file
      */
+
     public function gatewayNotify($gatewaysLogPath)
     {
         $db                     = \XoopsDatabaseFactory::getDatabaseConnection();
@@ -269,15 +265,15 @@
         error_reporting(0);
         @$xoopsLogger->activated = false;
 
-        $log     = '';
+        $log .= str_repeat('-', 80) . "\n";
         $req     = 'cmd=_notify-validate';
         $slashes = get_magic_quotes_gpc();
         foreach ($_POST as $key => $value) {
             if ($slashes) {
-                $log   .= "$key=" . stripslashes($value) . "\n";
+                //$log   .= "$key=" . stripslashes($value) . "\n";
                 $value = urlencode(stripslashes($value));
             } else {
-                $log   .= "$key=" . $value . "\n";
+                //$log   .= "$key=" . $value . "\n";
                 $value = urlencode($value);
             }
             $req .= "&$key=$value";
@@ -298,8 +294,7 @@
             fwrite($fp, "$header$req");
             while (!feof($fp)) {
                 $res = fgets($fp, 1024);
-                if (0 === strcmp(trim($res), 'VERIFIED')) {
-                    $log      .= "PAYPAL VERIFIED\n";
+                if ( 'VERIFIED' == mb_strtoupper($_POST['payer_status']) ) {
                     $paypalok = true;
                     if ('COMPLETED' !== mb_strtoupper($_POST['payment_status'])) {
                         $paypalok = false;
@@ -310,151 +305,130 @@
                     if (mb_strtoupper($_POST['mc_currency']) != mb_strtoupper($paypal_money)) {
                         $paypalok = false;
                     }
-                    if (!$_POST['custom']) {
+                    if (!$_POST['item_number']) {
                         $paypalok = false;
                     }
-                    $montant = $_POST['mc_gross'];
 
-                    //R.B. start
-                    $ref      = (int)$_POST['custom']; // Order number
+                    $montant = $_POST['mc_gross'];
+                    $ref = (int)$_POST['item_number']; // Order number
+                    $log .= sprintf("PAYPAL VERIFIED, paypalok: %d, order: %d\n", $paypalok, $ref);
                     $commande = null;
                     $commande = $commandsHandler->get($ref);
 
                     if (!is_object($commande)) {
-                        // TODO: Why is this failing?
+                        // TODO: Why is this failing? Order not exist in db
                         // TODO: Is there a more appropriate response code?
-                        //header("HTTP/1.1 500 Internal Server Error");
+                        // header("HTTP/1.1 500 Internal Server Error");
                         http_response_code(500);
-                        $log .= sprintf("not_object: %d\n", $ref);
-                        file_put_contents($gatewaysLogPath, $log, FILE_APPEND | LOCK_EX);
-
-                        return;
-                    }
-                    //R.B. end
-                    $pid = pcntl_fork();
-                    switch ($pid) {
-                        case -1:
-                            die('could not fork');
-                            break;
-                        case 0:
-                            // In the new (child) process
-
-                            // At this point, all PayPal session variables collected, done Paypal session
-                            // Rest of transaction can be processed offline to decouple site load from Paypal transaction time
-                            // PayPal requires this session to return within 30 seconds, or will retry
-                            $PayPalEndTime = microtime(true);
-                            if ($paypalok) {
-                                /* R.B. start
-                                                                $ref      = \Xmf\Request::getInt('custom', 0, 'POST'); // Numéro de la commande
-                                                                $commande = null;
-                                                                $commande = $commandsHandler->get($ref);
-                                                                if (is_object($commande)) {
-                                                                 */ //R.B. end
-
-                                if ($montant == $commande->getVar('cmd_total')) {
-                                    // Verified order
-                                    $email_name = sprintf('%s/%d%s', OLEDRION_UPLOAD_PATH, $commande->getVar('cmd_id'), OLEDRION_CONFIRMATION_EMAIL_FILENAME_SUFFIX);
-                                    if (file_exists($email_name)) {
-                                        $commandsHandler->validateOrder($commande); // Validation of the order and inventory update
-                                        $msg = [];
-                                        $msg = unserialize(file_get_contents($email_name));
-                                        // Add Transaction ID variable to email variables for templates
-                                        $msg['TRANSACTION_ID'] = $_POST['txn_id'];
-                                        // Send confirmation email to user
-                                        $email_address = $commande->getVar('cmd_email');
-                                        Oledrion\Utility::sendEmailFromTpl('command_client.tpl', $email_address, sprintf(_OLEDRION_THANKYOU_CMD, $xoopsConfig['sitename']), $msg);
-                                        // Send mail to admin
-                                        Oledrion\Utility::sendEmailFromTpl('command_shop.tpl', Oledrion\Utility::getEmailsFromGroup(Oledrion\Utility::getModuleOption('grp_sold')), _OLEDRION_NEW_COMMAND, $msg);
-
-                                        //R.B. start
-                                        // TODO: add transaction ID to SMS and online user invoice
-                                        // Update user database
-                                        if (file_exists(OLEDRION_DB_UPDATE_SCRIPT)) {
-                                            include OLEDRION_DB_UPDATE_SCRIPT;
-                                            $product_ids = $_POST['item_name'];
-                                            $products    = [];
-                                            $products    = explode(',', $product_ids);
-                                            foreach ($products as $item) {
-                                                $product_id = $item;
-                                                // updateDB($product_id, $user_id, $transaction_id);
-                                                $log .= updateDB($product_id, $_POST['receiver_email'], $_POST['txn_id']);
-                                            }
-                                        }
-                                        //R.B. end
-
-                                        if (false === @unlink($email_name)) {
-                                            throw new \RuntimeException('The file ' . $email_name . ' could not be deleted.');
-                                        }
-                                    } else {
-                                        $duplicate_ipn = 1;
+                        $log .= sprintf("is not_object: %d\n", $ref);
+			fclose($fp);
+                        return $log;
+                    }
+                    if ($paypalok) {
+                        if ($montant == $commande->getVar('cmd_total')) {
+                            // Verified order
+                            $email_name = sprintf('%s/%d%s', OLEDRION_UPLOAD_PATH, $commande->getVar('cmd_id'), OLEDRION_CONFIRMATION_EMAIL_FILENAME_SUFFIX);
+                            // Check if order exists in DB and is already validated (cmd_state=1)
+                            $sql = 'SELECT * FROM ' . $db->prefix('oledrion_commands') . ' WHERE cmd_id=' . (int)$ref . ' AND cmd_state=1';
+                            $result = $db->queryF($sql);
+                            //if ( file_exists($email_name)) {
+                            if ( $db->getRowsNum($result) == 0 ) {
+                                $commandsHandler->validateOrder($commande); // Validation of the order and inventory update
+                                $msg = [];
+                                $msg = unserialize(file_get_contents($email_name));
+                                // Add Transaction ID variable to email variables for templates
+                                $msg['TRANSACTION_ID'] = $_POST['txn_id'];
+                                $msg['NOTE'] = $commande->getVar('cmd_note');
+                                // Send confirmation email to user
+                                $email_address = $commande->getVar('cmd_email');
+                                Oledrion\Utility::sendEmailFromTpl('command_client.tpl', $email_address, sprintf(_OLEDRION_THANKYOU_CMD, $xoopsConfig['sitename']), $msg);
+                                // Send confirmation email to admin
+                                $grp_sold = Oledrion\Utility::getModuleOption('grp_sold');
+                                // Find users belonging to $grp_sold
+                                $grp_sold_user_ids = [];
+                                $sql = 'SELECT uid FROM ' . $db->prefix('groups_users_link') . ' WHERE groupid=' . $grp_sold;
+                                $result_sql = $db->queryF($sql);
+                                if ($result_sql) {
+                                    while ($myrow = $db->fetchArray($result_sql)) {
+                                        $grp_sold_user_ids[] = $myrow['uid'];
                                     }
-                                } else {
-                                    $commandsHandler->setFraudulentOrder($commande);
                                 }
-                            } else {
-                                //R.B. start
-                                // $log .= "not_object\n";
-                                //  }
-                                // } else {
-                                //R.B. end
-                                $log .= "paypal not OK\n";
-                                if (\Xmf\Request::hasVar('custom', 'POST')) {
-                                    // R.B. start
-                                    // $ref      = \Xmf\Request::getInt('custom', 0, 'POST');
-                                    // $commande = null;
-                                    // $commande = $commandsHandler->get($ref);
-                                    // if (is_object($commande)) {
-                                    //R.B. end
-                                    switch (mb_strtoupper($_POST['payment_status'])) {
-                                        case 'PENDING':
-                                            $commandsHandler->setOrderPending($commande);
-                                            break;
-                                        case 'FAILED':
-                                            $commandsHandler->setOrderFailed($commande);
-                                            break;
-                                        // R.B. }
+                                // Find emails of users belonging to $grp_sold_user_ids
+                                $admin_emails = [];
+                                $sql = 'SELECT email FROM ' . $db->prefix('users') . ' WHERE uid IN (' . implode(",", $grp_sold_user_ids) . ')';
+                                $result_sql = $db->queryF($sql);
+                                if ($result_sql) {
+                                    while ($myrow = $db->fetchArray($result_sql)) {
+                                        $admin_emails[] = $myrow['email'];
                                     }
                                 }
-                            }
-                            // Write to the log file
-                            $logfp = fopen($gatewaysLogPath, 'ab');
-                            if ($logfp) {
-                                if ($duplicate_ipn) {
-                                    fwrite($logfp, sprintf("Duplicate paypal IPN, order: %d\n", $commande->getVar('cmd_id')));
-                                } else {
-                                    fwrite($logfp, str_repeat('-', 120) . "\n");
-                                    fwrite($logfp, date('d/m/Y H:i:s') . "\n");
-                                    if (\Xmf\Request::hasVar('txn_id', 'POST')) {
-                                        fwrite($logfp, 'Transaction : ' . $_POST['txn_id'] . "\n");
+                                Oledrion\Utility::sendEmailFromTpl('command_shop.tpl', $admin_emails, _OLEDRION_NEW_COMMAND, $msg);
+                                // TODO: add transaction ID to SMS and online user invoice
+                                // Update user database
+                                if (file_exists(OLEDRION_DB_UPDATE_SCRIPT)) {
+                                    include OLEDRION_DB_UPDATE_SCRIPT;
+                                    $product_ids = $_POST['item_name'];
+                                    $products    = [];
+                                    $products    = explode(',', $product_ids);
+                                    foreach ($products as $item) {
+                                        $log .= updateDB($item, $_POST['receiver_email'], $_POST['txn_id']);
                                     }
-                                    fwrite($logfp, 'Result : ' . $log . "\n");
                                 }
-                                $executionEndTime = microtime(true);
-                                $PayPalSeconds    = $PayPalEndTime - $executionStartTime;
-                                $TotalSeconds     = $executionEndTime - $executionStartTime;
-                                fwrite($logfp, "Paypal session took $PayPalSeconds, Total transaction took $TotalSeconds seconds.\n");
-                                fclose($logfp);
-                            }
+                                if (false === @unlink($email_name)) {
+                                    $log .= "Cannot delete email: " . $_POST['txn_id'] . "\n";
+                                    throw new \RuntimeException('The file ' . $email_name . ' could not be deleted.');
+                                }
 
-                            break;
-                        default:
-                            // In the main (parent) process in which the script is running
-
-                            // At this point, all PayPal session variables collected, done Paypal session
-                            // Rest of transaction can be proccessed offline to decouple Paypal transaction time from site load
-                            // PayPal requires this session to return within 30 seconds, or will retry
 
-                            return;
-                            break;
+
+                            } else {
+                                // If transaction already complete in DB, already processed and email deleted
+                                $duplicate_ipn = 1;
+                            }
+                        } else {
+                            $log .= "Fraudulent order\n";
+                            $commandsHandler->setFraudulentOrder($commande);
+                        }
+                    } else {
+                        $log .= "Paypal not OK\n";
+                        if (\Xmf\Request::hasVar('item_number', 'POST')) {
+                            switch (mb_strtoupper($_POST['payment_status'])) {
+                                case 'PENDING':
+                                    $log .= "Order pending\n";
+                                    $commandsHandler->setOrderPending($commande);
+                                    break;
+                                case 'FAILED':
+                                    $log .= "Order failed\n";
+                                    $commandsHandler->setOrderFailed($commande);
+                                    break;
+                            }
+                        }
                     }
+                    $log .= date('d/m/Y H:i:s') . "\n";
+                    if ($duplicate_ipn) {
+                        $log .= sprintf("Duplicate paypal IPN, order: %d\n", $commande->getVar('cmd_id'));
+                    } else {
+                        if (\Xmf\Request::hasVar('txn_id', 'POST')) {
+                            $log .= 'Transaction : ' . $_POST['txn_id'] . "\n";
+                        }
+                    }                            
+                    $executionEndTime = microtime(true);
+                    $TotalSeconds     = $executionEndTime - $executionStartTime;
+                    $log       .= "Paypal transaction took $TotalSeconds seconds.\n";
+                    // PayPal requires this session to return within 30 seconds, or will retry
+                    $log .= "Dialog with payment gateway complete\n";
+                    fclose($fp); 
+                    return $log;
                 } else {
-                    $log .= "$res\n";
+                    $log .= $_POST['item_number'] . "Not Verified, _POST: " . print_r($_POST,true) . "\n";
+                    $log .= $_POST['item_number'] . "Not Verified, result: " . print_r($res,true) . "\n";
                 }
             }
             fclose($fp);
         } else {
-            $errtext = "Error with the fsockopen function, unable to open communication ' : ($errno) $errstr\n";
-            file_put_contents($gatewaysLogPath, $errtext, FILE_APPEND | LOCK_EX);
+            $log .= "Error with the fsockopen function, unable to open communication ' : ($errno) $errstr\n";
         }
+        return $log;
     }
 }
+?>
Binary files oledrion-2.35_RC1/class/Gateways/pec24.tar.gz and oledrion-2.35_RC2/class/Gateways/pec24.tar.gz differ
diff -ruN oledrion-2.35_RC1/class/Gateways.php oledrion-2.35_RC2/class/Gateways.php
--- oledrion-2.35_RC1/class/Gateways.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/class/Gateways.php	2019-12-13 14:50:02.020939173 -0500
@@ -197,10 +197,9 @@
      */
     public static function gatewayClassName($gatewayName)
     {
-        //        return 'oledrion_' . $gatewayName;
-        return $gatewayName;
+        return 'XoopsModules\Oledrion\Gateways\\' . $gatewayName . '\\' . $gatewayName . 'Gateway';
     }
-
+ 
     /**
      * Indicates whether the payment gateway class exists
      *
@@ -209,11 +208,10 @@
      */
     public static function gatewayClassExists($gatewayName)
     {
-        $gatewayClassName = self::gatewayClassName($gatewayName);
+	$gatewayClassName = self::gatewayClassName($gatewayName);
         if (class_exists($gatewayClassName)) {
             return true;
         }
-
         return false;
     }
 
@@ -271,3 +269,4 @@
         return null;
     }
 }
+
diff -ruN oledrion-2.35_RC1/class/Products.php oledrion-2.35_RC2/class/Products.php
--- oledrion-2.35_RC1/class/Products.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/class/Products.php	2019-12-13 14:50:02.019939584 -0500
@@ -54,11 +54,9 @@
         $this->initVar('product_thumb_url', XOBJ_DTYPE_TXTBOX, null, false);
         $this->initVar('product_submitter', XOBJ_DTYPE_INT, null, false);
         $this->initVar('product_online', XOBJ_DTYPE_INT, null, false);
-        // B.R. Start
         $this->initVar('skip_packing', XOBJ_DTYPE_INT, null, false);
         $this->initVar('skip_location', XOBJ_DTYPE_INT, null, false);
         $this->initVar('skip_delivery', XOBJ_DTYPE_INT, null, false);
-        // B.R. End
         $this->initVar('product_date', XOBJ_DTYPE_TXTBOX, null, false);
         $this->initVar('product_submitted', XOBJ_DTYPE_INT, null, false);
         $this->initVar('product_hits', XOBJ_DTYPE_INT, null, false);
@@ -354,13 +352,9 @@
         if (0 == $product_id && '' === $product_title) {
             $product_id    = $this->getVar('product_id');
             $product_title = $this->getVar('product_title', 'n');
-            // B.R. New
-            $product_url = $this->getVar('product_url3', 'n');
-            // End New
+            $product_url   = $this->getVar('product_url3', 'n');
         }
-        // B.R. New
         if (empty($product_url)) {
-            // End New
             if (1 == Oledrion\Utility::getModuleOption('urlrewriting')) {
                 // On utilise l'url rewriting
                 if (!$shortVersion) {
@@ -376,11 +370,9 @@
                     $url = 'product.php?product_id=' . $product_id;
                 }
             }
-            // B.R. New
         } else {
             $url = '../' . $product_url;
         }
-        // B.R. End New
         return $url;
     }
 
diff -ruN oledrion-2.35_RC1/class/Reductions.php oledrion-2.35_RC2/class/Reductions.php
--- oledrion-2.35_RC1/class/Reductions.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/class/Reductions.php	2019-12-13 14:50:02.043929730 -0500
@@ -103,9 +103,6 @@
     // Montant total de la commande avant les réductions
     private $totalAmountBeforeDiscounts = 0;
 
-    // Handlers vers les tables du module
-    //    private $handlers;
-
     // Les fabricants associés aux produits du panier
     private $associatedManufacturers = [];
 
@@ -126,17 +123,12 @@
      */
     public function __construct()
     {
-        $this->initHandlers();
         $this->loadAllActiveRules();
     }
 
     /**
      * Chargement des handlers
      */
-    private function initHandlers()
-    {
-        //        $this->handlers = HandlerManager::getInstance();
-    }
 
     /**
      * Chargement de toutes les règles actives de réductions (sans date définie ou avec une période correspondante à aujourd'hui)
@@ -156,8 +148,6 @@
         $critere2->add(new \Criteria('disc_date_to', time(), '>='));
         $critere->add($critere2, 'OR');
 
-        //        $this->allActiveRules = $this->handlers->h_oledrion_discounts->getObjects($critere);
-        //        $this->allActiveRules = $this->handlers->DiscountsHandler->getObjects($critere);
         $discountsHandler     = new Oledrion\DiscountsHandler($xoopsDB);
         $this->allActiveRules = $discountsHandler->getObjects($critere);
     }
@@ -290,7 +280,6 @@
         if (count($this->associatedCategories) > 0) {
             sort($this->associatedCategories);
             $ids = $this->associatedCategories;
-            //mb            $this->associatedCategories = $this->handlers->h_oledrion_cat->getCategoriesFromIds($ids);
             $db                         = \XoopsDatabaseFactory::getDatabaseConnection();
             $categoryHandler            = new Oledrion\CategoryHandler($db);
             $this->associatedCategories = $categoryHandler->getCategoriesFromIds($ids);
@@ -406,14 +395,13 @@
      * @param float  $commandAmountTTC      Montant TTC de la commande
      * @param array  $discountsDescription  Descriptions des remises GLOBALES appliquées (et pas les remises par produit !)
      * @param int    $discountsCount        Le nombre TOTAL de réductions appliquées (individuellement ou sur la globalité du panier)
-     *                                      B.R. @param array $checkoutAttributes
+     *                                      @param array $checkoutAttributes
      *                                      TODO: Passer les paramètres sous forme d'objet
      * @param mixed  $emptyCart
      * @param mixed  $checkoutAttributes
      * @return bool
      */
 
-    // B.R. Added: $checkoutAttributes
     public function computeCart(
         &$cartForTemplate,
         &$emptyCart,
@@ -424,7 +412,7 @@
         &$commandAmountTTC,
         &$discountsDescription,
         &$discountsCount,
-        &$checkoutAttributes)// B.R.
+        &$checkoutAttributes)
 
     {
         $emptyCart      = false;
@@ -484,7 +472,6 @@
             $totalPrice = 0.0;
             $reduction  = '';
 
-            // B.R. Start
             // If any product in cart does not skip optional checkout step, need to perform
             if (0 == $cartProduct['product']->getVar('skip_packing', 'n')) {
                 $checkoutAttributes['skip_packing'] = 0;
@@ -495,13 +482,11 @@
             if (0 == $cartProduct['product']->getVar('skip_delivery', 'n')) {
                 $checkoutAttributes['skip_delivery'] = 0;
             }
-            // B.R. End
 
             ++$cpt;
             if ($cpt == $caddyCount) {
                 // On arrive sur le dernier produit
                 $category = null;
-                //mb                $category = $this->handlers->h_oledrion_cat->get($cartProduct['product']->getVar('product_cid'));
                 $category = $categoryHandler->get($cartProduct['product']->getVar('product_cid'));
                 if (is_object($category)) {
                     $goOn = $category->getLink();
@@ -756,7 +741,6 @@
             $productTemplate['discountedPriceWithQuantityFormated'] = $oledrionCurrency->amountForDisplay($discountedPrice * $quantity);
             // Prix HT AVEC réduction et la quantité
 
-            // Add by voltan
             $productTemplate['discountedPriceFormatedOrg'] = $oledrionCurrency->amountForDisplay($ht - $discountedPrice);
             $productTemplate['discountedPriceOrg']         = $ht - $discountedPrice;
 
diff -ruN oledrion-2.35_RC1/class/Utility.php oledrion-2.35_RC2/class/Utility.php
--- oledrion-2.35_RC1/class/Utility.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/class/Utility.php	2019-12-15 04:33:00.643765602 -0500
@@ -169,8 +169,6 @@
         $editor_configs['height'] = '400px';
 
         $editor_option = mb_strtolower(static::getModuleOption('editorAdmin'));
-        //        $editor = new \XoopsFormEditor($caption, $editor_option, $editor_configs);
-        //        public function __construct($caption, $name, $configs = null, $nohtml = false, $OnFailure = '')
 
         if ($helper->isUserAdmin()) {
             $editor = new \XoopsFormEditor($caption, $helper->getConfig('editorAdmin'), $editor_configs, $nohtml = false, $onfailure = 'textarea');
@@ -221,7 +219,7 @@
             $proxy_ip = $_SERVER['HTTP_COMING_FROM'];
         }
         $regs = [];
-        //if (!empty($proxy_ip) && $is_ip = ereg('^([0-9]{1,3}\.){3,3}[0-9]{1,3}', $proxy_ip, $regs) && count($regs) > 0) {
+
         if (!empty($proxy_ip) && filter_var($proxy_ip, FILTER_VALIDATE_IP) && count($regs) > 0) {
             $the_IP = $regs[0];
         } else {
@@ -307,7 +305,7 @@
         }
         $res = $xoopsMailer->send();
         unset($xoopsMailer);
-        // B.R. $filename = XOOPS_UPLOAD_PATH . '/logmail_' . static::MODULE_NAME . '.php';
+
         $filename = OLEDRION_UPLOAD_PATH . '/logmail_' . static::MODULE_NAME . '.php';
         if (!file_exists($filename)) {
             $fp = @fopen($filename, 'ab');
@@ -445,7 +443,6 @@
         /** @var \XoopsMemberHandler $memberHandler */
         $memberHandler = xoops_getHandler('member');
         $users         = $memberHandler->getUsersByGroup($groupId, true);
-
         return $users;
     }
 
@@ -458,7 +455,7 @@
      */
     public static function getEmailsFromGroup($groupId)
     {
-        $ret   = [];
+        $ret = [];
         $users = static::getUsersFromGroup($groupId);
         foreach ($users as $user) {
             $ret[] = $user->getVar('email');
@@ -948,7 +945,6 @@
         $content = preg_replace('/[[:punct:]]/i', '', $content);
 
         // Selon option mais attention au fichier .htaccess !
-        // $content = eregi_replace('[[:digit:]]','', $content);
         $content = preg_replace('/[^a-z|A-Z|0-9]/', '-', $content);
 
         $words    = explode(' ', $content);
@@ -1127,7 +1123,6 @@
         $maxWidth = null,
         $maxHeight = null)
     {
-        //        require_once XOOPS_ROOT_PATH . '/class/uploader.php';
         global $destname;
         if (\Xmf\Request::hasVar('xoops_upload_file', 'POST')) {
             require_once XOOPS_ROOT_PATH . '/class/uploader.php';
@@ -1147,7 +1142,6 @@
                     $uploadSize = static::getModuleOption('maxuploadsize');
                 }
                 $uploader = new \XoopsMediaUploader($dstpath, $permittedtypes, $uploadSize, $maxWidth, $maxHeight);
-                //$uploader->allowUnknownTypes = true;
                 $uploader->setTargetFileName($destname);
                 if ($uploader->fetchMedia($_POST['xoops_upload_file'][$indice])) {
                     if ($uploader->upload()) {
@@ -1185,12 +1179,10 @@
         $keep_original = false,
         $fit = 'inside')
     {
-        //        require_once OLEDRION_PATH . 'class/wideimage/WideImage.inc.php';
         $resize = true;
         if (OLEDRION_DONT_RESIZE_IF_SMALLER) {
             if (false === @getimagesize($src_path)) {
                 $message = 'The picture ' . $src_path . ' could not be found and resized.';
-                //                throw new \RuntimeException($message);
                 self::redirect($message);
 
                 return false;
@@ -1450,7 +1442,6 @@
         if (is_array($vats) && in_array($vat_id, $vats)) {
             $vat_rate = $vats[$vat_id];
         } else {
-            //            $handlers = \HandlerManager::getInstance();
             require_once dirname(__DIR__) . '/include/common.php';
             $vat = $vatHandler->get($vat_id);
             if (is_object($vat)) {
diff -ruN oledrion-2.35_RC1/config.php oledrion-2.35_RC2/config.php
--- oledrion-2.35_RC1/config.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/config.php	2019-12-13 14:50:02.067919873 -0500
@@ -44,7 +44,6 @@
     define('OLEDRION_ADMIN_PATH', OLEDRION_PATH . 'admin' . '/');
 
     // Set gateways path
-    //    define('OLEDRION_GATEWAY_PATH', OLEDRION_ADMIN_PATH . 'gateways' . '/');
     define('OLEDRION_GATEWAY_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/class/Gateways' . '/');
 
     // Set plugin URL and PATH
@@ -96,12 +95,11 @@
     define('OLEDRION_CSV_SEP', ';');
 
     // Gateway log's path (must be writable)
-    // B.R. define('OLEDRION_GATEWAY_LOG_PATH', XOOPS_UPLOAD_PATH . '/oledrion/loggateway_oledrion.php');
     define('OLEDRION_GATEWAY_LOG_PATH', XOOPS_UPLOAD_PATH . '/oledrion/gateway_log.php');
-    // B.R New: Filename of serialized confirmation email parameters
+    // Filename of serialized confirmation email parameters
     define('OLEDRION_CONFIRMATION_EMAIL_FILENAME_SUFFIX', '_conf_email.parms');
 
-    // B.R. New: Absolute path and filename of optional database update script
+    // Absolute path and filename of optional database update script
     // Must be located outside DOCUMENT_ROOT and change permissions to 'rwxr-x--x'
     define('OLEDRION_DB_UPDATE_SCRIPT', '/home/e-smith/files/ibays/rossco/license_server/update_licenseDB.php');
 
diff -ruN oledrion-2.35_RC1/docs/changelog.txt oledrion-2.35_RC2/docs/changelog.txt
--- oledrion-2.35_RC1/docs/changelog.txt	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/docs/changelog.txt	2019-12-15 04:31:00.682584259 -0500
@@ -1,3 +1,18 @@
+<h5>2.35  RC-2                  [NOT RELEASED]</h5>  Dev: XOOPS 2.5.9, PHP 7.3.5
+- rossbcan: www.rossco.org
+- cleaned up dead / commented code
+- changed minimum xoops version to 2.5.9
+- re-worked gateway / paypal code
+- fixed gateway classname bug
+- fixed paypal intermittent failures due to pcntl_fork child losing DB connection at parent exit
+- added "Note to Vendor" field in checkout and email templates - persian not done
+- (sql init) changed product_recommended DATETIME init value to '1970-01-01 00:00:01' for broader DB compatability
+- added example DB update script (update_sales.php) for updating other DB's when product is sold (OLEDRION_DB_UPDATE_SCRIPT)
+- (sql/mysql.sql) pre-populated several db tables: missing, no UI or UI failure at entry
+- fgrep -r "TODO" modules/oledrion for to do suggestions
+- this module needs major theming updates - make it pretty
+- "somebody" needs to document paypal account setup
+
 <h5>2.35  RC-1                  [NOT RELEASED]</h5>  Dev: XOOPS 2.5.10, PHP 7.3.5
 <hr>
 - fixed adding product (yourdal/mamba)
diff -ruN oledrion-2.35_RC1/gateway-notify.php oledrion-2.35_RC2/gateway-notify.php
--- oledrion-2.35_RC1/gateway-notify.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/gateway-notify.php	2019-12-13 14:50:01.990951494 -0500
@@ -18,22 +18,25 @@
  */
 
 /**
- * Page appelée par la passerelle de paiement dans le cas de l'utilisation de l'IPN (ou d'une méthode similaire)
- * Dialogue entre le site et la passerelle
+ * Page called by the payment gateway in the case of using IPN (or similar method)
+ * Dialogue between the site and the payment gateway
  */
+
 @error_reporting(0);
 @$xoopsLogger->activated = false;
 require_once __DIR__ . '/header.php';
 @error_reporting(0);
 @$xoopsLogger->activated = false;
-$gateway          = \XoopsModules\Oledrion\Gateways::getCurrentGateway();
+if (!file_exists(OLEDRION_GATEWAY_LOG_PATH)) {
+    file_put_contents(OLEDRION_GATEWAY_LOG_PATH, "<?php exit(); ?>\n", LOCK_EX);
+}
 $temporaryGateway = null;
 $temporaryGateway = \XoopsModules\Oledrion\Gateways::getGatewayObject();
 if (is_object($temporaryGateway)) {
-    if (!file_exists(OLEDRION_GATEWAY_LOG_PATH)) {
-        file_put_contents(OLEDRION_GATEWAY_LOG_PATH, '<?php exit(); ?>', LOCK_EX);
-    }
-    $user_log = $temporaryGateway->gatewayNotify(OLEDRION_GATEWAY_LOG_PATH);
+    $user_log .= $temporaryGateway->gatewayNotify(OLEDRION_GATEWAY_LOG_PATH);
     unset($temporaryGateway);
-    echo $user_log;
+} else {
+    $user_log .= "Could not instantiate Gateway\n";
 }
+file_put_contents(OLEDRION_GATEWAY_LOG_PATH, $user_log, FILE_APPEND | LOCK_EX);
+echo $user_log;
diff -ruN oledrion-2.35_RC1/include/common.php oledrion-2.35_RC2/include/common.php
--- oledrion-2.35_RC1/include/common.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/include/common.php	2019-12-13 14:50:02.066920283 -0500
@@ -21,7 +21,6 @@
 use XoopsModules\Oledrion\Plugins\Models;
 
 require_once dirname(__DIR__) . '/preloads/autoloader.php';
-//require_once  dirname(__DIR__) . '/config.php';
 
 $moduleDirName      = basename(dirname(__DIR__));
 $moduleDirNameUpper = mb_strtoupper($moduleDirName); //$capsDirName
@@ -32,7 +31,6 @@
 $db      = \XoopsDatabaseFactory::getDatabaseConnection();
 $helper  = Oledrion\Helper::getInstance();
 $utility = new Oledrion\Utility();
-//$configurator = new Oledrion\Common\Configurator();
 
 $helper->loadLanguage('common');
 $helper->loadLanguage('main');
@@ -51,48 +49,25 @@
     define($moduleDirNameUpper . '_PLUGINS_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/plugins/');
     define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
     define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
-    //    define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . constant($moduleDirNameUpper . '_DIRNAME'));
     define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
-    //    define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
     define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
     define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
     define($moduleDirNameUpper . '_CACHE_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/' . 'cache/');
     define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', $pathIcon32 . '/xoopsmicrobutton.gif');
     define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
 
-    // Define oledrion URL and PATH
-    //    define('OLEDRION_URL', XOOPS_URL . '/modules/' . OLEDRION_DIRNAME . '/');
-    //    define('OLEDRION_PATH', XOOPS_ROOT_PATH . '/modules/' . OLEDRION_DIRNAME . '/');
-
-    // Set class path
-    //    define('OLEDRION_CLASS_PATH', OLEDRION_PATH . 'class/');
-
-    // Set image , js and css url
-    //    define('OLEDRION_IMAGES_URL', OLEDRION_URL . 'assets/images/');
     define('OLEDRION_JS_URL', OLEDRION_URL . 'assets/js/');
     define('OLEDRION_CSS_URL', OLEDRION_URL . 'assets/css/');
 
-    // Set admin URL and PATH
-    //    define('OLEDRION_ADMIN_URL', OLEDRION_URL . 'admin/');
-    //    define('OLEDRION_ADMIN_PATH', OLEDRION_PATH . 'admin' . '/');
-
     // Set gateways path
     define('OLEDRION_GATEWAY_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/class/Gateways' . '/');
 
-    // Set plugin URL and PATH
-    //    define('OLEDRION_PLUGINS_PATH', OLEDRION_PATH . 'plugins/');
+    // Set plugin URL
     define('OLEDRION_PLUGINS_URL', OLEDRION_URL . 'plugins/');
 
     // Set text path
     define('OLEDRION_TEXT_PATH', XOOPS_UPLOAD_PATH . '/' . OLEDRION_DIRNAME . '/' . 'text/');
 
-    // Set cache path
-    //    define('OLEDRION_CACHE_PATH', XOOPS_UPLOAD_PATH . '/' . OLEDRION_DIRNAME . '/' . 'cache/');
-
-    // Define here the place where main upload path
-    //    define('OLEDRION_UPLOAD_URL', XOOPS_UPLOAD_URL . '/oledrion'); // WITHOUT Trailing slash
-    //    define('OLEDRION_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/oledrion'); // WITHOUT Trailing slash
-
     // Define here the place where files attached to products are saved
     define('OLEDRION_ATTACHED_FILES_URL', XOOPS_UPLOAD_URL . '/oledrion/attached'); // WITHOUT Trailing slash
     define('OLEDRION_ATTACHED_FILES_PATH', XOOPS_UPLOAD_PATH . '/oledrion/attached'); // WITHOUT Trailing slash
@@ -124,12 +99,11 @@
     define('OLEDRION_CSV_SEP', ';');
 
     // Gateway log's path (must be writable)
-    // B.R. define('OLEDRION_GATEWAY_LOG_PATH', XOOPS_UPLOAD_PATH . '/oledrion/loggateway_oledrion.php');
     define('OLEDRION_GATEWAY_LOG_PATH', XOOPS_UPLOAD_PATH . '/oledrion/gateway_log.php');
-    // B.R New: Filename of serialized confirmation email parameters
+    // Filename of serialized confirmation email parameters
     define('OLEDRION_CONFIRMATION_EMAIL_FILENAME_SUFFIX', '_conf_email.parms');
 
-    // B.R. New: Absolute path and filename of optional database update script
+    // Absolute path and filename of optional database update script
     // Must be located outside DOCUMENT_ROOT and change permissions to 'rwxr-x--x'
     define('OLEDRION_DB_UPDATE_SCRIPT', '/home/e-smith/files/ibays/rossco/license_server/update_licenseDB.php');
 
@@ -193,29 +167,6 @@
     define('OLEDRION_SMS_GATEWAY', 'example');
 }
 
-//_CACHE_PATH  XOOPS_UPLOAD_PATH . '/' . OLEDRION_DIRNAME . '/' . 'cache/'
-//OLEDRION_PICTURES_URL
-//OLEDRION_SUMMARY_MAXLENGTH
-//OLEDRION_STRING_TO_JOIN_MANUFACTURERS
-
-// Classes for plugins
-//require_once OLEDRION_CLASS_PATH . 'Plugin.php'; // Main class
-//require_once OLEDRION_PLUGINS_PATH . 'models/Action.php'; // model
-//require_once OLEDRION_PLUGINS_PATH . 'models/Filter.php'; // model
-
-// Les classes métier ou utilitaires (non ORM)
-//require_once OLEDRION_CLASS_PATH . 'Utility.php';
-//require_once OLEDRION_CLASS_PATH . 'HandlerManager.php';
-//require_once OLEDRION_CLASS_PATH . 'Parameters.php';
-//require_once OLEDRION_CLASS_PATH . 'Currency.php';
-//require_once OLEDRION_CLASS_PATH . 'Shelf.php';
-//require_once OLEDRION_CLASS_PATH . 'ShelfParameters.php';
-//require_once OLEDRION_CLASS_PATH . 'oledrion_reductions.php';
-//require_once OLEDRION_CLASS_PATH . 'Gateways.php';
-//require_once OLEDRION_ADMIN_PATH . 'gateways/gateway.php'; // Abstract class
-//require_once OLEDRION_CLASS_PATH . 'Lists.php';
-//require_once OLEDRION_CLASS_PATH . 'Sms.php';
-
 $oledrionHandlers = Oledrion\HandlerManager::getInstance();
 
 $myts = \MyTextSanitizer::getInstance();
@@ -235,7 +186,6 @@
 $vatHandler             = new Oledrion\VatHandler($db);
 $vendorsHandler         = new Oledrion\VendorsHandler($db);
 $votedataHandler        = new Oledrion\VotedataHandler($db);
-// Added by voltan
 $attributesHandler       = new Oledrion\AttributesHandler($db);
 $caddyAttributesHandler  = new Oledrion\CaddyAttributesHandler($db);
 $deliveryHandler         = new Oledrion\DeliveryHandler($db);
@@ -252,15 +202,6 @@
 $shelfParameters = new Oledrion\ShelfParameters(); // Parameters of the facade
 
 // Definition of Images
-if (!defined('_OLEDRION_EDIT')) {
-    //    global $xoopsConfig;
-    //    if (file_exists(OLEDRION_PATH . 'language/' . $xoopsConfig['language'] . '/main.php')) {
-    //        include OLEDRION_PATH . 'language/' . $xoopsConfig['language'] . '/main.php';
-    //    } else {
-    //        include OLEDRION_PATH . 'language/english/main.php';
-    //    }
-    //    $helper->loadLanguage('main');
-}
 
 $pathIcon16 = \Xmf\Module\Admin::iconUrl('', 16);
 
@@ -281,17 +222,6 @@
 
 // Loading some preferences
 $mod_pref = [
-    //        'money_short'     => Oledrion\Utility::getModuleOption('money_short'),
-    //        'money_full'      => Oledrion\Utility::getModuleOption('money_full'),
-    //        'url_rewriting'   => Oledrion\Utility::getModuleOption('urlrewriting'),
-    //        'tooltip'         => Oledrion\Utility::getModuleOption('infotips'),
-    //        'advertisement'   => Oledrion\Utility::getModuleOption('advertisement'),
-    //        'rss'             => Oledrion\Utility::getModuleOption('use_rss'),
-    //        'nostock_msg'     => Oledrion\Utility::getModuleOption('nostock_msg'),
-    //        'use_price'       => Oledrion\Utility::getModuleOption('use_price'),
-    //        'restrict_orders' => Oledrion\Utility::getModuleOption('restrict_orders'),
-    //        'isAdmin'         => Oledrion\Utility::isAdmin()
-
     'money_short'     => $helper->getConfig('money_short'),
     'money_full'      => $helper->getConfig('money_full'),
     'url_rewriting'   => $helper->getConfig('urlrewriting'),
@@ -304,9 +234,6 @@
     'isAdmin'         => $helper->isUserAdmin(),
 ];
 
-//$pathModIcon16 = $helper->getModule()->getInfo('modicons16');
-//$pathModIcon32 = $helper->getModule()->getInfo('modicons32');
-
 $icons2 = [
     'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
     'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
diff -ruN oledrion-2.35_RC1/include/onupdate_old.php oledrion-2.35_RC2/include/onupdate_old.php
--- oledrion-2.35_RC1/include/onupdate_old.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/include/onupdate_old.php	1969-12-31 19:00:00.000000000 -0500
@@ -1,467 +0,0 @@
-<?php
-/*
- You may not change or alter any portion of this comment or credits
- of supporting developers from this source code or any supporting source code
- which is considered copyrighted (c) material of the original comment or credit authors.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-*/
-
-/**
- * oledrion
- *
- * @copyright   {@link https://xoops.org/ XOOPS Project}
- * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
- * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
- * @author      Hossein Azizabadi (azizabadi@faragostaresh.com)
- * @param $module
- * @param $version
- */
-
-use XoopsModules\Oledrion;
-
-/**
- * @param $module
- * @param $version
- */
-function xoops_module_update_oledrion($module, $version)
-{
-    global $xoopsDB;
-
-    // Présence des nouvelles tables et nouvelles zones dans la base de données
-    // Nouvelle table oledrion_gateways_options
-    $tableName = $xoopsDB->prefix('oledrion_gateways_options');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = 'CREATE TABLE ' . $tableName . " (
-                `option_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-                `option_gateway` VARCHAR(50) NOT NULL COMMENT 'nom de la passerelle de paiement',
-                `option_name` VARCHAR(50) NOT NULL,
-                `option_value` TEXT NOT NULL,
-                PRIMARY KEY  (`option_id`),
-                KEY `option_gateway` (`option_gateway`),
-                KEY `option_name` (`option_name`),
-                KEY `option_gateway_name` (`option_gateway`,`option_name`)
-                ) ENGINE=InnoDB";
-        $xoopsDB->queryF($sql);
-    }
-
-    // Nouveau champ cmd_comment dans Commands
-    $tableName = $xoopsDB->prefix('oledrion_commands');
-    if (!Oledrion\Utility::fieldExists('cmd_comment', $tableName)) {
-        Oledrion\Utility::addField('`cmd_comment` TEXT NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_vat_number', $tableName)) {
-        Oledrion\Utility::addField('`cmd_vat_number` VARCHAR( 255 ) NOT NULL', $tableName);
-    }
-
-    /**
-     * Nouvelle table oledrion_lists
-     * @since 2.2.2009.01.29
-     */
-    $tableName = $xoopsDB->prefix('oledrion_lists');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = 'CREATE TABLE ' . $tableName . ' (
-                `list_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-                `list_uid` MEDIUMINT(8) UNSIGNED NOT NULL,
-                `list_title` VARCHAR(255) NOT NULL,
-                `list_date` INT(10) UNSIGNED NOT NULL,
-                `list_productscount` MEDIUMINT(8) UNSIGNED NOT NULL,
-                `list_views` MEDIUMINT(8) UNSIGNED NOT NULL,
-                `list_password` VARCHAR(50) NOT NULL,
-                `list_type` TINYINT(3) UNSIGNED NOT NULL,
-                `list_description` TEXT NOT NULL,
-                PRIMARY KEY  (`list_id`),
-                KEY `list_uid` (`list_uid`)
-                ) ENGINE=InnoDB';
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Nouvelle table oledrion_lists
-     * @since 2.2.2009.01.29
-     */
-    $tableName = $xoopsDB->prefix('oledrion_products_list');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = 'CREATE TABLE ' . $tableName . ' (
-                `productlist_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-                `productlist_list_id` INT(10) UNSIGNED NOT NULL,
-                `productlist_product_id` INT(10) UNSIGNED NOT NULL,
-                PRIMARY KEY  (`productlist_id`),
-                KEY `productlist_list_id` (`productlist_list_id`),
-                KEY `productlist_product_id` (`productlist_product_id`)
-                ) ENGINE=InnoDB';
-        $xoopsDB->queryF($sql);
-    }
-
-    if (!Oledrion\Utility::fieldExists('productlist_date', $tableName)) {
-        Oledrion\Utility::addField('productlist_date DATE NOT NULL', $tableName);
-    }
-
-    /**
-     * Nouvelle table oledrion_attributes
-     * @since 2.3.2009.03.09
-     */
-    $tableName = $xoopsDB->prefix('oledrion_attributes');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = "CREATE TABLE `$tableName` (
-              `attribute_id` int(10) unsigned NOT NULL auto_increment,
-              `attribute_weight` mediumint(7) unsigned default NULL,
-              `attribute_title` varchar(255) default NULL,
-              `attribute_name` varchar(255) NOT NULL,
-              `attribute_type` tinyint(3) unsigned default NULL,
-              `attribute_mandatory` tinyint(1) unsigned default NULL,
-              `attribute_values` text,
-              `attribute_names` text,
-              `attribute_prices` text,
-              `attribute_stocks` text,
-              `attribute_product_id` int(11) unsigned default NULL,
-              `attribute_default_value` varchar(255) default NULL,
-              `attribute_option1` mediumint(7) unsigned default NULL,
-              `attribute_option2` mediumint(7) unsigned default NULL,
-              PRIMARY KEY  (`attribute_id`),
-              KEY `attribute_product_id` (`attribute_product_id`),
-              KEY `attribute_weight` (`attribute_weight`)
-            ) ENGINE=InnoDB;";
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Nouvelle table oledrion_caddy_attributes
-     * @since 2.3.2009.03.10
-     */
-    $tableName = $xoopsDB->prefix('oledrion_caddy_attributes');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = "CREATE TABLE `$tableName` (
-              `ca_id` int(10) unsigned NOT NULL auto_increment,
-              `ca_cmd_id` int(10) unsigned NOT NULL,
-              `ca_caddy_id` int(10) unsigned NOT NULL,
-              `ca_attribute_id` int(10) unsigned NOT NULL,
-              `ca_attribute_values` text NOT NULL,
-              `ca_attribute_names` text NOT NULL,
-              `ca_attribute_prices` text NOT NULL,
-              PRIMARY KEY  (`ca_id`),
-              KEY `ca_cmd_id` (`ca_cmd_id`),
-              KEY `ca_caddy_id` (`ca_caddy_id`),
-              KEY `ca_attribute_id` (`ca_attribute_id`)
-        ) ENGINE=InnoDB;";
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Augmentation des types numéraires pour accepter le million
-     * @since 2.3.2009.04.20
-     */
-    $definition = Oledrion\Utility::getFieldDefinition('product_price', $xoopsDB->prefix('oledrion_products'));
-    if ('' !== $definition) {
-        if ('decimal(7,2)' === xoops_trim($definition['Type'])) {
-            $tablesToUpdates = [
-                'oledrion_products'  => [
-                    'product_price',
-                    'product_shipping_price',
-                    'product_discount_price',
-                    'product_ecotaxe',
-                ],
-                'oledrion_caddy'     => ['caddy_price'],
-                'oledrion_commands'  => ['cmd_shipping'],
-                'oledrion_discounts' => [
-                    'disc_price_degress_l1total',
-                    'disc_price_degress_l2total',
-                    'disc_price_degress_l3total',
-                    'disc_price_degress_l4total',
-                    'disc_price_degress_l5total',
-                ],
-            ];
-            foreach ($tablesToUpdates as $tableName => $fields) {
-                foreach ($fields as $field) {
-                    $sql = 'ALTER TABLE ' . $xoopsDB->prefix($tableName) . ' CHANGE `' . $field . '` `' . $field . '` DECIMAL( 16, 2 ) NOT NULL';
-                    $xoopsDB->queryF($sql);
-                }
-            }
-        }
-    }
-
-    /**
-     * Add product_property
-     * @since 2.3.2012.08.03
-     */
-    $tableName = $xoopsDB->prefix('oledrion_products');
-    if (!Oledrion\Utility::fieldExists('product_property1', $tableName)) {
-        Oledrion\Utility::addField('`product_property1` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_property2', $tableName)) {
-        Oledrion\Utility::addField('`product_property2` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_property3', $tableName)) {
-        Oledrion\Utility::addField('`product_property3` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_property4', $tableName)) {
-        Oledrion\Utility::addField('`product_property4` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_property5', $tableName)) {
-        Oledrion\Utility::addField('`product_property5` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_property6', $tableName)) {
-        Oledrion\Utility::addField('`product_property6` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_property7', $tableName)) {
-        Oledrion\Utility::addField('`product_property7` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_property8', $tableName)) {
-        Oledrion\Utility::addField('`product_property8` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_property9', $tableName)) {
-        Oledrion\Utility::addField('`product_property9` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_property10', $tableName)) {
-        Oledrion\Utility::addField('`product_property10` varchar(255) NOT NULL', $tableName);
-    }
-
-    /**
-     * Nouvelle table oledrion_packing
-     * @since 2.3.4 2013.03.5
-     */
-    $tableName = $xoopsDB->prefix('oledrion_packing');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = "CREATE TABLE `$tableName` (
-              `packing_id` int(5) unsigned NOT NULL auto_increment,
-              `packing_title` varchar(255) NOT NULL default '',
-              `packing_width` varchar(50) NOT NULL,
-              `packing_length` varchar(50) NOT NULL,
-              `packing_weight` varchar(50) NOT NULL,
-              `packing_image` varchar(255) NOT NULL,
-              `packing_description` text,
-              `packing_price` decimal(16,2) NOT NULL,
-              `packing_online` tinyint(1) NOT NULL default '1',
-              PRIMARY KEY  (`packing_id`),
-              KEY `packing_title` (`packing_title`),
-              KEY `packing_online` (`packing_online`),
-              KEY `packing_price` (`packing_price`)
-            ) ENGINE=InnoDB;";
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Nouvelle table oledrion_location
-     * @since 2.3.4 2013.03.5
-     */
-    $tableName = $xoopsDB->prefix('oledrion_location');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = "CREATE TABLE `$tableName` (
-              `location_id` int(5) unsigned NOT NULL auto_increment,
-              `location_pid` int(5) unsigned NOT NULL default '0',
-              `location_title` varchar(255) NOT NULL default '',
-              `location_online` tinyint(1) NOT NULL default '1',
-              `location_type` enum('location','parent') NOT NULL,
-              PRIMARY KEY  (`location_id`),
-              KEY `location_title` (`location_title`),
-              KEY `location_pid` (`location_pid`),
-              KEY `location_online` (`location_online`)
-            ) ENGINE=InnoDB;";
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Nouvelle table oledrion_delivery
-     * @since 2.3.4 2013.03.5
-     */
-    $tableName = $xoopsDB->prefix('oledrion_delivery');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = "CREATE TABLE `$tableName` (
-              `delivery_id` int(10) unsigned NOT NULL auto_increment,
-              `delivery_title` varchar(255) NOT NULL default '',
-              `delivery_description` text,
-              `delivery_online` tinyint(1) NOT NULL default '1',
-              `delivery_image` varchar(255) NOT NULL,
-              PRIMARY KEY  (`delivery_id`),
-              KEY `delivery_title` (`delivery_title`),
-              KEY `delivery_online` (`delivery_online`)
-            ) ENGINE=InnoDB;";
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Nouvelle table oledrion_payment
-     * @since 2.3.4 2013.03.5
-     */
-    $tableName = $xoopsDB->prefix('oledrion_payment');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = "CREATE TABLE `$tableName` (
-              `payment_id` int(10) unsigned NOT NULL auto_increment,
-              `payment_title` varchar(255) NOT NULL default '',
-              `payment_description` text,
-              `payment_online` tinyint(1) NOT NULL default '1',
-              `payment_type` enum('online','offline') NOT NULL,
-              `payment_gateway` varchar(64) NOT NULL default '',
-              `payment_image` varchar(255) NOT NULL,
-              PRIMARY KEY  (`payment_id`),
-              KEY `payment_title` (`payment_title`),
-              KEY `payment_online` (`payment_online`),
-              KEY `payment_type` (`payment_type`),
-              KEY `payment_gateway` (`payment_gateway`)
-            ) ENGINE=InnoDB;";
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Nouvelle table oledrion_location_delivery
-     * @since 2.3.4 2013.03.5
-     */
-    $tableName = $xoopsDB->prefix('oledrion_location_delivery');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = "CREATE TABLE `$tableName` (
-              `ld_id` int(5) unsigned NOT NULL auto_increment,
-              `ld_location` int(5) unsigned NOT NULL,
-              `ld_delivery` int(5) unsigned NOT NULL,
-              `ld_price` decimal(16,2) NOT NULL,
-              `ld_delivery_time` mediumint(8) unsigned NOT NULL,
-              PRIMARY KEY  (`ld_id`),
-              KEY `ld_location` (`ld_location`),
-              KEY `ld_delivery` (`ld_delivery`)
-            ) ENGINE=InnoDB;";
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Nouvelle table oledrion_delivery_payment
-     * @since 2.3.4 2013.03.5
-     */
-
-    $tableName = $xoopsDB->prefix('oledrion_delivery_payment');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = "CREATE TABLE `$tableName` (
-              `dp_id` int(5) unsigned NOT NULL auto_increment,
-              `dp_delivery` int(5) unsigned NOT NULL,
-              `dp_payment` int(5) unsigned NOT NULL,
-              PRIMARY KEY  (`dp_id`),
-              KEY `dp_delivery` (`dp_delivery`),
-              KEY `dp_payment` (`dp_payment`)
-            ) ENGINE=InnoDB;";
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Nouvelle table oledrion_delivery_payment
-     * @since 2.3.4 2013.03.15
-     */
-
-    $tableName = $xoopsDB->prefix('oledrion_payment_log');
-    if (!Oledrion\Utility::tableExists($tableName)) {
-        $sql = "CREATE TABLE `$tableName` (
-                  `log_id` int(10) unsigned NOT NULL auto_increment,
-                  `log_create` int(10) unsigned NOT NULL,
-                  `log_status` tinyint(1) unsigned NOT NULL,
-                  `log_ip` varchar(32) NOT NULL,
-                  `log_type` enum('online','offline') NOT NULL,
-                  `log_payment` int(10) unsigned NOT NULL,
-                  `log_gateway` varchar(64) NOT NULL default '',
-                  `log_uid` int(10) unsigned NOT NULL,
-                  `log_command` int(10) unsigned NOT NULL,
-                  `log_amount` double(16,2) NOT NULL,
-                  `log_authority` varchar(255) NOT NULL,
-                  PRIMARY KEY  (`log_id`),
-                  KEY `log_uid` (`log_uid`),
-                  KEY `log_command` (`log_command`),
-                  KEY `log_status` (`log_status`)
-                ) ENGINE=InnoDB;";
-        $xoopsDB->queryF($sql);
-    }
-
-    /**
-     * Add New fields to Commands
-     * @since 2.3.2013.03.15
-     */
-    $tableName = $xoopsDB->prefix('oledrion_commands');
-    if (!Oledrion\Utility::fieldExists('cmd_create', $tableName)) {
-        Oledrion\Utility::addField('`cmd_create` int(10) unsigned NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_packing', $tableName)) {
-        Oledrion\Utility::addField('`cmd_packing` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_packing_id', $tableName)) {
-        Oledrion\Utility::addField('`cmd_packing_id` int(5) unsigned NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_location', $tableName)) {
-        Oledrion\Utility::addField('`cmd_location` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_location_id', $tableName)) {
-        Oledrion\Utility::addField('`cmd_location_id` int(5) unsigned NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_delivery', $tableName)) {
-        Oledrion\Utility::addField('`cmd_delivery` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_delivery_id', $tableName)) {
-        Oledrion\Utility::addField('`cmd_delivery_id` int(5) unsigned NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_payment', $tableName)) {
-        Oledrion\Utility::addField('`cmd_payment` varchar(255) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_payment_id', $tableName)) {
-        Oledrion\Utility::addField('`cmd_payment_id` int(5) unsigned NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_status', $tableName)) {
-        Oledrion\Utility::addField('`cmd_status` tinyint(1) unsigned NOT NULL default "1"', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_mobile', $tableName)) {
-        Oledrion\Utility::addField('`cmd_mobile` varchar(30) NOT NULL', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('cmd_packing_price', $tableName)) {
-        Oledrion\Utility::addField('`cmd_packing_price` decimal(16,2) NOT NULL', $tableName);
-    }
-
-    /**
-     * Add/update product urls
-     * @since 2.3.2013.08.03
-     */
-    $tableName = $xoopsDB->prefix('oledrion_products');
-
-    if (!Oledrion\Utility::fieldExists('product_url2', $tableName)) {
-        Oledrion\Utility::addField('`product_url2` VARCHAR( 255 ) NOT NULL AFTER `product_url`', $tableName);
-    }
-
-    if (!Oledrion\Utility::fieldExists('product_url3', $tableName)) {
-        Oledrion\Utility::addField('`product_url3` VARCHAR( 255 ) NOT NULL AFTER `product_url`', $tableName);
-    }
-
-    /**
-     * Add cmd_track
-     * @since 2014.01.03
-     */
-    $tableName = $xoopsDB->prefix('oledrion_commands');
-
-    if (!Oledrion\Utility::fieldExists('cmd_track', $tableName)) {
-        Oledrion\Utility::addField('`cmd_track` VARCHAR( 255 ) NOT NULL', $tableName);
-    }
-
-    /**
-     * Add cmd_track
-     * @since 2014.01.10
-     */
-    $tableName = $xoopsDB->prefix('oledrion_related');
-
-    if (!Oledrion\Utility::fieldExists('related_product_percent', $tableName)) {
-        Oledrion\Utility::addField('`related_product_percent` INT( 4 ) NOT NULL', $tableName);
-    }
-}
diff -ruN oledrion-2.35_RC1/language/english/mail_template/command_client.tpl oledrion-2.35_RC2/language/english/mail_template/command_client.tpl
--- oledrion-2.35_RC1/language/english/mail_template/command_client.tpl	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/language/english/mail_template/command_client.tpl	2019-12-13 14:50:02.001946976 -0500
@@ -13,6 +13,7 @@
 Telephone : {TELEPHONE}
 Email : {EMAIL}
 Invoice wanted ? {FACTURE}
+Note to Vendor : {NOTE}
 
 Details of your order :
 Product's Title                                                  SKU    Price      Shipping
diff -ruN oledrion-2.35_RC1/language/english/mail_template/command_shop.tpl oledrion-2.35_RC2/language/english/mail_template/command_shop.tpl
--- oledrion-2.35_RC1/language/english/mail_template/command_shop.tpl	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/language/english/mail_template/command_shop.tpl	2019-12-13 14:50:02.002946565 -0500
@@ -12,6 +12,8 @@
 country : {PAYS}
 Telephone : {TELEPHONE}
 Email : {EMAIL}
+Note to Vendor : {NOTE}
+
 Invoice wanted : {FACTURE}
 
 
diff -ruN oledrion-2.35_RC1/language/english/main.php oledrion-2.35_RC2/language/english/main.php
--- oledrion-2.35_RC1/language/english/main.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/language/english/main.php	2019-12-13 14:50:02.005945334 -0500
@@ -190,13 +190,13 @@
 define('_OLEDRION_DETAILS_EMAIL', 'You will receive the details of your order by email');
 define('_OLEDRION_PLEASE_ENTER', 'Please enter the following information to validate your checkout');
 define('_OLEDRION_STREET', 'Street');
+define('_OLEDRION_NOTE', 'Note to Vendor');
 define('_OLEDRION_CP', 'Post code');
 define('_OLEDRION_CITY', 'City');
 define('_OLEDRION_COUNTRY', 'Country');
 define('_OLEDRION_PHONE', 'Phone number');
 define('_OLEDRION_INVOICE', 'Do you want an invoice?');
 define('_OLEDRION_COPY_COUNT', 'copy');
-// B.R. define('_OLEDRION_THANKYOU_CMD', 'Thank you for your order on the website %s');
 define('_OLEDRION_THANKYOU_CMD', 'Thank you for your purchase from %s');
 define('_OLEDRION_NEW_COMMAND', 'New purchase on the site');
 define('_OLEDRION_COMMAND', 'Command ');
@@ -317,13 +317,10 @@
 define('_OLEDRION_STEP_1', '1- Add to cart');
 define('_OLEDRION_STEP_2', '2- Input personal information');
 define('_OLEDRION_STEP_3', '3- Confirm information');
-
 define('_OLEDRION_TRACK', 'Tracking Code');
 define('_OLEDRION_GIFT', 'Gift Cards');
 define('_OLEDRION_PACK', 'Package');
 define('_OLEDRION_SUBMIT', 'Submit');
-
-// B.R. New
 define('_OLEDRION_SKIP_PACKING', 'Skip Packing step during checkout?');
 define('_OLEDRION_SKIP_LOCATION', 'Skip Location step during checkout?');
 define('_OLEDRION_SKIP_DELIVERY', 'Skip Delivery (shipping) step during checkout?');
diff -ruN oledrion-2.35_RC1/language/persian/main.php oledrion-2.35_RC2/language/persian/main.php
--- oledrion-2.35_RC1/language/persian/main.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/language/persian/main.php	2019-12-13 14:50:02.011942869 -0500
@@ -189,6 +189,7 @@
 define('_OLEDRION_DETAILS_EMAIL', 'شما اطلاعات سفارش خود را به وسیلهٔ پست الکترونیکی دریافت خواهید کرد');
 define('_OLEDRION_PLEASE_ENTER', 'لطفا اطلاعات زیر را برای بررسی سفارش تمکیل نمایید .');
 define('_OLEDRION_STREET', 'آدرس');
+define('_OLEDRION_NOTE', 'Note to Vendor');
 define('_OLEDRION_CP', 'کد پستی');
 define('_OLEDRION_CITY', 'شهر');
 define('_OLEDRION_COUNTRY', 'کشور');
@@ -333,7 +334,6 @@
 define('_OLEDRION_TRACK', 'کد رهگیری پستی');
 define('_OLEDRION_GIFT', 'کد کارت هدیه');
 
-// B.R. New
 define('_OLEDRION_SKIP_PACKING', 'Skip Packing step during checkout?');
 define('_OLEDRION_SKIP_LOCATION', 'Skip Location step during checkout?');
 define('_OLEDRION_SKIP_DELIVERY', 'Skip Delivery (shipping) step during checkout?');
diff -ruN oledrion-2.35_RC1/sql/mysql.sql oledrion-2.35_RC2/sql/mysql.sql
--- oledrion-2.35_RC1/sql/mysql.sql	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/sql/mysql.sql	2019-12-15 05:52:41.188700103 -0500
@@ -55,7 +55,7 @@
   `product_unitmeasure2`    VARCHAR(20)           NOT NULL DEFAULT '',
   `product_vat_id`          MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
   `product_download_url`    VARCHAR(255)          NOT NULL DEFAULT '',
-  `product_recommended`     DATETIME              NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  `product_recommended`     DATETIME              NOT NULL DEFAULT '1970-01-01 00:00:01',
   `product_metakeywords`    VARCHAR(255)          NOT NULL DEFAULT '',
   `product_metadescription` VARCHAR(255)          NOT NULL DEFAULT '',
   `product_metatitle`       VARCHAR(255)          NOT NULL DEFAULT '',
@@ -140,6 +140,7 @@
   `cmd_lastname`       VARCHAR(255)          NOT NULL DEFAULT '',
   `cmd_firstname`      VARCHAR(255)          NOT NULL DEFAULT '',
   `cmd_adress`         TEXT,
+  `cmd_note`           TEXT,
   `cmd_zip`            VARCHAR(30)           NOT NULL DEFAULT '',
   `cmd_town`           VARCHAR(255)          NOT NULL DEFAULT '',
   `cmd_country`        VARCHAR(3)            NOT NULL DEFAULT '',
@@ -476,3 +477,20 @@
   KEY `log_status` (`log_status`)
 )
   ENGINE = InnoDB;
+
+# Populate db with data, reasons
+# TODO: sort out why missing / update errors
+# This entry is neccessary for paypal/gateway checkout completion,
+#   but does not have UI and not set anywhere
+
+INSERT INTO oledrion_delivery_payment(dp_id, dp_delivery, dp_payment) VALUES (1,1,1);
+
+# These entries result in (UI) failed save due to missing image file
+#  Config/Packing, Config/Delivery
+INSERT INTO oledrion_packing(packing_id, packing_title, packing_width, packing_length, packing_weight,
+ packing_image, packing_description, packing_price, packing_online)
+ VALUES (1,"None","","","","","",0.00,1);
+INSERT INTO oledrion_delivery(delivery_id, delivery_title, delivery_description, delivery_online,
+ delivery_image)
+ VALUES (1,"Free","",1,"");
+
diff -ruN oledrion-2.35_RC1/templates/admin/oledrion_order_print.tpl oledrion-2.35_RC2/templates/admin/oledrion_order_print.tpl
--- oledrion-2.35_RC1/templates/admin/oledrion_order_print.tpl	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/templates/admin/oledrion_order_print.tpl	2019-12-13 14:50:02.127895235 -0500
@@ -31,6 +31,7 @@
         <div class="pad2"><span class="bold">نام و نام خانوادگی</span>
             : <{$order.cmd_firstname}> <{$order.cmd_lastname}></div>
         <div class="pad2"><span class="bold">آدرس</span> : <{$order.cmd_adress}></div>
+        <div class="pad2"><span class="bold">آدرس</span> : <{$order.cmd_note}></div>
         <{if $ask_vatnumber && trim($order.cmd_vat_number) != ''}>
             <div class="pad2"><{$smarty.const._OLEDRION_VAT_NUMBER}> : <{$order.cmd_vat_number}></div>
         <{/if}>
diff -ruN oledrion-2.35_RC1/templates/oledrion_allproducts.tpl oledrion-2.35_RC2/templates/oledrion_allproducts.tpl
--- oledrion-2.35_RC1/templates/oledrion_allproducts.tpl	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/templates/oledrion_allproducts.tpl	2019-12-13 14:50:02.132893183 -0500
@@ -16,10 +16,10 @@
         <thead>
         <tr>
             <th><{$smarty.const._OLEDRION_TITLE}></th>
-            <th><{$smarty.const._OLEDRION_CATEGORY}></th>
+            <th style="padding-left:20px;"><{$smarty.const._OLEDRION_CATEGORY}></th>
             <{if $mod_pref.use_price}>
-                <th><{$smarty.const._OLEDRION_PRICE}></th><{/if}>
-            <th><{$smarty.const._OLEDRION_ADD_TO_CART}></th>
+                <th style="padding-left:20px;"><{$smarty.const._OLEDRION_PRICE}></th><{/if}>
+            <th style="padding-left:20px;"><{$smarty.const._OLEDRION_ADD_TO_CART}></th>
         </tr>
         </thead>
         <tbody>
@@ -28,15 +28,15 @@
                 <td><{$product.product_recommended_picture}><a href="<{$product.product_url_rewrited}>"
                                                                title="<{$product.product_href_title}>"><{$product.product_title}></a>
                 </td>
-                <td><{$product.product_category.cat_title}></td>
+                <td style="padding-left:20px;"><{$product.product_category.cat_title}></td>
                 <{if $mod_pref.use_price}>
-                    <td class='right'><{if $product.product_discount_price_ttc != ''}>
+                    <td class='right' style="padding-left:20px;"><{if $product.product_discount_price_ttc != ''}>
                     <s><{$product.product_price_ttc}> </s>
                     <{$product.product_discount_price_ttc}>
                 <{else}>
                     <{$product.product_price_ttc_long}>
                 <{/if}></td><{/if}>
-                <td class="center"><{if $product.product_stock > 0 }><a
+                <td class="center" style="padding-left:20px;"><{if $product.product_stock > 0 }><a
                         href="<{$smarty.const.OLEDRION_URL}>caddy.php?op=addproduct&product_id=<{$product.product_id}>"
                         title="<{$smarty.const._OLEDRION_ADD_TO_CART}>"><img
                                 src="<{$smarty.const.OLEDRION_IMAGES_URL}>cartadd.gif"
diff -ruN oledrion-2.35_RC1/templates/oledrion_bill_print.tpl oledrion-2.35_RC2/templates/oledrion_bill_print.tpl
--- oledrion-2.35_RC1/templates/oledrion_bill_print.tpl	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/templates/oledrion_bill_print.tpl	2019-12-13 14:50:02.127895235 -0500
@@ -30,6 +30,7 @@
         <div class="pad2"><span class="bold"><{$smarty.const._OLEDRION_FIRSTNAME}></span>
             : <{$order.cmd_firstname}> <{$order.cmd_lastname}></div>
         <div class="pad2"><span class="bold"><{$smarty.const._OLEDRION_STREET}></span> : <{$order.cmd_adress}></div>
+        <div class="pad2"><span class="bold"><{$smarty.const._OLEDRION_NOTE}></span> : <{$order.cmd_note}></div>
         <{if $ask_vatnumber && trim($order.cmd_vat_number) != ''}>
             <div class="pad2"><{$smarty.const._OLEDRION_VAT_NUMBER}> : <{$order.cmd_vat_number}></div>
         <{/if}>
diff -ruN oledrion-2.35_RC1/templates/oledrion_bill.tpl oledrion-2.35_RC2/templates/oledrion_bill.tpl
--- oledrion-2.35_RC1/templates/oledrion_bill.tpl	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/templates/oledrion_bill.tpl	2019-12-13 14:50:02.133892772 -0500
@@ -6,6 +6,7 @@
         <div class="pad2"><{$smarty.const._OLEDRION_COMMAND}> : <{$order.cmd_id}></div>
         <div class="pad2"><{$order.cmd_firstname}> <{$order.cmd_lastname}></div>
         <div class="pad2"><{$order.cmd_adress}></div>
+        <div class="pad2"><{$order.cmd_note}></div>
         <{if $ask_vatnumber && trim($order.cmd_vat_number) != ''}>
             <div class="pad2"><{$smarty.const._OLEDRION_VAT_NUMBER}> : <{$order.cmd_vat_number}></div>
         <{/if}>
diff -ruN oledrion-2.35_RC1/templates/oledrion_thankyou.tpl oledrion-2.35_RC2/templates/oledrion_thankyou.tpl
--- oledrion-2.35_RC1/templates/oledrion_thankyou.tpl	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/templates/oledrion_thankyou.tpl	2019-12-13 14:50:02.133892772 -0500
@@ -16,6 +16,5 @@
             <h3><{$smarty.const._OLEDRION_GATEWAY_FAILED}></h3>
         <{/if}>
     </div>
-    <!-- B.R. <div class="pad2"><a href="<{$smarty.const.OLEDRION_URL}>"><{$smarty.const._OLEDRION_CONTINUE_SHOPPING}></a></div> -->
     <div class="pad2"><a href="<{$smarty.const.XOOPS_URL}>"><{$smarty.const._OLEDRION_CONTINUE_SHOPPING}></a></div>
 </div>
diff -ruN oledrion-2.35_RC1/testdata/english/oledrion_commands.yml oledrion-2.35_RC2/testdata/english/oledrion_commands.yml
--- oledrion-2.35_RC1/testdata/english/oledrion_commands.yml	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/testdata/english/oledrion_commands.yml	2019-12-13 14:50:02.136891539 -0500
@@ -10,6 +10,7 @@
   cmd_lastname: "Doe"
   cmd_firstname: "Joe"
   cmd_adress: "123 Street St."
+  cmd_note: "Note"
   cmd_zip: 20125
   cmd_town: "New York"
   cmd_country: "US"
@@ -47,6 +48,7 @@
   cmd_lastname: "Doe"
   cmd_firstname: "Joe"
   cmd_adress: "123 Street St."
+  cmd_note: "Note"
   cmd_zip: 20125
   cmd_town: "New York"
   cmd_country: "US"
@@ -84,6 +86,7 @@
   cmd_lastname: "Doe"
   cmd_firstname: "Joe"
   cmd_adress: "123 Street St."
+  cmd_note: "Note"
   cmd_zip: 20125
   cmd_town: "New York"
   cmd_country: "US"
diff -ruN oledrion-2.35_RC1/update_sales.php oledrion-2.35_RC2/update_sales.php
--- oledrion-2.35_RC1/update_sales.php	1969-12-31 19:00:00.000000000 -0500
+++ oledrion-2.35_RC2/update_sales.php	2019-12-15 04:29:37.153577101 -0500
@@ -0,0 +1,23 @@
+<?php
+
+/*
+  This function is intended to update external e-commerce databases, etc when a product is sold
+  It is called by modules/oledrion/class/Gateways/Paypal/PaypalGateway.php upon verified sale
+  It must be placed outside of document_root and full path specified by config - "OLEDRION_DB_UPDATE_SCRIPT"
+  This function must return quickly, since it is in paypal callback which must complete within 30 seconds
+  It takes (observed) max 2 seconds to get here, exits after. Log will give you total transaction time
+*/
+
+defined('XOOPS_ROOT_PATH') || exit('Restricted access');
+
+// @int    $product_id
+// @string $user_id (email address, DB key)
+// @string $transaction_id (from gateway)
+// @$ret   Results string (goes to gateway log)
+
+function updateDB($product_id, $user_id, $transaction_id ) {
+	// Do your stuff
+	$ret .= sprintf("Updated user: %s, Product: %s, Transaction: %s\n", $user_id, $product_id, $transaction_id);
+	return $ret;
+}
+?>
diff -ruN oledrion-2.35_RC1/xoops_version.php oledrion-2.35_RC2/xoops_version.php
--- oledrion-2.35_RC1/xoops_version.php	2019-05-19 13:46:50.000000000 -0400
+++ oledrion-2.35_RC2/xoops_version.php	2019-12-13 14:50:01.990951494 -0500
@@ -46,7 +46,7 @@
 $modversion['module_website_url']  = 'www.xoops.org';
 $modversion['module_website_name'] = 'XOOPS';
 $modversion['min_php']             = '5.5';
-$modversion['min_xoops']           = '2.5.10';
+$modversion['min_xoops']           = '2.5.9';
 $modversion['min_admin']           = '1.2';
 $modversion['min_db']              = ['mysql' => '5.5'];
 
