diff --git a/pchcustomerfield/Readme.md b/pchcustomerfield/Readme.md
new file mode 100644
index 0000000..f8be1fd
--- /dev/null
+++ b/pchcustomerfield/Readme.md
@@ -0,0 +1 @@
+# Additional Customer Field
\ No newline at end of file
diff --git a/pchcustomerfield/config.xml b/pchcustomerfield/config.xml
new file mode 100644
index 0000000..c685889
--- /dev/null
+++ b/pchcustomerfield/config.xml
@@ -0,0 +1,11 @@
+
+
'. + $this->l('Since multiple languages are activated on your shop, please mind to add field value for each one of them'). + '
'; + } + + public function setMedia($isNewTheme = false) + { + parent::setMedia($isNewTheme); + $this->addJqueryUI('ui.sortable'); + } + + protected function beforeAdd($object) + { + if (empty($object->position) || !PchCustomerfieldModel::positionOccupied($object->position)) { + $object->position = PchCustomerfieldModel::getHigherPosition() + 1; + } + parent::beforeAdd($object); + } + + public function ajaxProcessUpdatePositions() + { + $way = (int)(Tools::getValue('way')); + $id_field = (int)(Tools::getValue('id')); + $positions = Tools::getValue('pchcustomerfield'); + + foreach ($positions as $position => $value) { + $pos = explode('_', $value); + + if (isset($pos[2]) && (int)$pos[2] === $id_field) { + if ($field = new PchCustomerfieldModel((int)$pos[2])) { + if (isset($position) && $field->updatePosition($way, $position)) { + echo 'ok position '.(int)$position.' for field '.(int)$pos[1].'\r\n'; + } else { + echo '{"hasError" : true, "errors" : "Can not update field '.(int)$id_field.' to position '.(int)$position.' "}'; + } + } else { + echo '{"hasError" : true, "errors" : "This field ('.(int)$id_field.') can t be loaded"}'; + } + break; + } + } + } + + public function processPosition() + { + if (Tools::getIsset('update'.$this->table)) { + $object = new PchCustomerfieldModel((int)Tools::getValue('id_pchcustomerfield')); + self::$currentIndex = self::$currentIndex.'&update'.$this->table; + } else { + $object = new PchCustomerfieldModel((int)Tools::getValue('id')); + } + if (!Validate::isLoadedObject($object)) { + $this->errors[] = $this->l('An error occurred while updating the status for an object.'). + ' '.$this->table.' '.$this->l('(cannot load object)'); + } elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) { + $this->errors[] = $this->l('Failed to update the position.'); + } else { + $id_identifier_str = ($id_identifier = (int)Tools::getValue($this->identifier)) ? '&'.$this->identifier.'='.$id_identifier : ''; + $redirect = self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.$id_identifier_str.'&token='.$this->token; + $this->redirect_after = $redirect; + } + return $object; + } +} diff --git a/pchcustomerfield/controllers/admin/index.php b/pchcustomerfield/controllers/admin/index.php new file mode 100644 index 0000000..87daa20 --- /dev/null +++ b/pchcustomerfield/controllers/admin/index.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2022 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/pchcustomerfield/controllers/index.php b/pchcustomerfield/controllers/index.php new file mode 100644 index 0000000..87daa20 --- /dev/null +++ b/pchcustomerfield/controllers/index.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2022 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/pchcustomerfield/index.php b/pchcustomerfield/index.php new file mode 100644 index 0000000..87daa20 --- /dev/null +++ b/pchcustomerfield/index.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2022 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/pchcustomerfield/logo.png b/pchcustomerfield/logo.png new file mode 100644 index 0000000..95d87b4 Binary files /dev/null and b/pchcustomerfield/logo.png differ diff --git a/pchcustomerfield/mails/de/index.php b/pchcustomerfield/mails/de/index.php new file mode 100644 index 0000000..87daa20 --- /dev/null +++ b/pchcustomerfield/mails/de/index.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2022 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/pchcustomerfield/mails/de/order_conf.html b/pchcustomerfield/mails/de/order_conf.html new file mode 100644 index 0000000..d4bea2b --- /dev/null +++ b/pchcustomerfield/mails/de/order_conf.html @@ -0,0 +1,1291 @@ + + + + +|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
+
+
+
+
+
|
+
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
+
+
+
+
+
|
+
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
+
+
+
+
+
|
+
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
+
+
+
|
+
|
+
+
+
|
+
|
+
+
+
|
+
|
+
+
+
|
+
| + + | +
|
+
+
+
|
+
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
+|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
+
+
+
|
+
|
+
+
+
|
+
|
+
+
+
|
+
|
+
+
+
|
+
| + + | +
|
+
+
+
|
+
{{ 'A registered customer account using the defined email address already exists. '|trans({}, 'Admin.Orderscustomers.Notification') }}
+ {% else %} + {{ form_start(transferGuestAccountForm, {'action': path('admin_customers_transform_guest_to_customer', {'customerId': customerInformation.customerId.value})}) }} + + +{{ 'This feature generates a random password before sending an email to your customer.'|trans({}, 'Admin.Orderscustomers.Help') }}
+ {{ form_end(transferGuestAccountForm) }} + {% endif %} +