Search the Community
Showing results for tags 'add field'.
-
I need to add an input file uploader in customer registration (see the jp). Indeed, my customers need to proove that they are pros to access the website content. This field would be required to validate their account creation. I've spend about 3 days (dealing with authentification.tpl, customer.php overriding...) but still don't know how. Please, help xx
- 25 replies
-
- add field
- required field
-
(and 2 more)
Tagged with:
-
Hello, I'm having an issue adding more than one field to be editable from the backend shop. I can easily read new fields from the db, but I can't get the "public function __construct" to accept more than the first new field (for validation and writing). In the examples below, only the first 'show_member_price' is editable from front end and if I switch the order say making 'show_srp_price' first in the __construct then only that is editable. Additionally, I will next be wanting to update values in columns of the same name in ps_product_attribute table. Would the construct remain "__construct($id_product" or would it, perhaps, change to "__construct($id_product_attribute"? FILE: override/classes/Product.php <?php // ADD A RETAIL PRICE FIELD AND FIELDS TO ALLOW/OVERRIDE SHOWING THE MEMBER OR SRP PRICE TO THE PUBLIC (OR NOT) class Product extends ProductCore { public $srp; public $show_member_price; public $show_srp_price; public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null) { self::$definition['fields']['show_member_price'] = array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml'); parent::__construct($id_product, $full, $id_lang, $id_shop, $context); self::$definition['fields']['show_srp_price'] = array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml'); parent::__construct($id_product, $full, $id_lang, $id_shop, $context); self::$definition['fields']['srp'] = array('type' => self::TYPE_FLOAT, 'validate' => 'isCleanHtml'); parent::__construct($id_product, $full, $id_lang, $id_shop, $context); } } ?> have also tried: <?php // ADD A RETAIL PRICE FIELD AND FIELDS TO ALLOW/OVERRIDE SHOWING THE MEMBER OR SRP PRICE TO THE PUBLIC (OR NOT) class Product extends ProductCore { public $srp; public $show_member_price; public $show_srp_price; public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null) { self::$definition['fields']['show_member_price'] = array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml'); self::$definition['fields']['show_srp_price'] = array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml'); self::$definition['fields']['srp'] = array('type' => self::TYPE_FLOAT, 'validate' => 'isCleanHtml'); parent::__construct($id_product, $full, $id_lang, $id_shop, $context); } } ?> Thanks for any assistance anyone may provide. I was basing this on: http://nemops.com/prestashop-rrp-price/#.VF4Gw4eIfwU Thanks, Nemo! and liked it because it involves overriding very little in: classes/Product.php -Edie
- 1 reply
-
- function __construct
- add field
-
(and 2 more)
Tagged with:
-
I am using Prestashop 1.5 for a clients website. My client sells his products at other peoples shops, stores and locations. He doesn't have his own premises. We currently use the Stores page to list these addresses. I would like to add a passage of text which can be used to describe the location in more detail or in failing that a link to a CMS page for each location. I want to be able to control this content via the back office as my client is adding "stores" all the time. Thanks in advance. Neil