
treyj45
Members-
Posts
22 -
Joined
-
Last visited
Profile Information
-
Activity
Developer
treyj45's Achievements
Newbie (1/14)
1
Reputation
-
Hi, I want to make changes to this file /tools/minify_html/minify_html.class.php Is there a way I can override this file so the changes are permanent even with upgrading prestashop? I'm using version 1.6.1.10. Thanks
-
I am having problems calling a email template. In mymodule/admin/mycontroller.php I run this code Mail::Send( 1, 'free-product', Mail::l('Free Product!', 1), $templateVars, $customer['email'], $customer['firstname'].' '.$customer['lastname'], strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), null, null, dirname(__FILE__).'/../../mails/' ); This code returns Error - The following e-mail template is missing: ....... /modules/mymodule/controllers/admin/../../mails/en/free-product.html I run the same code in mymodule/front/mycontroller.php and it works fine. Any ideas why this is not working on admin controller? Is there another way to get that tpl path?
-
I want to have an employee group where they can configure the module, but not disable or upgrade it. Is this possible?
-
PS 1.5: Carrier ID change (increment) after saving
treyj45 replied to Coluccini's topic in Core developers
I did this to 1.6.1.10 and it seems to be working with no historic carrier id data collected. controllers/admin/AdminCarrierWizardController.php starting at line 755 in the function ajaxProcessFinishStep if ($id_carrier = Tools::getValue('id_carrier')) { $carrier = new Carrier((int)$id_carrier); if (Validate::isLoadedObject($carrier)) { // Fill the carrier object with form data $this->copyFromPost($carrier, $this->table); $carrier->update(); $carrier->setTaxRulesGroup((int)Tools::getValue('id_tax_rules_group')); } } I also had to change the range code at line 665 if ($range_type == Carrier::SHIPPING_METHOD_WEIGHT) { if (!RangeWeight::rangeExist((int)$carrier->id, (float)$delimiter1, (float)$range_sup[$key])){ if(!RangeWeight::getRanges((int)$carrier->id)){ $range = new RangeWeight(); } else{ $range= new RangeWeight((int)$key); } } else { $range = new RangeWeight((int)$key); $add_range = false; } } if ($range_type == Carrier::SHIPPING_METHOD_PRICE) { if (!RangePrice::rangeExist((int)$carrier->id, (float)$delimiter1, (float)$range_sup[$key])) { if(!RangePrice::getRanges((int)$carrier->id)){ $range = new RangePrice(); } else{ $range= new RangePrice((int)$key); } } else { $range = new RangePrice((int)$key); $add_range = false; } } -
Add hook without resetting module
treyj45 replied to treyj45's topic in Addons, modules and themes developers
I ended up adding into db like INSERT INTO `ps_hook` (`name`, `title`, `description`, `position`, `live_edit`) VALUES ('myNewHook', 'myNewHook', '', '1', '1') Then I went into positions and transplanted hook to module -
Add hook without resetting module
treyj45 replied to treyj45's topic in Addons, modules and themes developers
What if I am creating a new hook? -
Hi, I have a blog module that is pretty big, and has a lot of data in it and also lots of settings. I want to add a hook to display blog posts. So I know it would work if I add this in install !$this->registerHook('displayBlogPost) and then add public function hookDisplayBlogPost($params) { } The problem is I dont want to reset this module. I want all the settings and data to stay intact. How can I accomplish this? Thanks.
-
Hi I have installed the module Password recovery & High Security Password Storage v1.1.1 - by MADEF IT This friendly SEO routes are not working for this module but are for rest of site. The php code is public function hookModuleRoutes() { return array( 'module-passwordsecurity-recoverpassword' => array( 'controller' => 'recoverpassword', 'rule' => 'passwordlost/recover', 'keywords' => array( 'module' => array('regexp' => '[\w]+', 'param' => 'module'), 'controller' => array('regexp' => '[\w]+', 'param' => 'controller'), ), 'params' => array( 'fc' => 'module', 'module' => 'passwordsecurity', 'controller' => 'recoverpassword', ), ), 'module-passwordsecurity-changepassword' => array( 'controller' => 'changepassword', 'rule' => 'passwordlost/change', 'keywords' => array( 'module' => array('regexp' => '[\w]+', 'param' => 'module'), 'controller' => array('regexp' => '[\w]+', 'param' => 'controller'), ), 'params' => array( 'fc' => 'module', 'module' => 'passwordsecurity', 'controller' => 'changepassword', ), ), ); } I get a 404 every time I try to go to one of these pages accessing such as http://localhost/passwordlost/recover . When I access like this it works perfectly fine. http://localhost/index.php?fc=module&module=passwordsecurity&controller=recoverpasswrod Does anyone know what is wrong or how I can troubleshoot this? I wasnt able to find any relevant info in the logs I was looking at. Thank you.
-
I added a new field like so in product.php controller public $copyright_symbol; And to the definition array..... 'copyright_symbol' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'), I added a var_char 255 field in ps_product_lang Informations.tpl I added... <div class="form-group"> <div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="copyright_symbol" type="default"}</span></div> <label class="control-label col-lg-2" for="copyright_symbol"> {l s='Copyright Symbol'} <div class="col-lg-3"> <select name="copyright_symbol" id="copyright_symbol"> <option value="none" {if !isset($product->copyright_symbol) or $product->copyright_symbol == 'none'}selected="selected"{/if} >{l s='None'}</option> <option value="reg" {if $product->copyright_symbol == 'reg' or $product->copyright_symbol[1] == 'reg'}selected="selected"{/if} >{l s="Reg"}</option> <option value="trade" {if $product->copyright_symbol == 'trade' or $product->copyright_symbol[1] == 'trade'}selected="selected"{/if} >{l s="Trade"}</option> </select> </div> </div> Why does {$product->copyright_symbol} come back as an array? Why do I need to put $product->copyright_symbol[1] to get my value?
-
Thanks, that got me thinking. I figured it out. It might not be the prettiest, but it works for me. Then I created a new product with only the title I want(the alias) and the original product it is referencing . I created a new field in the ps_product table named alias_master_id and default value of 0. I just made an admin field to change it, and then I just put the original master ID inside of this field. Then I overwrote the category class in the function getProducts I changed this code return Product::getProductsProperties($id_lang, $result); To : $displayed_products = Product::getProductsProperties($id_lang, $result); foreach ($displayed_products as $key => $alias) { if ($alias['alias_master_id'] != 0) { //Assign master vars $master_product = new Product($alias['alias_master_id'], true, Configuration::get('PS_LANG_DEFAULT')); $master_product_vars = get_object_vars($master_product); $master_product_vars['id_product'] = $alias['alias_master_id']; //Assign propertiy vars for master product $product = Product::getProductProperties($id_lang, $master_product_vars); //Overwrite name with alias name $product['name'] = $alias['name']; //Get default image $image_array= $master_product->getCombinationImages($id_lang); $product['id_image'] = $master_product_vars['id_product'] .'-'. $image_array[$master_product_vars['cache_default_attribute']][0]['id_image']; //Update main array $displayed_products[$key] = $product; } } return $displayed_products; It seems to be working how I would want it to.
-
Hi, Is there a way to create a prdouct alias? Basically I want to have the same product have two names for sorting purposes when displayed in the category. The customer could logically look two places for the product in a list. I dont want to make a new product because they are the same thing, just with a slight modification to the name. Can one product somehow be a dummy name to refer back to the other one? Thanks
-
Hi, I am using the Ajax cart all over my site, this makes a popup when I add something to cart. I want to keep this functionality on all pages except one. I have an order form module where I do not want there to be a pop up because people can add multiple products at once. I want it to go straight to the cart when they hit add to cart. Heres the code: $('.orderform_content table tbody tr').each(function () { if ($(this).find('.quantity_wanted').val() > 0) { var currentRow = $(this); ajaxCart.add(currentRow.find('.name .id_product').val(), currentRow.find('.name .id_product_attribute').val(), false, this, currentRow.find('.quantity_wanted').val(), null); if (empty == 1) currentRow.find('.quantity_wanted').val("0"); } }); Is there a way to make ajax cart prevent the popup and go to the cart once done? Or is there a different way I can add products to cart without javascript? Thanks
-
Hi, I have this tpl file in a module. /modules/prestablog/themes/default/tpl/module_page-all.tpl I want to override it so I made this file /themes/transformer/modules/prestablog/themes/default/tpl/module_page-all.tpl It is still pulling the original one in the module. Does anyone know why this isnt working? Ive cleared the cache and made sure permissions were open enough. Thanks
-
What is the best way to upload generic images to prestashop? For example I am trying to add the same image to every product page under the add to cart I was able to upload an image by going in to a CMS page, clicking on upload image, which took me to a file manager where I was able to upload my image. Now, the real question is what is the code to call this image so I can insert it where I want to? Is this really the best way to upload and display images? I am using version 1.6.1.3 . Thanks
-
Hi, I updated from 1.6.0.9 to 1.6.1.1. All the code is up to date, but the datebase is the 1.6.0.9 version. Is there somewhere I can see what code to run to update the tables to have proper content? Also when I go to the products tab it says Bad SQL query Unknown column 'image_shop.id_product' in 'on clause' It is missing the ps_ which is what I have set as _DB_PREFIX_ in settings.inc.php file Thank you