Jump to content
thirty bees forum

Lathaneo

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by Lathaneo

  1. Hi, Another way, is to block assets you don't want to load on your browser. Way to do in chrome: options panel (3 dots in top right) -> More Tools -> Developer Tools -> Network tab -> right click on what you want block -> Block request URL Resources will be block forever, no need to do it every time. Hopefully, you can unblock if needed. image url)
  2. Here for example Can find a lot of posts about window.open() and Chrome,. So i'm very confused, cause it's works in PS16 on Chrome.
  3. Hi, I tried TB and PS1.6, with adblock and without, on Firefox and Chrome. I didn't try on same domain, just in local. In fact, window.open() shouldn't works in Chrome, some people said it's desactivated for get better user experience. I notice if you try window.open() in Chrome javascript console, it's works. Regards.
  4. Hi, I notice that preview of CMS page doesn't works on Chrome. When clicking on 'Save and preview' button, previews page doesn't come. I think it's cause that: if(window.location.href.indexOf("url_preview") > -1) { window.open("{$url_prev}", "_blank"); } window.open() function is block on Chrome, not on Firefox. But, same function work with PS1.6 on Chrome and Firefox. Preview on Product page works, but it's not the same redirection system. It's doesn't looks to be caused by adblocker. I tried a lot of solutions, no ones work. Any suggestions? Regards.
  5. Hi, For the first one, he add nl2br filter, just transform the \n in . Like he explained, it's should working, except if you add some HTML. In the case you add some HTML tags, you have to specify 'nofilter' for not transforning HTML Tags. Second link, it's the same. Regards.
  6. Hi, Really easy, in fact, it's already a HTML block for the address field, the field is a texarea, and you can extend the field by draging the coner. When saving, an "HTML clean filter" remove HTML tag. When displaying, another filter transform HTML tag in clean characters. To remove these filters, 2 modify to add: in modules\blockcontactinfos\blockcontactinfos.php, line 72, replace the getContent() function by : (just add "true" paramater to say it's some html you what to save) public function getContent() { $html = ''; if (Tools::isSubmit('submitModule')) { foreach (Blockcontactinfos::$contact_fields as $field) Configuration::updateValue($field, Tools::getValue($field), true); $this->_clearCache('blockcontactinfos.tpl'); $html = $this->displayConfirmation($this->l('Configuration updated')); } } in themes\community-theme-default\modules\blockcontactinfos\blockcontactinfos.tpl, remove HTML filter with that: {$blockcontactinfos_address nofilter} If you need more texarea for other fiels, just replace the type field in renderForm() by: 'type' => 'textarea', Should works, Regards.
  7. Hi, I know i'm not answering to your question, but if you're looking to get some ThirtyBees stuff and triyng to get it works on Prestashop, you're on the wrong way. Just migrate and enjoy. Regard.
  8. Hi, Good nice question ! Except that password are not encrypted, but hashed ;) Cause you can't reverse the process. The hash password is made with Tools::hash(); /** * Hash password with native `password_hash` * * @param string $password * * @return bool|string * * @since 1.0.0 * @version 1.0.0 Initial version */ public static function hash($password) { return password_hash($password, PASSWORD_BCRYPT); } The hash() methode use the native function in the PHP API, password_hash() . To compare password, TB (and probably PS) use password_verify($plainTextPassword, $result['passwd']) So, no key needed for hash them, as mention here, it's easier and safer. Regards.
  9. Hi, What's the module? What are the main functions? Regards.
  10. Hi, May be you should to find a way to override the validate javascript function to match with this. You can find it in validate.js in root/js dir. It's just a function: function validate_isPhoneNumber(s) { s.replace(/ +/g, "-"); var reg = /^[0-9]{7,15}$/; return reg.test(s); } I'm not really fan of regex, this one is wrong, but it should be something like that. Make the validation process before send the form, in my opinion, is better than doing it after with the validate.php. Regards.
  11. Really nice looking and works fast :)
  12. Hi, This module use resmush.it, this service is free, no need to create account. I only test on ThirtyBees vanilla shop, so, with the 25 pictures. But with this few example of pictures, we can see some good improvements. The default quality on resmush.it is 92%, you can save, at least, the half of weight. This is the result for the first picture by type: cart_default 49.2480% home_default 38.5990% homedefaultsmaller 39.2715% homedefaultsmallest 39.3455% large_default 35.5159% medium_default 44.2768% small_default 42.4338% thickbox_default 49.5750% The percentage is (weight after / weight before * 100) To get an optimized picture, just push on the generate button, wait 1 second, the new picture is write on the right directory, and you get the save weigth of the process. For now, you have to push the button for each picture. Some stuff doesn't works yet like: * choose the quality, * the genenaration by lot, * checking quality by viewing, etc... I ll do it later. If you just want to test before, stay in demo mode, all optimized images will be in the same directory than genuine ones, with '_opt.jpg' in the name. Everything is not totaly perfect, so, if you have some suggestions, don't hesitate to let them there. You can download the module there or check it on my github page. Regards. MAJ 1 : Add error msg, jquery growl and animated button
  13. Hi, @SLiCK_303, you're right, that why i add the select option only for category page. {if $page_name == 'category'} <option value="sales:desc"{if $orderby eq 'sales' AND $orderway eq 'desc'} selected="selected"{/if}>{l s='Best Sales'}</option> {/if} The sort in category page is made only by the blocklayered module. If you want add the sort 'Best Sales' on other pages, you have just to modify the class which is doing the sort. For BestSales page, it's in Productsale::getBestSales(), etc... so, each page get it's own sort function. And, yes it's should be really cool to get only one function, fully parameterizable, for all this sorts. And, yes, of course it's faisable. Regards.
  14. Hi, Your links are broken. It's looks like a HTML tags problems. Evenif links work, browser try to fix itself wrong HTML tag, and from where we are, can't find the problem cause the browser. Hard to guess what's happen :( The best it's to try again with standard theme, and let's us know what's happen with. Regards,
  15. Hi, Just replace right variables with what you want in : ``` DROP PROCEDURE IF EXISTS CHANGETHERETAILPRICE; delimiter $$ CREATE PROCEDURE CHANGETHERETAILPRICE() BEGIN DECLARE n INT DEFAULT 0; DECLARE i INT DEFAULT 0; DECLARE coef FLOAT DEFAULT 0; SELECT count(*) as count FROM tb_product_shop INTO n; SET i=9900001; SET coef=2.86; WHILE i<=n DO UPDATE tb_product_shop SET price= (tb_product_shop.wholesale_price * coef) WHERE tb_product_shop.id_product= i AND tb_product_shop.id_shop = 1; SET i = i + 1; END WHILE; End; $$ CALL CHANGETHERETAILPRICE(); ``` If don't works, just tell me what's in SELECT @@sql_mode; Regards.
  16. Hi, You can implement this with an override. Just create a file named Validate.php in directories override\classes So you get your file at override\classes\Validate.php In Validate.php, just write: ``` <?php class Validate extends ValidateCore { public static function isEmail($email) { if (empty($email) || !pregmatch(Tools::cleanNonUnicodeSupport('/^[a-z\p{L}0-9!#$%&\'*+\/=?^{}|~_-]+[.a-z\p{L}0-9!#$%&\'*+\/=?^{}|~-]@[a-z\p{L}0-9]+(?:[.]?[_a-z\p{L}0-9-]).[a-z\p{L}0-9]+$/ui'), $email)) return false; try { \Swift_Message::newInstance()->setFrom($email); return true; } catch (\Exception $e) { return false; } } } ``` Clean the cache (especially class_index.php), and it's works. Regards.
  17. Hi, Sorry for the uploaded files, I don't have enough privileges to share them. I edited and added some modifications. You can download file in my git repository, but have still have to change the template file manually. (I changed the file name of blocklayered.js in blocklayered_mod.js cause the template override) https://github.com/Lathanao/blocklayered Regards.
  18. Hi, I get a right best sales sort, with some little modifications, i ll try to don't forget some there, there is 4 files to modifify: In Tools.php, replace the function getProductsOrder() by: ``` public static function getProductsOrder($type, $value = null, $prefix = false) { switch ($type) { case 'by': $list = [0 => 'name', 1 => 'price', 2 => 'dateadd', 3 => 'dateupd', 4 => 'position', 5 => 'manufacturername', 6 => 'quantity', 7 => 'reference', 8 => 'sales']; $value = (isnull($value) || $value === false || $value === '') ? (int) Configuration::get('PSPRODUCTSORDERBY') : $value; $value = (isset($list[$value])) ? $list[$value] : ((inarray($value, $list)) ? $value : 'position'); $orderbyprefix = ''; if ($prefix) { if ($value == 'idproduct' || $value == 'dateadd' || $value == 'dateupd' || $value == 'price') { $orderbyprefix = 'p.'; } elseif ($value == 'name') { $orderbyprefix = 'pl.'; } elseif ($value == 'sales') { $orderbyprefix = 'psa.'; $value = 'quantity desc, psa.salenbr'; } elseif ($value == 'manufacturername' && $prefix) { $orderbyprefix = 'm.'; $value = 'name'; } elseif ($value == 'position' || empty($value)) { $orderbyprefix = 'cp.'; } } return $orderby_prefix.$value; break; case 'way': $value = (is_null($value) || $value === false || $value === '') ? (int) Configuration::get('PS_PRODUCTS_ORDER_WAY') : $value; $list = [0 => 'asc', 1 => 'desc']; return ((isset($list[$value])) ? $list[$value] : ((in_array($value, $list)) ? $value : 'asc')); break; } } ``` In modules/blocklayered/blocklayered.php, line 3146, insert just after 'LEFT JOIN '.DBPREFIX.'manufacturer m ON [...]' and before 'WHERE '.$aliaswhere [...]': LEFT JOIN `'._DB_PREFIX_.'product_sale` psa ON psa.id_product = p.id_product so you get: LEFT JOIN '._DB_PREFIX_.'manufacturer m ON (m.id_manufacturer = p.id_manufacturer) '.Product::sqlStock('p', 0).' LEFT JOIN `'._DB_PREFIX_.'product_sale` psa ON psa.id_product = p.id_product WHERE '.$alias_where.'.`active` = 1 AND '.$alias_where.'.`visibility` IN ("both", "catalog") And in themes/community-theme-default/product-sort.tpl, add this line, where you want in the select tag: {if $page_name == 'category'} <option value="sales:desc"{if $orderby eq 'sales' AND $orderway eq 'desc'} selected="selected"{/if}>{l s='Best Sales'}</option> {/if} Last file, in 'themes/community-theme-default/js/modules/blocklayered/blocklayered.js', Line 637 and 643, find this line : reloadContent('forceSlide'); and replace by : reloadContent('&forceSlide'); That's all, clear your cache-file, and run. Regards. Edit: One more file to change, and delete wrong uploads.
  19. Hi, I try to sort products on the demo shop :https://front.thirtybees.com/Coffee#. Sort on category page looks wrong, for example, try 'Product Name: Z to A' and 'Product Name: A to Z', it's always the 'Product Name: A to Z' sort which is displayed. I think this cause this file: themes\community-theme-default\js\modules\blocklayered\blocklayered.js The function reloadContent('forceSlide') add a parameter in URL, and isn't separate from the previous one by a '&' So the function Tools::getProductsOrder() get only "descforceSlide" in paramater and send back always 'asc' So in blocklayered.js, i replaced reloadContent('forceSlide') by reloadContent('&forceSlide'), line 637 and 643. and it's looks better now, sort is right. Regards. Edit: My first solution was wrong.
  20. Hi, I just fix the createDatabase() in ObjectModel.php, The guenuine blog module work well with this fix. https://github.com/Lathanao/thirtybees/blob/dev/classes/ObjectModel.php Regard.
  21. Hi, I just made an installable blog module. The one we can find in the TB1.03, installation can't works for me. I put my project on my github (first project!), as follow in instruction, it's still in the dev branch. https://github.com/Lathanao/beesblog/archive/dev.zip So you can get acces to the admin controller, make some posts, etc... nothing more was added, just the basic functionnalities. For the front, as I remove namespaces in all controllers, so you need to remove them in beesblogrecentposts module. I can share files if needed. Hope that could be help.
×
×
  • Create New...