Jump to content

speed3r

Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Location
    Poland
  • Activity
    Freelancer

speed3r's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. Hello, I'm looking for a way to change standard thumbnails list with simpler one, without slide feature - just a grid with several columns and rows. However, I need to get rid of "display: list-item" attribute which is added to every list element in ul#thumbs_list_frame and I can't find place where it's declared. <li id="thumbnail_27477" style="display: list-item;"> It doesn't appear in product.tpl: <li id="thumbnail_{$image.id_image}"> So I guess it has to be somewhere in javascript files. I've been "grep-ing" *.js files to find that attribute, without luck. Can anyone tell me where to look for it? I'm using custom version of prestashop default theme.
  2. Hey, sorry, I haven't solved that issue yet. As far as I know, it will require overriding module controller by adding a method to check for module's override before loading module. However, I'm pretty sure that will cause some problems with hooks, so I gave up on it for now - prestashop updates slowed down a bit recently.
  3. I'm familiar with developers guide. There is described how to override a .tpl, .css or .js file, not a .php file. It's not even a formal override in terms of OO, it just links another file instead. Even if it was possible to replace a php file, it shouldn't be done this way. Is there any other way to keep your module up-to-date without editing it's core file every update just to add one simple method containing new hook position?
  4. Hello, I'm looking for a way to add new hook to ps module (blocklayered, blocksearch) without editing module core files, because they're replaced whenever you update module. Is there any way to override module PHP file in PS1.5? Is it possible to add new hook to a module using controllers/classes override?
  5. Thanks for posting solution to this issue, it's working fine with PS1.5 as well. I found a little typo in your manual - missing "d" in DB table creation causes problems in queries further: I made a class override for PS1.5 based on your code - you can overwrite prestashop/override/classes/Customer.php with that code instead of editing core files. <?php class Customer extends CustomerCore { public function getByEmail($email, $passwd = null) { if (!Validate::isEmail($email) || ($passwd && !Validate::isPasswd($passwd))) die (Tools::displayError()); $sql = 'SELECT * FROM `'._DB_PREFIX_.'customer` WHERE `email` = \''.pSQL($email).'\' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' '.(isset($passwd) ? 'AND `passwd` = \''.Tools::encrypt($passwd).'\'' : '').' AND `deleted` = 0 AND `is_guest` = 0'; $result = Db::getInstance()->getRow($sql); // == BEGIN ZEN-CART / OSCOMMERCE TO PRESTASHOP PASSWORD INTEGRATION == // == BY João Cunha - [email protected] // == @ 31/03/2012 // == USE AND MODIFY AT WILL // == TESTED ON PRESTASHOP V1.4.7X if (!$result) { //<- INVALID PRESTASHOP LOGIN, IT MAY BE A ZEN-CART / OSCOMMERCE PASSWORD //CHECK IF THE GIVEN EMAIL MATCHES A ROW IN OUR LEGACY TABLE AND RETRIEVES THE LEGACY PASSWORD $resultZC = Db::getInstance()->getRow(' SELECT `password` FROM `osc_legacy_passwords` WHERE `email` = \''.pSQL($email).'\' AND `updated` = 0'); if (!$resultZC) return false; //<- EMAIL NOT FOUND IN NONE OF THE TABLES, SO IT IS AN INVALID LOGIN //ENCRYPTS THE GIVEN PASSWORD IN ZEN-CART / OSCOMMERCE FORMAT $salt = substr($resultZC['password'], strrpos($resultZC['password'],':')+1, 2); $ZCpassword = md5($salt . $passwd) . ':' . $salt; if ($ZCpassword != $resultZC['password']) return false; //<- WRONG ZEN-CART/OSCOMMERCE PASSWORD GIVEN //WE'LL UPDATE THE CUSTOMER TABLE WITH ITS PRESTASHOP ENCRYPTED PASSWORD... Db::getInstance()->Execute(' UPDATE `'._DB_PREFIX_ .'customer` SET `passwd` = \''.md5(pSQL(_COOKIE_KEY_.$passwd)).'\' WHERE `email` = \''.pSQL($email).'\''); //...AND FLAG IT AS UPDATED, SO THE NEXT TIME HE LOGS IN, HE WON'T ENTER THIS ROUTINE. Db::getInstance()->Execute(' UPDATE `osc_legacy_passwords` SET `updated` = 1 WHERE `email` = \''.pSQL($email).'\''); //USER IS AUTHENTICATED, OVERWRITE THE EMPTY $result VARIABLE $result = Db::getInstance()->getRow(' SELECT * FROM `'._DB_PREFIX_ .'customer` WHERE `active` = 1 AND `email` = \''.pSQL($email).'\' AND `deleted` = 0 AND `is_guest` = 0'); } // == END ZEN-CART / OSCOMMERCE TO PRESTASHOP PASSWORD INTEGRATION $this->id = $result['id_customer']; foreach ($result as $key => $value) if (key_exists($key, $this)) $this->{$key} = $value; return $this; } } EDIT: Forgot to mention - I've renamed legacy passwords table name to osc_legacy_passwords so you'll probably have to rename it (either table name in DB or hardcoded in script).
×
×
  • Create New...