Siouw Posted April 15, 2014 Share Posted April 15, 2014 The shop I'm putting up is selling fruits and vegetables. So obviously, I don't need the "new, used or refurbished" condition. However, I'd like to use this conditions to reflect the way the veggies are sold, such as "per kilo", "per piece", "per slice" or whatever. So far, I've managed to change the admin part (I'm now able to choose the new condition). That's what I did : In /adminxxx/themes/default/template/controllers/products/informations.tpl line 306, I've added my new conditions. I've changed the field in table _product so it can accept other values as well : ALTER TABLE `ps_product` CHANGE `condition` `condition` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'kilo'; I've also changed the validating type in /classes/Product.php line 291 : 'condition' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isString'), That works well. However, the new conditions are not visible on the frontend. What I did is : in /themes/xxxx/product.tpl line 168 I've made the following changes : {capture name=condition} {if $product->condition == 'kilo'}{l s='Prix au kilo'} {elseif $product->condition == 'piece'}{l s='Prix a la piece'} {elseif $product->condition == 'part'}{l s='Prix a la tranche'} {elseif $product->condition == 'new'}{l s='New'} {elseif $product->condition == 'used'}{l s='Used'} {elseif $product->condition == 'refurbished'}{l s='Refurbished'} {/if} {/capture} I've also changed the page /modules/blocklayered/blocklayered.php, line 2442 (I've added my new conditions)... though I'm not sure what exactly it does That's it... but its not working: the new condition is correctly inserted in the db but doesn't show up on the product page (actually, the $product->condition doesn't contain any value = it's empty !). What did I miss ? Any thought on this ? Thank youuuuuuu PS : I'm using the new 1.6 version Link to comment Share on other sites More sharing options...
vekia Posted April 15, 2014 Share Posted April 15, 2014 hello perhaps variable stored in datbase is different? i mean maybe there is some "space" sign before or after name? it's worth to check it. Link to comment Share on other sites More sharing options...
Siouw Posted April 15, 2014 Author Share Posted April 15, 2014 I've dopple checked, triple checked... but I'm pretty sure there are no difference (I usually copy-paste my variable names). Link to comment Share on other sites More sharing options...
Siouw Posted April 16, 2014 Author Share Posted April 16, 2014 No ideas ? anyone ? Link to comment Share on other sites More sharing options...
vekia Posted April 16, 2014 Share Posted April 16, 2014 im out of ideas :/ can you show what you added(what you changed) to In /adminxxx/themes/default/template/controllers/products/informations.tpl line 306, I've added my new conditions. Link to comment Share on other sites More sharing options...
Recommended Posts