
piotrowski-s@hotmail.fr
Members-
Posts
20 -
Joined
-
Last visited
Everything posted by piotrowski-s@hotmail.fr
-
Hi, I added a new filed in contact form, I also made changement in overide for updating that new field in database. When I do a reply to my client, that field become empty. So I wanted to know how to get the value of that field in admin panel and to update it in the database ? anykind of help will be much appreicated.
-
smarty get offset of array in product page
piotrowski-s@hotmail.fr posted a topic in Core developers
I have some trouble in prestashop 1.6 using smarty. I have an array, but its offset are not reset for each product. so for the firdst product, with attrivute it has offset 1,2,3,4 Then for the next product it has offest 5,6,7,8 etc. I have that kind of array $combinations Smarty_Variable Object (3) ->value = Array (4) 5 => Array (14) attributes_values => Array (1) 1 => "S" attributes => Array (1) 0 => 1 price => 0 specific_price => Array (0) ecotax => 0 weight => 0 quantity => 20 reference => "" unit_impact => 0 minimal_quantity => "1" date_formatted => "" available_date => "" id_image => -1 list => "'1'" 6 => Array (14) I try to go trhough this array but it does not work when I put empty offset (it is inside a foreach) {$combinations[]['quantity']} How can I tell him to go trhough the first iteration, and then in the second automatically ? This return to me the following errors. Fatal error: Cannot use [] for reading in /htdocs/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 584 I can not tell him which offset to use, because for each product it goes up and is not reset to 0. I would be very gratefull for anykind of help. -
get product quantity by declination
piotrowski-s@hotmail.fr replied to piotrowski-s@hotmail.fr's topic in Core developers
I got it {$combinations[$id_attribute]['quantity']} Thank you for your help -
get product quantity by declination
piotrowski-s@hotmail.fr replied to piotrowski-s@hotmail.fr's topic in Core developers
the data I need is in the var $combination Smarty_Variable Object (3) ->value = Array (4) 1 => Array (14) attributes_values => Array (1) 1 => "S" attributes => Array (1) 0 => 1 price => 0 specific_price => Array (0) ecotax => 0 weight => 0 quantity => 0 reference => "" unit_impact => 0 minimal_quantity => "1" date_formatted => "" available_date => "" id_image => -1 list => "'1'" 2 => Array (14) attributes_values => Array (1) 1 => "M" attributes => Array (1) 0 => 2 price => 0 specific_price => Array (0) ecotax => 0 weight => 0 quantity => 18 reference => "" unit_impact => 0 minimal_quantity => "1" date_formatted => "" available_date => "" id_image => -1 list => "'2'" 3 => Array (14) attributes_values => Array (1) 1 => "L" attributes => Array (1) 0 => 3 price => 0 specific_price => Array (0) ecotax => 0 weight => 0 quantity => 20 reference => "" unit_impact => 0 minimal_quantity => "1" date_formatted => "" available_date => "" id_image => -1 list => "'3'" 4 => Array (14) attributes_values => Array (1) 1 => "XL" attributes => Array (1) 0 => 4 price => 0 specific_price => Array (0) ecotax => 0 weight => 0 quantity => 20 reference => "" unit_impact => 0 minimal_quantity => "1" date_formatted => "" available_date => "" id_image => -1 list => "'4'" But I don't know how can I use this in my loop because it is not the same var name so I don't know how to go through the $combination with $groupname. I will do more research. Thank you for your help. -
Hi, I have a custom list with radio buttons for the declination of the product. But I want to get the product quantity by declination (and not all). I have the var ($product->quantity) but it display all quantity and not for each declination. I would like to dispkay near the radio button in the loop but I don't know which is the smarty var to use ? this is my loop : {foreach from=$group.attributes key=id_attribute item=group_attribute} <li> <input type="radio" class="attribute_radio" name="{$groupName|escape:'html':'UTF-8'}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} /> <span>{$group_attribute|escape:'html':'UTF-8'}</span> </li> {/foreach} If anyone know how can get the number of item inside the loop for each attribute I would be realy gratefull.
-
Hi, I did a custom page (a php file, a controller and a tpl). The tpl send data through a form and this data are used in the controller. I need to do a request and to look for values from database. If no result it return a mistake, and if a result it return the value of the database requested through an array then I use this value and display them back in the tpl. I did the following script but in return an error php I'm a novice I know what I want to do, but I don't know exactly how to do it. Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /htdocs/controllers/front/AntiCounterfeitController.php on line 25 Warning: mysql_query(): No such file or directory in /htdocs/controllers/front/AntiCounterfeitController.php on line 25 Warning: mysql_query(): A link to the server could not be established in /htdocs/controllers/front/AntiCounterfeitController.php on line 25 Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /htdocs/controllers/front/AntiCounterfeitController.php on line 26 And this is my controller code <?php /* Create a custom page in PrestaShop without CMS - CustomPageController class /* Read the detailed tutorial at https://iftakharhasan.wordpress.com/prestashop-create-a-custom-page-without-cms */ /* The classname here will be the name of the controller */ class AntiCounterfeitController extends FrontController { public function init() { $this->display_column_left = false; $this->display_column_right = false; parent::init(); } public function postProcess() { if (Tools::isSubmit('submitcounterfeit')) { $serial = Tools::getValue('serial'); $key = Tools::getValue('key'); } if(isset($_POST['submitcounterfeit'])){ $query = "SELECT * FROM `ps_counterfeit` WHERE `serial` = '{$serial}' AND `key` = '{$key}'"; $result = mysql_query($query); if(mysql_num_rows($result)==0){ $error = 1; $data = null; } elseif(mysql_num_rows($result)==1){ $error = 0; $data = mysql_fetch_assoc($result); } } } public function initContent() { parent::initContent(); $this->setTemplate(_PS_THEME_DIR_ . 'anti-counterfeit.tpl'); } } Anykind of help will be much appreciated.
-
thank you for your reply, I've created 3 files : in root folder: anti-counterfeit.php <?php include(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); include(dirname(__FILE__).'/header.php'); $smarty->display(_PS_THEME_DIR_.'anti-counterfeit.tpl'); include(dirname(__FILE__).'/footer.php'); Then in controller AntiCounterfeitController.php <?php /* The classname here will be the name of the controller */ class AntiCounterfeitController extends FrontController{ public function init(){ parent::init(); } public function initContent(){ parent::initContent(); $this->setTemplate(_PS_THEME_DIR_.'anti-counterfeit.tpl'); } /* The following code portion is optional. /* Remove the double-slashes to activate the portion /* if you want to use external stylesheet and JavaScript for the page. /* Create the CSS and JS files in the css and js directories of the theme accordingly */ //public function setMedia(){ //parent::setMedia(); //$this->addCSS(_THEME_CSS_DIR_.'custom-page.css'); //$this->addJS(_THEME_JS_DIR_.'custom-page.js'); //} } Then the tpl in the theme folder (actually it is empty just a "test" text to be displayed (it works), but with both column, and I want none of them.
-
Hi, I created a new page (not using cms) because I want it to be a dynamique page. In my theme, I've selected that no column would be display on that page Even with that, it still display both column. Anykind of help will be much appreciated. In my tpl there is only the main page I want to display (no column).
-
Bonjour à tous, sur mon site www.omega-nutrition.fr lorsque l'on choisit mode de paiement par virement, on est redirigé vers la page http://omega-nutrition.fr/module/bankwire/validation et on a un beau message d'erreur, je ne sais pas comment le résoudre voici ce que cela dit : Erreur serveur Le site Web a rencontré une erreur lors de l'extraction de http://omega-nutrition.fr/module/bankwire/validation. Cela peut être dû à une opération de maintenance ou à une configuration incorrecte. Voici quelques suggestions : Actualisez cette page Web ultérieurement. Erreur HTTP 500 (Internal Server Error) : Une situation inattendue s'est produite tandis que le serveur tentait de traiter la demande. Toute forme d'aide sera grandement appréciée.
-
[Module] Block Login Slide Jquery
piotrowski-s@hotmail.fr replied to Natsu's topic in Modules et thèmes gratuits
Merci à julien51 qui a fait l'installation du module sur ma boutique car elle ne fonctionnait pas. Vous pouvez voir en live ce que cela donne ici http://www.omega-nutrition.fr Un grand merci à lui -
[Module] Block Login Slide Jquery
piotrowski-s@hotmail.fr replied to Natsu's topic in Modules et thèmes gratuits
Bonjour, j'ai bien installé, le module cependant il n'apparait pas, pouvez vous m'aider ? par avance merci. http://omega-nutrition.fr/