Big_Berny
Members-
Posts
10 -
Joined
-
Last visited
Big_Berny's Achievements
Newbie (1/14)
11
Reputation
-
Hi Thanks for your answer! That's exactly what I meant. I need two urls: a friendly one for google (seo) and a general one which we can print on the products. I found out that there are these general urls http://www.example.com/product.php?id_product=25 which get redirected automatically. That's perfect IMHO. I just wanted to know if these also work in Prestashop 1.6 since we use 1.5 but want to update soon. What do you mean by that? I don't know if you understood completely what I mean: We want to print a qr code on our products (bottles) and packaging. That's why the code needs to work for months maybe years - also if the friendly url changes. Best regards
-
Hey guys I've a question. We want to put qr-codes on our products so that people can easily (re-)order them. Now we use seo friendly urls which are very important for google. But for qr-codes they are not useful IMHO as the productname or the seo friendly url structure may change over time. So we'd like to use http://www.example.com/product.php?id_product=25&utm_source=qrcode&utm_medium=produkt&utm_campaign=blabla. Is this link safe to use? We're on 1.5 now, will it also work on 1.6+? Thanks and best regards Big_Berny
-
Overriding AdminCustomersController.php doesn't work
Big_Berny replied to Big_Berny's topic in Core developers
Thanks for your reply. But what do you mean by that exactly? -
Hi guys I use some overrides to change some core functionalities which works great normally. But now I want to replace "public function __construct()" from AdminCustomersController.php and it just doesn't seem to work. What I want: I need an additional column if I click on "Customers" in the backend. As I found I this works quite by adding these lines (for SIRET) in line 99 of the original AdminCustomersController.php: 'siret' => array( 'title' => $this->l('SIRET'), 'width' => 'auto' ), But since this change is not safe when we update I tried to copy the whole "public function __construct()" to the override file it just doesn't work. It just doesn't create the new siret field if I only define it in the override. The code is: <?php class AdminCustomersController extends AdminCustomersControllerCore { public function __construct() { $this->required_database = true; $this->required_fields = array('newsletter','optin'); $this->table = 'customer'; $this->className = 'Customer'; $this->lang = false; $this->deleted = true; $this->explicitSelect = true; $this->addRowAction('edit'); $this->addRowAction('view'); $this->addRowAction('delete'); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->context = Context::getContext(); $this->default_form_language = $this->context->language->id; $genders = array(); $genders_icon = array('default' => 'unknown.gif'); foreach (Gender::getGenders() as $gender) { $gender_file = 'genders/'.$gender->id.'.jpg'; if (file_exists(_PS_IMG_DIR_.$gender_file)) $genders_icon[$gender->id] = '../'.$gender_file; else $genders_icon[$gender->id] = $gender->name; $genders[$gender->id] = $gender->name; } $this->_select = ' a.date_add, IF (YEAR(`birthday`) = 0, "-", (YEAR(CURRENT_DATE)-YEAR(`birthday`)) - (RIGHT(CURRENT_DATE, 5) < RIGHT(birthday, 5))) AS `age`, ( SELECT c.date_add FROM '._DB_PREFIX_.'guest g LEFT JOIN '._DB_PREFIX_.'connections c ON c.id_guest = g.id_guest WHERE g.id_customer = a.id_customer ORDER BY c.date_add DESC LIMIT 1 ) as connect'; $this->fields_list = array( 'id_customer' => array( 'title' => $this->l('ID'), 'align' => 'center', 'width' => 20 ), 'id_gender' => array( 'title' => $this->l('Titles'), 'width' => 70, 'align' => 'center', 'icon' => $genders_icon, 'orderby' => false, 'type' => 'select', 'list' => $genders, 'filter_key' => 'a!id_gender', ), 'lastname' => array( 'title' => $this->l('Last Name'), 'width' => 'auto' ), 'firstname' => array( 'title' => $this->l('First name'), 'width' => 'auto' ), 'siret' => array( 'title' => $this->l('SIRET'), 'width' => 'auto' ), 'email' => array( 'title' => $this->l('E-mail address'), 'width' => 140, ), 'age' => array( 'title' => $this->l('Age'), 'width' => 20, 'search' => false, 'align' => 'center' ), 'active' => array( 'title' => $this->l('Enabled'), 'width' => 70, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'a!active', ), 'newsletter' => array( 'title' => $this->l('News.'), 'width' => 70, 'align' => 'center', 'type' => 'bool', 'callback' => 'printNewsIcon', 'orderby' => false ), 'optin' => array( 'title' => $this->l('Opt.'), 'width' => 70, 'align' => 'center', 'type' => 'bool', 'callback' => 'printOptinIcon', 'orderby' => false ), 'date_add' => array( 'title' => $this->l('Registration'), 'width' => 150, 'type' => 'date', 'align' => 'right' ), 'connect' => array( 'title' => $this->l('Last visit'), 'width' => 100, 'type' => 'datetime', 'search' => false, 'havingFilter' => true ) ); $this->shopLinkType = 'shop'; $this->shopShareDatas = Shop::SHARE_CUSTOMER; parent::__construct(); // Check if we can add a customer if (Shop::isFeatureActive() && (Shop::getContext() == Shop::CONTEXT_ALL || Shop::getContext() == Shop::CONTEXT_GROUP)) $this->can_add_customer = false; } } Any idea, what could be the problem? Maybe the last "parent::__construct();"? Do I have to change that? Thanks in advance!
-
A bit late, but I just found an easy solution: Open "product.tpl" from your theme and replace the line {foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'} with {foreach from=$quantity_discounts|@array_reverse item='quantity_discount' name='quantity_discounts'} Another solution would be to modify a class (SpecificPrice.php I think) but the above solution is much safer IMHO.
-
Override does not work for Product.php Class (v 1.5.2)
Big_Berny replied to bluego78's topic in Core developers
I found the solution for my problem: I just had to delete "cache/class_index.php" (eventough I hadn't enabled cache), so that this file get's re-created (happens automatically). The problem was that I renamed the override-folder to debug a problem. And that appears to change that file I mentioned above so that prestashop doesn't recognize the override-folder anymore when you rename it back. Try it out. -
Please Read: Security Procedure
Big_Berny replied to Mike Kranzler's topic in Ecommerce x PrestaShop [ARCHIVE BOARD]
I always get this error when running herfix.php: Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/vhosts/sweetbasel.com/httpdocs/../tabs) is not within the allowed path(s): (/var/www/vhosts/sweetbasel.com/httpdocs:/tmp) in /var/www/vhosts/sweetbasel.com/httpdocs/herfix.php on line 3156 OK Any idea why this is happening? -
Hi guys I just asked a similar question but it's not quite the same. Is it possible to create a new variable $category_parent? It should be exactly the same like $category but instead with the parent category. So probably I can just copy and modify classes/category.php, right? But what I have to change exactly? Thanks a lot Big_Berny
-
Hi guys I just started to design a new webshop with PrestaShop. The CMS looks really nice! Since I want to change the design quite a bit I need to modify category.tpl. Because we have four categories and sub categories: Main A Sub A1 Sub A2 Sub A3 Main B Sub B1 Sub B2 The problem is that if we open a Sub Category (A2 for example) it only shows the products from this sub category. So it should still show all products from Main A in my homepage. Do you have any idea how this could be done in category.tpl? I'd need a command to replace $category with $parent_category or something like that. Does anyone has an idea? I only know that I can get the ID from the parent category with {$category->id_parent}. But that's only the ID. How do I get a whole $parent_category? My idea is to use a code like this at the beginning of category.tpl: If $category->id_parent NOT 1 (=is subcategory) then $category = $parent_category End If Thanks for your help! Big_Berny