From 59cfe8da8b6473cd74c801c38f3b20204f1fe6bf Mon Sep 17 00:00:00 2001 From: touffies Date: Fri, 18 Oct 2013 09:49:14 +0200 Subject: [PATCH] CustomerUpdateForm - Extend CustomerCreation --- core/lib/Thelia/Form/CustomerUpdateForm.php | 75 +++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100755 core/lib/Thelia/Form/CustomerUpdateForm.php diff --git a/core/lib/Thelia/Form/CustomerUpdateForm.php b/core/lib/Thelia/Form/CustomerUpdateForm.php new file mode 100755 index 000000000..b02c7e31e --- /dev/null +++ b/core/lib/Thelia/Form/CustomerUpdateForm.php @@ -0,0 +1,75 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Form; + +use Symfony\Component\Validator\Constraints; +use Thelia\Model\ConfigQuery; +use Thelia\Core\Translation\Translator; + +/** + * Class CustomerUpdateForm + * @package Thelia\Form + * @author Christophe Laffont + */ +class CustomerUpdateForm extends CustomerCreation +{ + + protected function buildForm() + { + parent::buildForm(); + + + $this->formBuilder + ->remove("auto_login") + // Remove From Personal Informations + ->remove("phone") + ->remove("cellphone") + // Remove Delivery Informations + ->remove("company") + ->remove("address1") + ->remove("address2") + ->remove("address3") + ->remove("city") + ->remove("zipcode") + ->remove("country") + // Remove Login Information + ->remove("password") + ->remove("password_confirm") + // Remove Terms & conditions + ->remove("agreed") + + // Add Newsletter + ->add("newsletter", "checkbox", array( + "label" => "I would like to receive the newsletter our the latest news.", + "label_attr" => array( + "for" => "newsletter" + ), + "required" => false + )); + } + + public function getName() + { + return "thelia_customer_update"; + } +}