Jump to content

Amit8146

Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Location
    Kolkata
  • Activity
    Developer

Recent Profile Visitors

1,508,532 profile views

Amit8146's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I want to update quantity of Product through CSV Product combination wise. My Product Id : 202 Product Ref. No: FAS_CC_ccc1 combination 1: Casual Clothing Floral Print Top - Color - Multi-Colored, Fabric - schiffon/georgette, Size - UK 12, Occasion - Casual combination 2: Casual Clothing Floral Print Top - Color - Multi-Colored, Fabric - schiffon/georgette, Size - UK 14, Occasion - Casual Please help !!! Thanks & Regards
  2. Sorry Actually I have missing the variable for get value. My final code is public function hookHome($params) { $name=Tools::getValue('name'); $phone_num=Tools::getValue('phone_num'); if (Tools::isSubmit('submit_details')) { if(Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'storewhatapps` (`store_id`, `name`, `phone_num`) VALUES ("","'.$name.'","'.$phone_num.'")')) { $this->_html .=$this->displayConfirmation($this->l('Settings updated successfully')); } else { $this->_html .= $this->displayError($this->l('You Have Some Errors')); } } return $this->display(__FILE__, 'mymodule.tpl'); } Its work fine now. Thanks for your help.
  3. Thanks for your help. I added your code public function hookHome($params) { if (Tools::isSubmit('submit_details')) { if(Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'storewhatapps` (`store_id`, `name`, `phone_num`) VALUES ("","'.$name.'","'.$phone_num.'")')) { $this->_html .=$this->displayConfirmation($this->l('Settings updated successfully')); } else { $this->_html .= $this->displayError($this->l('You Have Some Errors')); } } return $this->display(__FILE__, 'mymodule.tpl'); } But when I have insert value from front end ...then it is the blank value in my DB. Please help.
  4. My problem is how I use the front tpl. In this present code the data is inserted from backend successfully. But when I insert data from front end is not inserted. Please help me. How can insert from front end.
  5. Hi, I am new in prestashop. I am trying to develop a simple module. Two text box on front end 1.Name, 2. Phone no. Two value will inserted in database. I have't get value from front end tpl file. And my module was working fine through back end panel. My mymodule.php file like this <?php /* * */ if(!defined('_PS_VERSION_')) exit; class MyModule extends Module { /** @var max image size */ protected $maxImageSize = 307200; public function __construct() { $this->name = 'mymodule'; $this->tab = 'front_office_features'; $this->version = '0.0.1'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Mymodule'); $this->description = $this->l('Mymodule.'); $this->confirmUninstall = $this->l('Are you sure to uninstall Mymodule?'); } public function install() { if (!parent::install() || !$this->installDB() || !$this->registerHook('home') || !$this->registerHook('header')) return false; return true; } public function installDB(){ if (!Db::getInstance()->Execute(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'storewhatapps` ( `store_id` int(10) unsigned NOT NULL auto_increment, `name` varchar(255) NOT NULL, `phone_num` int(15) NOT NULL, PRIMARY KEY (`store_id`)) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8')) return false; return true; } public function uninstall() { if (!parent::uninstall() || !$this->uninstallDB()) return false; return true; } public function getContent() { $name=Tools::getValue('name'); $phone_number=Tools::getValue('phone_number'); if (Tools::isSubmit('submit_details')) { if(Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'storewhatapps` (`store_id`, `name`, `phone_num`) VALUES ("","'.$name.'","'.$phone_number.'")')) { $this->_html .=$this->displayConfirmation($this->l('Settings updated successfully')); } else { $this->_html .= $this->displayError($this->l('You Have Some Errors')); } } //$this->_displayForm(); $this->display(__FILE__, 'mymodule.tpl'); //return $this->_html; return $this->display(__FILE__, 'mymodule.tpl'); } public function hookHome($params) { return $this->display(__FILE__, 'mymodule.tpl'); } public function hookHeader() { $this->context->controller->addCSS(($this->_path).'css/store_styles.css', 'all'); } } And my mymodule.tpl file look like this <fieldset> <form id="formID" method="post" action="#"> <p> <label for="name">Name:</label> <input id="name" name="name" type="text"/> </p> <p> <label for="phone_number">Phone Number:</label> <input id="phone_number" name="phone_number" type="text" /> </p> <p> <label> </label> <input type="submit" name="submit_details" class="button" /> </p> </form> </fieldset> Please guide me
  6. Hi, I am new in prestashop. I am trying to develop a simple module. Two text box on front end 1.Name, 2. Phone no. Two value will inserted in database. I have't get value from front end tpl file. And my module was working fine through back end panel. My mymodule.php file like this <?php /* * */ if(!defined('_PS_VERSION_')) exit; class MyModule extends Module { /** @var max image size */ protected $maxImageSize = 307200; public function __construct() { $this->name = 'mymodule'; $this->tab = 'front_office_features'; $this->version = '0.0.1'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Mymodule'); $this->description = $this->l('Mymodule.'); $this->confirmUninstall = $this->l('Are you sure to uninstall Mymodule?'); } public function install() { if (!parent::install() || !$this->installDB() || !$this->registerHook('home') || !$this->registerHook('header')) return false; return true; } public function installDB(){ if (!Db::getInstance()->Execute(' CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'storewhatapps` ( `store_id` int(10) unsigned NOT NULL auto_increment, `name` varchar(255) NOT NULL, `phone_num` int(15) NOT NULL, PRIMARY KEY (`store_id`)) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8')) return false; return true; } public function uninstall() { if (!parent::uninstall() || !$this->uninstallDB()) return false; return true; } public function getContent() { $name=Tools::getValue('name'); $phone_number=Tools::getValue('phone_number'); if (Tools::isSubmit('submit_details')) { if(Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'storewhatapps` (`store_id`, `name`, `phone_num`) VALUES ("","'.$name.'","'.$phone_number.'")')) { $this->_html .=$this->displayConfirmation($this->l('Settings updated successfully')); } else { $this->_html .= $this->displayError($this->l('You Have Some Errors')); } } //$this->_displayForm(); $this->display(__FILE__, 'mymodule.tpl'); //return $this->_html; return $this->display(__FILE__, 'mymodule.tpl'); } public function hookHome($params) { return $this->display(__FILE__, 'mymodule.tpl'); } public function hookHeader() { $this->context->controller->addCSS(($this->_path).'css/store_styles.css', 'all'); } } And my mymodule.tpl file look like this <fieldset> <form id="formID" method="post" action="#"> <p> <label for="name">Name:</label> <input id="name" name="name" type="text"/> </p> <p> <label for="phone_number">Phone Number:</label> <input id="phone_number" name="phone_number" type="text" /> </p> <p> <label> </label> <input type="submit" name="submit_details" class="button" /> </p> </form> </fieldset> Please guide me
×
×
  • Create New...