Jump to content

bilalhussain

Members
  • Posts

    41
  • Joined

  • Last visited

1 Follower

Profile Information

  • Activity
    Developer

Recent Profile Visitors

2,180,063 profile views

bilalhussain's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello Everyone, Does anyone have problem upgrading from 1.5.4.1 to 1.6.0 stable (1.6.0.8) using 1-click Upgrade? I think my upgrade get stuck in infinite loop. Please see the log below...I even had left the upgrade sit overnight but no luck... Database backup: 229 table(s) left....? THIS SEEMS VERY WRONG. 59 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left... ps_connections table has been saved. 1 tables has been saved. Database backup: 229 table(s) left...
  2. Hi, I have a custom module to show product specs based on the current loaded product. Now there are different type of products and different sets of specification. I can hide and show different tables inside my modules coding but how could I just hide the module for certain types of product? For example if product_type=C; hidemodule. Can it be achieved like this... any help would be appreciated. Thanks, Bilal
  3. oh this must be your cookie now. sorry for the trouble but you have to clear cookie.
  4. The above link should we working now. It was funny that my dedicated IP got assigned to a different server/website that is why it was redirecting to a pharmacy website.
  5. Thanks for pointing that out. I was just browsing it earlier and it was working fine. I am with web hosting company right now to resolve this issue. Thanks:)
  6. Vekia, I appreciate you help throughout my project. I got it working FINALLY. I published this module as 'beta' state. Please have a look at it and I would like your comments on it. I have few things to change but later. http://shoptwm.com/en/all-tires/617-175-70r13-accelera-accelera.html Regards, Bilal
  7. Thanks for all of your help all along my project. I have got to this far and I think I am very close to success. my module .php file function public function hookDisplayFooterProduct() { $this->context->smarty->assign(array( 'placement' => 'footerproduct',)); $id_product = Tools::getValue('id_product'); $browsed_product = new Product($id_product); $reference = $browsed_product->reference; echo $reference; /*debugging purpose*/ $sql = "SELECT * FROM ps_tirespecs WHERE catalog = '$reference'"; if ($result = Db::getInstance()->ExecuteS($sql)) foreach ($result as $row) $smarty->assign('array',$result); return $this->display(__FILE__, 'footerproduct.tpl'); } and my module .tpl file code to print those values like this.. {$array.Catalog} {$array.Sidewall} etc I don't get any output? Regards, Bilal
  8. Thank you for the query. but my question is how would I detect which product is being loaded in the browser? I want to access the current loaded product.reference # so I can match that against the ps_tirespecs.catalog to get the specs. Here is my module .php code. <?php /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * <[email protected]> wrote this module. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Jevin O. Sewaruth. * ---------------------------------------------------------------------------- */ if (!defined('_PS_VERSION_')) exit; class ProductSpecs extends Module { public function __construct() { $this->name = 'ProductSpecs'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'Bilal Hussain copied from Jevin O. Sewaruth'; parent::__construct(); $this->displayName = $this->l('ProductSpecs Module'); $this->description = $this->l('This is just an empty module. You should modify it to make your own.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall this module?'); $this->_checkContent(); $this->context->smarty->assign('module_name', $this->name); } public function install() { if (!parent::install() || !$this->registerHook('displayHeader') || !$this->registerHook('displayLeftColumn') || !$this->registerHook('displayRightColumn') || !$this->registerHook('displayFooter') || !$this->registerHook('displayFooterProduct') || !$this->_createContent()) return false; return true; } public function uninstall() { if (!parent::uninstall() || !$this->_deleteContent()) return false; return true; } public function hookDisplayHeader() { $this->context->controller->addCSS($this->_path.'css/style.css', 'all'); $this->context->controller->addJS($this->_path.'js/script.js', 'all'); } public function hookDisplayLeftColumn() { $this->context->smarty->assign(array( 'placement' => 'left', )); return $this->display(__FILE__, 'left.tpl'); } public function hookDisplayRightColumn() { $this->context->smarty->assign(array( 'placement' => 'right', )); return $this->display(__FILE__, 'right.tpl'); } /* Bilal added */ public function hookDisplayFooterProduct() { $this->context->smarty->assign(array( 'placement' => 'footerproduct', )); return $this->display(__FILE__, 'footerproduct.tpl'); } public function hookDisplayFooter() { $this->context->smarty->assign(array( 'module_link' => $this->context->link->getModuleLink('productspecs', 'details'), )); return $this->display(__FILE__, 'footer.tpl'); } public function getContent() { $message = ''; if (Tools::isSubmit('submit_'.$this->name)) $message = $this->_saveContent(); $this->_displayContent($message); return $this->display(__FILE__, 'settings.tpl'); } private function _saveContent() { $message = ''; if (Configuration::updateValue('MOD_PRODUCTSPECS_NAME', Tools::getValue('MOD_PRODUCTSPECS_NAME')) && Configuration::updateValue('MOD_PRODUCTSPECS_COLOR', Tools::getValue('MOD_PRODUCTSPECS_COLOR'))) $message = $this->displayConfirmation($this->l('Your settings have been saved')); else $message = $this->displayError($this->l('There was an error while saving your settings')); return $message; } private function _displayContent($message) { $this->context->smarty->assign(array( 'message' => $message, 'MOD_PRODUCTSPECS_NAME' => Configuration::get('MOD_PRODUCTSPECS_NAME'), 'MOD_PRODUCTSPECS_COLOR' => Configuration::get('MOD_PRODUCTSPECS_COLOR'), )); } private function _checkContent() { if (!Configuration::get('MOD_PRODUCTSPECS_NAME') && !Configuration::get('MOD_PRODUCTSPECS_COLOR')) $this->warning = $this->l('You need to configure this module.'); } private function _createContent() { if (!Configuration::updateValue('MOD_PRODUCTSPECS_NAME', '') || !Configuration::updateValue('MOD_PRODUCTSPECS_COLOR', '')) return false; return true; } private function _deleteContent() { if (!Configuration::deleteByName('MOD_PRODUCTSPECS_NAME') || !Configuration::deleteByName('MOD_PRODUCTSPECS_COLOR')) return false; return true; } } ?> What my understanding is that 1. I need to access the product object to access the reference field then 2. make a query against the table to get the result inside a result variable then 3. on the .tpl file display them inside a tabular format.. then the query will be like $reference = $this->smarty->product.referece; /* idk how to access this */ so once I have the current loaded reference in a variable then the query will be like SELECT * from ps_tirespecs where catalog=$reference What do you think? Bilal
  9. reference field inside PS.product table is catalog number of my local database table. ? I hope I am explaining it correctly.
  10. Thanks vekia, here you go. CREATE TABLE `ps_tirespecs` ( `Catalog` varchar(30) NOT NULL, `Sidewall` varchar(50) DEFAULT '', `LoadIndex` varchar(50) DEFAULT '', `LoadRange` varchar(50) DEFAULT '', `SpeedRating` varchar(50) DEFAULT '', `UTQGTreadwear` varchar(50) DEFAULT '', `UTQGTraction` varchar(50) DEFAULT '', `UTQGTemperature` varchar(50) DEFAULT '', `MaxSingleLoad` varchar(50) DEFAULT '', `MaxSingleAirPressure` varchar(50) DEFAULT '', `TreadDepth` varchar(50) DEFAULT '', `RimWidthRange` varchar(50) DEFAULT '', `MeasuredRimWidth` varchar(50) DEFAULT '', `SectionWidth` varchar(50) DEFAULT '', `TreadWidth` varchar(50) DEFAULT '', `OverallDiameter` varchar(50) DEFAULT '', `MileageWarranty` varchar(50) DEFAULT '', `RoadHazard` varchar(5) DEFAULT '', `date_add` datetime DEFAULT NULL, `date_update` datetime DEFAULT NULL, PRIMARY KEY (`Catalog`) the above table will have the tire specs information. this table will be being sync with my local POS MySQL database table. We could directly make query to it but as you mentioned it would be easy if the table is in same DB. Now here is how I want it to work. My custom module based on http://www.technoreply.com/how-to-create-a-prestashop-1-5-module/ this tutorial. I used the function hookDisplayFooterProduct() to display it on product page. Once the customer click on item to see the detail page. My code will check the product.reference field against the ps_tirespecs.catalog field to see if there is a match and display all the specs inside a table. which I attached it in earlier post. I will be very thankful to you if you can guide me through. Regards, Bilal
  11. if we set this in .php file how would we access it in .tpl file?
  12. how did it work for you ? did you added this code in .tpl file? and did you added it exactly like that? I am trying to do the same thing. get the product.reference # in the .tpl file. Thanks
  13. Yes, I can put the table in prestashop database. but I would need help with simple select query based on the current page ps_product.reference field to pull related data from new table to display it like this..see the pic.
  14. Yes I meant the ps_prodcut.reference field since this is the catalog# in our POS desktop application. I am creating part# on prestashop DB and running sync app updating their quantities and some other fields with desktop software. Now I built an application to add extra product field in desktop application which I want to display on the product page. (not under extra tab) using simple table. I am new to prestashop development I would have to learn how to initialize the product object in order to get the reference field so I can make query according to that reference.
  15. Hello , can i access the smarty variable 'reference' on the module tpl file? I want to create a custom modules using this tutorial to connect to an external database and using the current loaded product 'reference' variable search and display product extra specification in a tabular format. anybody have an idea how to achieve this? Thanks, Bilal http://www.technorep...hop-1-5-module/
×
×
  • Create New...