Colissimo fix routing.xml, thelia.sql and adding "Activate free shipping" option
new file: local/modules/Colissimo/AdminIncludes/module-config-js.html modified: local/modules/Colissimo/AdminIncludes/module_configuration.html modified: local/modules/Colissimo/Colissimo.php modified: local/modules/Colissimo/Config/config.xml modified: local/modules/Colissimo/Config/routing.xml new file: local/modules/Colissimo/Config/schema.xml modified: local/modules/Colissimo/Config/thelia.sql new file: local/modules/Colissimo/Controller/FreeShipping.php new file: local/modules/Colissimo/Form/FreeShipping.php modified: local/modules/Colissimo/I18n/en_US.php modified: local/modules/Colissimo/I18n/fr_FR.php new file: local/modules/Colissimo/Model/Base/ColissimoFreeshipping.php new file: local/modules/Colissimo/Model/Base/ColissimoFreeshippingQuery.php new file: local/modules/Colissimo/Model/ColissimoFreeshipping.php new file: local/modules/Colissimo/Model/ColissimoFreeshippingQuery.php new file: local/modules/Colissimo/Model/Map/ColissimoFreeshippingTableMap.php
This commit is contained in:
72
local/modules/Colissimo/Form/FreeShipping.php
Normal file
72
local/modules/Colissimo/Form/FreeShipping.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* 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. See the */
|
||||
/* GNU General Public License for more details. */
|
||||
/* */
|
||||
/* You should have received a copy of the GNU General Public License */
|
||||
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Colissimo\Form;
|
||||
|
||||
|
||||
use Colissimo\Model\ColissimoFreeshippingQuery;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
use Thelia\Form\BaseForm;
|
||||
|
||||
class FreeShipping extends BaseForm {
|
||||
/**
|
||||
*
|
||||
* in this function you add all the fields you need for your Form.
|
||||
* Form this you have to call add method on $this->formBuilder attribute :
|
||||
*
|
||||
* $this->formBuilder->add("name", "text")
|
||||
* ->add("email", "email", array(
|
||||
* "attr" => array(
|
||||
* "class" => "field"
|
||||
* ),
|
||||
* "label" => "email",
|
||||
* "constraints" => array(
|
||||
* new \Symfony\Component\Validator\Constraints\NotBlank()
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
* ->add('age', 'integer');
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
protected function buildForm()
|
||||
{
|
||||
$freeshipping = ColissimoFreeshippingQuery::create()->getLast();
|
||||
$this->formBuilder
|
||||
->add("freeshipping", "checkbox", array(
|
||||
'data'=>$freeshipping,
|
||||
'label'=>Translator::getInstance()->trans("Activate free shipping: ")
|
||||
))
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string the name of you form. This name must be unique
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return "colissimofreeshipping";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user