Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by me-and-prestashop

  1. OK. I copied the the Prestashop 1.6 to my localhost (Mamp) and ran this SQL query in the test environment (phpMyAdmin): # Delete old connection data (only used for stats) # change 2016-02-01 00:00:00 according to you needs DELETE c, cs FROM ps_connections c LEFT JOIN ps_connections_source cs ON (c.id_connections = cs.id_connections) WHERE c.date_add < '2016-01-01 00:00:00'; OPTIMIZE TABLE ps_connections, ps_connections_source; It reduced the ps_connections table from 2233686 to 1422691 rows (302.5 to 186.3 MiB) and the ps_connections_source from 183.4 to 102 Mib. The site worked fine both before and after this operation. I found the SQL queries here on GitHub I plan on reducing the ps_guests table as well. It has more than 2423360 rows (241.4 MiB). Will try this (phpMyAdmin): # Delete all guest without entry in ps_customer table DELETE g FROM ps_guest g LEFT JOIN ps_customer c ON (g.id_customer = c.id_customer) WHERE c.id_customer IS NULL; OPTIMIZE TABLE ps_guest; Julienbourdeau's queries was a big help. To delete these rows manually would be a pain.
  2. If any one experience slow page loads I would also suggest using https://tools.pingdom.com to test the site. If image sizes (banners) is to large it will show. And also if sosial plugins slows down page loads.
  3. I have a Prestashop 1.6 with a huge database (almost 1 GB!). I can see that ps_connections and ps_guest has more than 2 million rows each. Also ps_connections_source and ps_page_viewed is pretty large. Looking at the date_add on each row I can see rows all the way back to 2014. Is it safe to delete rows from e.g. 2014 and 2015 in these tables? (and keep rows from 2016 and 2017) I'd like to reduce the database size.
  4. I had a problem where sorting a category a-z or by price listed only some of the products in the category. The solution was easy. Go to the modules page and configure the blocklayered module. There you will find a URL like this: http://www.mydomain.com/modules/blocklayered/blocklayered-price-indexer.php?token=9e02e1e7a6 Visit this link and wait... Problem solved (in my case)
  5. The (Revolution) Slider (full screen) I linked to earlier seem to do just this. But it is cropping the background image quite hard on the right side on narrow screen sizes. Usually I operate with either (width: some value; and height: auto;) or (height: some value; and width: auto;). I guess you could do the latter and make the banners extra wide. To prevent scrolling I guess you could try some kind of overflow: hidden. To set the height of the slides is not easy - since the window can be resized. In modern browsers I guess you can use calc. Example: .your-class { height: -moz-calc(100% - 200px); height: -webkit-calc(100% - 200px); height: calc(100% - 200px); }​ It probably won't work in older browsers. And also the header height is not fixed. I'am afraid I can't help you more on this. Try asking some of the wizards over at stackoverflow.com
  6. Try: .columns-container { margin: 0px auto; max-width: 1170px; /* ajoust page content max-width */ } .index columns-container { max-width: 100%; /* to not screw up your frontpage slider width */ } #header .container { max-width: 100%; /* menu and header full width */ } header .row #header_logo { padding-left: 3%; /* logo space left */ }
  7. Are your site online? Why not buy what you want? Like this one? http://smartdatasoft.com/codecanyon/revolution_ps/fullscreen.php (I don't know how well this one works, but it even plays well in my old Safari 5.0.5)
  8. To ajoust the menu, it is probably easier to place the menu outside the container div and/or row div inside the header - on the home page only (using if-statments). So the menu is in the default place if page is not index {if $page_name !='index'} ... {/if} The menu is outside the divs mentioned if page is index. Then you can style the #block_top_menu to width: 100%; (Backup the file before editing a .tpl file in case something goes wrong)
  9. Does this also apply to PS The friendly url for category 2 is set to "products". domain.com/products, domain.com/2-products, domain.com/2-home all give a 404 (page not found) Sorry. Found this one: http://stackoverflow.com/a/24051605/762640
  10. I have not tested this on a real installation of Prestashop, but as a start you might try: .index #columns { max-width: 100%; } .index #columns .row { margin-left: auto; margin-right: auto; max-width: 1170px; } .index #slider_row.row { max-width: 100%; } In addition to this you will have to change the size of the banner(s). Here is a guide for making the main banner (slider) full width. Remember that your banner is now more than 1170px wide - depending on the user's screen width. (The banner will be much smaller on e.g. a smart-phone.) (Edit: Added .index to target home page only)
  11. Under Modules position - make sure to rearange displayHomeTop and displayHomeTopContent. Rearanging actionProductAdd, actionProductDelete or actionProductUpdate will not give the desired outcome on the home page.
  12. Google is your friend. I found this searching for "prestashop 1.6 homeslider full width": https://m.youtube.com/watch?v=qKUzECilPJk
  13. In global.css try: .container { max-width: 98%; } in stead of: .container { max-width: 1170px; } You will probably want to do some more ajoustments (e.g. for the banners)
  14. Yes. I'am playing around on a dev installation for now. Was only showing that the zeros in {$customerGroups[0]['id_group']} - {$customerGroups[0]['name']} apparently is referring to the first group ticked off for each user (smallest group id number ticked off). One can also look at the second, third, forth chosen group to see if it's a match. By the way. Is there anything particular unsafe with this raw module? I am looking for a solution to allow only one customer group to see the supplier page and -lists (and site map item). I would not know how to do this in a safer way.
  15. This is not beautifull, but it works for me in PS 1.6. Let's say you have the 3 customer groups pluss one custom group. You would like to test if the user is logged in and is a member of the custom group (id 4) (the user can also be a member of other groups). First install prestashopninja's module (thank you prestashopninja). In the template try this: {if is_array($customerGroups) } {if $customerGroups[0]['id_group'] eq '4' || $customerGroups[1]['id_group'] eq '4' || $customerGroups[2]['id_group'] eq '4' || $customerGroups[3]['id_group'] eq '4'} Content for group 4 goes here {else} You are not in group 4 {/if} {else} You are not in any customer groups (or not logged in) {/if}
  16. I am trying to give one customer group access to suppliers, but not visitors and other groups. For each customer group I can authorize modules from the (admin) group edit page. If "Suppliers block" is set to "NO", visitors and other groups are still authorized to see suppliers page (/supplier) and the site map suppliers link. The logic of restricting some customer groups from seeing suppliers should apply to these places as well. How can one do a if-test to see if the person is authorized for "Suppliers block" (in e.g. theme sitemap.tpl, supplier-list.tpl, supplier.tpl )
  17. I was not able to upload PDFs - even after applying the Git hub fix above. It turned out that my test PDFs where 3Mb+ and that the hosts default upload limit where 2Mb. Take a look at your php settings. Changing the setting to upload_max_filesize=18M; did it for me.
  18. Thank you for the help and clarification. I will have to edit the admin .tpl file then. When adding new css rules to the admin theme I found the adminXXX/themes/default/css/overrides.css and hope this is not overwritten when updating later. I will just have to save a copy/backup of the edited adm theme files for updates. On most modules the shop editor/employee will have access to the functionality inside admin without specific access to view or edit the module. But employees will need permissions to configure some modules - like the "Theme configurator" module. My solution so far is to remove the module menu item in admin menu (using profile permission) and hide the #moduleContainer (using CSS) in case the employee finds the link to the modules page in the breadcrumbs. How do other Prestashop devs prevent employees from updating, disabling, deleting modules they have access to? (Sometimes it would be useful to give access to some configuration options only - like the bottom part (banners) of the "Theme configurator" module. Is this done with customization of controllers/template files or by using other more specific modules?)
  19. I need to add the employee profile as a class in the body tag of Back Office. Editing the file adminXXXX/themes/default/template/header.tpl seem to do just this. On line 110: <body class="ps_back-office{if $employee->bo_menu} page-sidebar{if $collapse_menu} page-sidebar-closed{/if}{else} page-topbar{/if} {$smarty.get.controller|escape|strtolower} {if ((int)Context::getContext()->employee->id_profile) == 5}profile5{/if}"> Instead of editing this file, it is probably better to make this an override. I tried to make a copy of the header.tpl and place it inside (www)/override/controllers/admin/templates/ but the override did not happen. Do I need to make some folder structure inside the override folder? Or do I use some other override folder? Do I need to delete cache/class_index.php? Also I need to add new css rules to the admin theme. What is best practice for adding custom css to the default admin theme? Why? I need to hide certain elements in the BO for this profile. Since the profile permission is not specific enough. E.g. the employees need to configure some modules without being able to update, disable, delete the module (ref. this forum post) Any help would be appreciated
  20. If you are NOT running PS in catalog_mode, I am not sure my solution above will help you. When add to wishlist from product page is working, I can see the comments "quantity wanted" and "minimal quantity wanted" in frontend. Some of these elements are there but hidden in catalog_mode. I should also mention that I am using a copy of the default-bootstrap theme. I've only edited some of the template files to make the prices reappear in catalog_mode. Things might look a little different in another theme with cart enabled etc...
  21. I am using Prestashop (in catalog mode). The bug is still there. I applied some of jaimegomez's fix and added a slide to input fields to guide the user to the fields. (ajax-wishlist.js) /** * Hide/Show bought product * * @return void */ function WishlistVisibility(bought_class, id_button) { if (($('#hide' + id_button).css('display') == 'none') || ('wl_send' == bought_class)) { $('.' + bought_class).slideDown('fast'); $('#show' + id_button).hide(); $('#hide' + id_button).css('display', 'block'); $("html, body").delay(500).animate({ scrollTop: $('.wl_send').offset().top }, 1000); } else { $('.' + bought_class).slideUp('fast'); $('#hide' + id_button).hide(); $('#show' + id_button).css('display', 'block'); } } A jquery expert might do it more elegantly, but it works for me.
  22. In catalog mode (PS - removing these two lines in product.tpl (around line 316) did it for me: {if !$PS_CATALOG_MODE} <====(delete this line) <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}> <label>{l s='Quantity'}</label> <input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" /> <a href="#" data-field-qty="qty" class="btn btn-default button-minus product_quantity_down"> <span><i class="icon-minus"></i></span> </a> <a href="#" data-field-qty="qty" class="btn btn-default button-plus product_quantity_up"> <span><i class="icon-plus"></i></span> </a> <span class="clearfix"></span> </p> {/if} <====(delete this line) Now the error is gone and add to wishlist from product page (and product quickview) works as expected. (I am using a copy of the default-bootstrap theme)
  23. @parsifal: Yes, of course. But this is what the shop owner's data is like at the moment and the data is being used other places as well. An Excel or CSV conversion must be done on every product update – so that category associations match existing categories. I will probably end up with a jquery solution - to avoid changing templates to much. After all - this is a temporary solution until the source data is improved by the shop owner. I am a Mac user, but your tips can be very usefull for others. Thanks. @tuk66: CSS capitalize won't work on all uppercase source I think.
  24. Hi. I try to find the right place to edit the top and side menu (for categories). I was given category- and product data with upper case only. I'd like to apply lower case with php (by modifying some template file or some kind of overrides), and then capitalize first letter using CSS. The theme is a copy of the default theme (PS In modules > blocktopmenu there are some templates. But I'd like to know if this can be done using some overrides to make module updates run smoother later. If not - where are the menu items for the (child) categories rendered? Which template do I edit? I guess I will need to edit the categories_block_left as well. A clever solution would be to make the modification affect most instances of child category names in frontend. Like subcategories in the center column, blocklayered nav, etc... As a last resort I might look into a jquery solution to this. That might make things easier when updating later. As you might have guessed I am pretty new to Prestashop.
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More