Search the Community
Showing results for tags 'Grid'.
-
Hello, i have a little problem with adding a custom column to customers grid. I used hookActionCustomerGridQueryBuilderModifier and hookActionCustomerGridDefinitionModifier... everything works great but only in debug mode. Is there something I should also do? Cache is disabled, but i think it has something to do with cache or pagination, because now when i tested it: when i clicked on second page the grid won't load, I've made $countQueryBuilder = $params['count_query_builder'] which "settings" are the same as $searchQueryBuilder = $params['search_query_builder'];
-
Changes to the appearance of the Customer table. The module allows you to Add/Hide some columns from the list: Social title Group Newsletter Partner offers ==== VAT_number (siret, NIP) Customer Language ==== Compatible with PrestaShop 1.7.6.7 - 8.0.4 You can use the CSS file to style the columns (/views/css/..) Language versions: EN (PL and soon more languages...) mkd_admin_customer_grid.zip
-
Hello , I have a custom module with an adminController , i have tried documentation tutorial to create a data grid system for my entity. The Grid shows well but search action is not working. ps_custom_catgeoires_articles.yml services: #ObjectModel service prestashop.module.ps_custom.entity.ps_custom_categories_articles: class: \PrestaShop\Module\PsCustom\Entity\PsCustomCategoriesQuestionsAnswer #Grid Factory prestashop.module.ps_custom.grid.factory.table.ps_custom_categories_articles: class: PrestaShop\PrestaShop\Core\Grid\GridFactory arguments: - "@prestashop.module.ps_custom.grid.definition.table.ps_custom_categories_articles" - "@prestashop.module.ps_custom.grid.data.factory.table.ps_custom_categories_articles" - "@prestashop.core.grid.filter.form_factory" - "@prestashop.core.hook.dispatcher" #Grid definition prestashop.module.ps_custom.grid.definition.table.ps_custom_categories_articles: class: PrestaShop\Module\CpmCore\Grid\BaseGridDefinition parent: "prestashop.core.grid.definition.factory.abstract_grid_definition" public: true arguments: $gridId: "ps_custom_categories_articles" $gridName: "ps_custom_categories_articles" $gridFields: "@=service('prestashop.module.ps_custom.entity.ps_custom_categories_articles').getFields()" $searchAndResultRedirectRoute: "admin.ps_custom.table.ps_custom_categories_articles.index" #Grid Factory Decorator prestashop.module.ps_custom.grid.data.factory.table.ps_custom_categories_articles: class: PrestaShop\Module\CpmCore\Grid\BaseGridDataFactory arguments: - "@prestashop.module.ps_custom.grid.data_provider.table.ps_custom_categories_articles" #Grid Data Provider prestashop.module.ps_custom.grid.data_provider.table.ps_custom_categories_articles: class: "%prestashop.core.grid.data.factory.doctrine_grid_data_factory%" arguments: - "@prestashop.module.ps_custom.grid.query.table.ps_custom_categories_articles" - "@prestashop.core.hook.dispatcher" - "@prestashop.core.grid.query.doctrine_query_parser" - "ps_custom_categories_articles" # Grid data query builder prestashop.module.ps_custom.grid.query.table.ps_custom_categories_articles: class: PrestaShop\Module\CpmCore\Grid\BaseGridQueryBuilder arguments: $connection: "@doctrine.dbal.default_connection" $dbPrefix: "%database_prefix%" $tableName: "ps_custom_categories_articles" $counterColumn: "id_ps_custom_categories_articles" #Grid filters prestashop.module.ps_custom.grid.filter.table.ps_custom_categories_articles: class: PrestaShop\Module\CpmCore\Grid\BaseGridFilter arguments: $filterId: "ps_custom_categories_articles" $defaultOrderBy: "id_ps_custom_categories_articles" $defaultSortOrder: "desc" Admin Controller : <?php namespace PrestaShop\Module\PsCustom\Controller\Admin\Table; use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; use PrestaShopBundle\Security\Annotation\AdminSecurity; use PrestaShopBundle\Security\Annotation\ModuleActivated; use PrestaShopBundle\Service\Grid\ResponseBuilder; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; /** * Class PsCustomModuleCategoriesArticlesController. * * @ModuleActivated(moduleName="PsCustomModule", redirectRoute="admin_module_manage") */ class PsCustomModuleCategoriesArticlesController extends FrameworkBundleAdminController { /** * @see https://devdocs.prestashop.com/1.7/development/architecture/migration-guide/controller-routing/#security * @AdminSecurity( * "is_granted(['read'], request.get('_legacy_controller'))", * message="You do not have permission to access PsCustomModule tables page." * ) */ public function indexAction(Request $request): Response { $filter = $this->get( 'prestashop.module.ps_custom.grid.filter.table.ps_custom_categories_articles' )->buildFiltersParamsByRequest($request); $grid = $this->get( 'prestashop.module.ps_custom.grid.factory.table.ps_custom_categories_articles' )->getGrid($filter); return $this->render('@PrestaShop/Admin/Common/Grid/grid-layout.html.twig', [ 'layoutTitle' => 'PsCustomModuleCategoriesArticles', 'help_link' => false, 'grid' => $this->presentGrid($grid), ]); } /** * @param Request $request * @return RedirectResponse */ public function searchAction(Request $request): RedirectResponse { /** @var ResponseBuilder $responseBuilder */ $responseBuilder = $this->get('prestashop.bundle.grid.response_builder'); return $responseBuilder->buildSearchResponse( $this->get('prestashop.module.ps_custom.grid.definition.table.ps_custom_categories_articles'), $request, 'ps_custom_ps_custom_categories_articles', 'admin.ps_custom.table.ps_custom_categories_articles.index' ); } } Any idea how to fix search ?
-
hello, I am trying to modify the starter theme using only css because it is the only language I know how to use a little. I am trying to set the height equal to the width, which is a persentage. but it is not working, any idea? online I found this code and tried to use it: width: calc(100% - 20px) height: calc((100vw - 20px) * 0.5625) /*16:9 aspect ratio*/ div .product-information{ width: calc(37.5% - 1px); height: calc(37.5vw * (1 / 1)); background-color: thistle; margin: 0 !important; padding: 0 !important; text-align: left; position: absolute; top: 90px; left: calc(-1px + 62.5%); font-size: 3pt; border: solid 1px rgba(0, 0, 255, 1); }
-
Hello Guys , I want to build a module that add a new custom Bulk action to the products grid im using this hook $this->registerHook('actionProductGridDefinitionModifier') and in the function public function hookActionProductGridDefinitionModifier(array $params): void { $params['definition']->getBulkActions()->add( (new SubmitBulkAction('my_custom_bulk_name')) ->setName($this->l('My Button Name')) ->setOptions([ 'submit_route' => 'my_symfony_route_submition' ]) ); } But the problem is that nothing happen when i visit the products list page in the back-office. It look like im using a wrong hook name or something else. Any Help ?
-
im overriding the Admin\Product\CatalogPage\Lists\product_table.html.twig and i added new columns in the table but i wanted to ristrect this columns for certain profiles (admin & super Admin) the problem is that i don't have access to the connected employee data, Any Ideas ?
- 2 replies
-
- twig
- overriding
-
(and 3 more)
Tagged with:
-
Does anyone know how to change the default view to list in product list in prestashop 1.7 ? I want to remove completely the view buttons and set the view as list permanently without the customer being able to change it. I managed to do it in the rudimentary way but I know there is another better way to do it. This is how I did it: I added in theme.css: .grid_list { display: none; } I added in custom.js: $(document).ready( function () { $('#list').trigger("click"); }); My own way is to click on the list view after the page is loaded but I get some kind of strange grid to list change after the page is loaded and I do not want that. Can someone tell me another way to do it ? I would really appreciate. I found how to do it for prestashop 1.6 but there is no global.js file in prestashop 1.7. Thank you
- 2 replies
-
- prestashop 1.7 default view
- list
-
(and 2 more)
Tagged with:
-
I am working on a module and I created a grid for it but the row actions are not working properly. After some searching I found that the onclick javascript methods are not imported. I found a topic in this forum which helped me. The new problem was that npm could not resolve method names, but it was solved when I found a github thread about it. Now when I load the given page my browser console displays the following error message: Uncaught ReferenceError: file_not_found is not defined. The row actions still does not work. My code in the template is: {% block javascripts %} {{ parent()}} <script src="{{ asset('../../js/customGrid.bundle.js') }}"></script> {% endblock %} And my javascript looks like this: var $ = window.$; var Grid = window.components.Grid; var ReloadListActionExtension = window.extensions.ReloadListActionExtension; var ExportToSqlManagerExtension = window.extensions.ExportToSqlManagerExtension; var FiltersResetExtension = window.extensions.FiltersResetExtension; var SortingExtension = window.extensions.SortingExtension; var LinkRowActionExtension = window.extensions.LinkRowActionExtension; var SubmitGridExtension = window.extensions.SubmitGridExtension; var SubmitBulkExtension = window.extensions.SubmitBulkExtension; var BulkActionCheckboxExtension = window.extensions.BulkActionCheckboxExtension; var SubmitRowActionExtension = window.extensions.SubmitRowActionExtension; $(function() { var customGrid = new Grid('employeeToCountry'); customGrid.addExtension(new ReloadListActionExtension()); customGrid.addExtension(new ExportToSqlManagerExtension()); customGrid.addExtension(new FiltersResetExtension()); customGrid.addExtension(new SortingExtension()); customGrid.addExtension(new LinkRowActionExtension()); customGrid.addExtension(new SubmitGridExtension()); customGrid.addExtension(new SubmitBulkExtension()); customGrid.addExtension(new BulkActionCheckboxExtension()); customGrid.addExtension(new SubmitRowActionExtension()); }); Can anybody tell me what is the source of this problem?
-
Hi, Any one knows any module that put my option colors in a grid wiuth a buttons + or - and add to cart? Something like that image. Or that https://www.graffitishop.net/Grog-Full-Metal-Paint-200-Refills-Markers-id10108 Its important to be responsive table.
-
Hallo, ich habe ein Problem, ich bin gearade dabei ein Shop zu gestalten, soweit komm ich ganz gut zurecht, nur möchte ich nun das wenn man auf z.B. Matratzen klickt, die Listenansicht als Standard definiert ist und auch die Auswahl zum grid entfällt. Den button könnte ich ja per css ganz easy einfach ausblenden, aber ich schaff es einfach nicht das Standard grid zu ändern zur Liste. Tutorials wie z.B. dieses: PrestaShop 1.6.x. How to change default products listing view habe ich schon versucht, ohne Erfolg leider da anscheind der Aufbau der dort genannten Datein sich in version 1.6.1.6 verändert hat. Könnt Ihr mir ein Tip geben? PS der Link zum laden: http://matratzen-point.de
-
Dzień dobry, Tworzę moduł w PrestaShop 1.7.6.8 do przetwarzania zgłoszeń serwisowych który posiada swoją tabelę w bazie danych. Możliwość dodawania zgłoszeń z Front Office przez klienta, rozszerzenie kontrolera ModuleFrontController. Zarządzanie po stronie Back Office przez rozszerzenie kontrolera FrameworkBundleAdminController. Akcja index (lista wszystkich zgłoszeń serwisowych) w panelu admina jest oparta o Grid. Wzorowałem się na podmodule Customers z modułu Sell. Widok wygląda następująco index.html.twig {% set layoutHeaderToolbarBtn = { 'add': { 'href': path('admin_service_requests_create'), 'desc': 'Dodaj nowe zgloszenie', 'icon': 'add_circle_outline' } } %} {% extends 'PrestaShopBundle:Admin:layout.html.twig' %} {% block content %} {% block service_requests_listing %} <div class="row"> <div class="col-12"> {% include '@PrestaShop/Admin/Common/Grid/grid_panel.html.twig' with {'grid': serviceRequestGrid} %} </div> </div> {% endblock %} {% endblock %} {% block javascripts %} {{ parent() }} <script src="{{ asset('../modules/gs_service/views/js/admin/service_request/index.js') }}"></script> <script src="{{ asset('themes/default/js/bundle/pagination.js') }}"></script> {% endblock %} Skrypt index.js (zamiast adminXXX jest poprawna nazwa katalogu) import Grid from '../../../../../../adminXXX/themes/new-theme/js/components/grid/grid'; import SortingExtension from "../../../../../../adminXXX/themes/new-theme/js/components/grid/extension/sorting-extension"; const $ = window.$; $(() => { const serviceRequestGrid = new Grid('service_request'); serviceRequestGrid.addExtension(new SortingExtension()); }); W przeglądarce dostaję taki błąd: index.js?1.7.6.8:1 Uncaught SyntaxError: Cannot use import statement outside a module Próbowałem importować również w ten sposób ale efekt jest taki sam. import Grid from '@components/grid/grid'; import SortingExtension from "@components/grid/extension/sorting-extension"; Bez tych rozszerzeń nie działa w pełni poprawnie filtrowanie (przycisk wyczyść) oraz sortowanie. Nic się nie dzieje po naciśnięciu przycisku lub strzałki sortowania. Jak poprawnie zaimportować Grid i SortExtension w pliku js we własnym module? Czy jest to możliwe bez Webpack? Jeśli nie to jak do skonfigurować? W dokumentacji znalazłem tylko to: https://devdocs.prestashop.com/1.7/development/components/grid/tutorials/extend-grid-with-javascript/ Z góry dziękuje za pomoc w rozwiązaniu mojego problemu.
-
Buenas tardes, Alguien tiene algun ejemplo de como crear un grid tabla en un modulo. No encuentro ejemplos especificos. La idea sería añadir en el modulo un grid de los logs almacenados en la base de datos. Gracias
-
i am developing module for CRUD operations . created form using fields_form . all the functionality are working correctly and the validation also working correclty But the validation error message was not displayed . i am created a admin controller in my module . AdminController public function __construct() { parent::__construct(); $this->bootstrap = true; $this->table = 'econt_shipping_cost'; $this->identifier = 'id'; $this->className = 'EcontShipping'; $this->allow_export = true; $this->_defaultOrderBy = 'a.id'; $this->fields_list = [ 'id' => ['title' => 'ID','class' => 'fixed-width-xs'], 'weight_from' => ['title' => 'Weight From'], 'weight_to' => ['title' => 'Weight To'], 'econt_office' => ['title' => 'To Office Cost'], 'econt_door' => ['title' => 'To Door Cost'], ]; $this->addRowAction('edit'); $this->addRowAction('delete'); $this->fields_form = [ 'legend' => [ 'title' => 'Shipping Cost', 'icon' => 'icon-list-ul' ], 'input' => [ ['name'=>'weight_from','type'=>'text','label'=>'Weight From','required'=>true,], ['name'=>'weight_to','type'=>'text','label'=>'Weight To','required'=>true], ['name'=>'econt_office','type'=>'text','label'=>'To Office Cost','required'=>true], ['name'=>'econt_door','type'=>'text','label'=>'To Door Cost','required'=>true], ], 'submit' => [ 'title' => $this->trans('Save', [], 'Admin.Actions'), ] ]; } myclass class EcontShipping extends ObjectModel { public $id; public $weight_from; public $weight_to; public $econt_office; public $econt_door; public static $definition = [ 'table' => 'econt_shipping_cost', 'primary' => 'id', 'displayError' => 'true', 'fields' => [ 'weight_from' => ['type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required'=>true], 'weight_to' => ['type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required'=>true], 'econt_office' => ['type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required'=>true], 'econt_door' => ['type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required'=>true], ], ]; }
-
Bonjour à tous, Voilà, je vous expose mon problème : j'ai crée un module sur un Prestashop 1.7.6.1 en suivant ce tuto : https://www.h-hennes.fr/blog/2018/11/15/prestashop-admincontroller-pour-un-module L'idée est d'afficher dans mon back-office un lien dans le menu gauche qui mène vers un grid et qui affiche les données d'une table que j'ai créée. Jusque là tout va bien, mais j'aimerais dans ce grid "fusionner" deux colonnes : j'ai une colonne "nom" et "prénom" (qui sont bien 2 champs distincts dans la base de données), mais je voudrais n'avoir qu'une seule colonne "Nom et prénom". Je ne sais pas où et comment je dois faire malheureusement. Si quelqu'un pouvait m'éclairer je lui en serait reconnaissant, merci ! SI besoin de plus d'infos (screenshots, code), dites-le moi.
-
- renderlist
- grid
-
(and 4 more)
Tagged with:
-
Bonjour à tous, Voilà, je vous expose mon problème : j'ai crée un module sur un Prestashop 1.7.6.1 en suivant ce tuto : https://www.h-hennes.fr/blog/2018/11/15/prestashop-admincontroller-pour-un-module L'idée est d'afficher dans mon back-office un lien dans le menu gauche qui mène vers un grid et qui affiche les données d'une table que j'ai créée. Jusque là tout va bien, mais j'aimerais dans ce grid "fusionner" deux colonnes : j'ai une colonne "nom" et "prénom" (qui sont bien 2 champs distincts dans la base de données), mais je voudrais n'avoir qu'une seule colonne "Nom et prénom". Je ne sais pas où et comment je dois faire malheureusement. Si quelqu'un pouvait m'éclairer je lui en serait reconnaissant, merci ! SI besoin de plus d'infos (screenshots, code), dites-le moi.
-
- renderlist
- grid
-
(and 2 more)
Tagged with:
-
Hello , Any one knows any module that can organize my attribute colors like that photo? I want a full cell color with the name attribute, and option + or - to the cart.
-
In prestashop 1.7.5 I have an admin controler which extends FrameworkBundleAdminController. Now I want to download data from my table in this controller and display it in the grid (table) in a similar way as customer data or their addresses are displayed. How do you do it in a twig based template? Unless you can do it differently using a helper.
-
Buongiorno, avrei bisogno di aiuto. Dopo aver eseguito una modifica sulla home page passando da un full width ad una doppia colonna left, la griglia dei prodotti non si è adattata, ovvero nella versione desktop i prodotti appaiono in una doppia colonna lasciando un bello spazio laterale rispetto atermine pagina, anzichè tre colonne come auspicabile e credo normale. Dove sbaglio? Ho cercato una soluzione , ma forse per imperizia non sono stato in grado. Grazie in anticipo. Roberto
-
Bonjour, Je cherche à afficher une list ou une grille des produit selon l'id de la categorie ou mieux selon la catégorie parente mais je n'arrive pas à faire cela. J'ai essayé dans product-list.tpl de faire ceci : {if $category->id == 5} <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}"> {else} <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list list row{if isset($class) && $class} {$class}{/if}"> mais ca ne fonctionne pas. Avez-vous des idées? ou avez-vous déjà été confronté à ce problème ? Merci
-
- grille
- product-list
-
(and 4 more)
Tagged with:
-
grid / list / mini-list products view switcher If you want to create grid/list/mini-list products view switcher this guide is what you're looking for read how easily you can create own switcher, no core modifications, only theme .tpl, .css and small .js read guide here: grid / list / mini-list products view switcher PrestaShop 1.7.x tutorial is available here: https://www.prestashop.com/forums/topic/604990-tutorial-grid-list-switcher-change-products-display-method-in-prestashop-17/
-
Bonjour à tous, Je recherche à trouver une variable smarty pouvant ne pas afficher un bout de code pour l'affichage des produits en liste. Par exemple "si laffichage est en liste alors afficher le code sinon ne rien afficher" Condition d'affichage dans product-list.tpl Merci d'avance
-
Hi, I'm in the process of understanding how to use Prestashop 1.7. I've spent some time playing with default theme "Classic" 1.0.0. I did not understand how the grid system exactly works. My intention is to have two columns layout on the home page. Where I put a list of categories (category tree links module) in the left (small) column and products (like favorite products) go to the right column (which takes the rest of the space). I tried to play with layouts and positioning (design/positions) but I only succeeded in putting the category tree links module into the left column (displayLeftColumn hook). I tried right column in layouts to put favorite products there but doesn't work. Or the default prestashop 1.7 theme doesn't have rightColumn hook ? so that's why I can't insert module there ? thank you
-
Hello all, I am having problems with updated my template files to change my default product list view from "List" to "Grid" view. I have updated the global.js and product-list.tpl files under my themexxx directories, cleared the cache for PS and all browsers, changed the performance settings to not allow caching and still the changes will not update. Are there other files that need to be changed to make the list to grid view go live? Thank you in advance. J Dub
-
hello i have a problem with module attribute grid since I have changed the server - in the site not work - this is the error in the BO Warning: Cannot modify header information - headers already sent by (output started at /home/etkslo/public_html/modules/attributegrid/attributegrid.php:2) in /home/etkslo/public_html/classes/Tools.php on line 141 i use ps 1.5.6.1 version attribute grid 1.5.2
-
Hello I have seen the tutorial about changing the product list from default grid view to default list view, but the code shown in the examples are not the same as in the latest prestashop version 1.6.0.14. Here are the code blocks concerning the function "function bindGrid()" Code found in themes/default-bootstrap/js/global.js : function bindGrid() { var view = $.totalStorage('display'); if (!view && (typeof displayList != 'undefined') && displayList) view = 'list'; if (view && view != 'grid') display(view); else $('.display').find('li#grid').addClass('selected'); $(document).on('click', '#grid', function(e){ e.preventDefault(); display('grid'); }); $(document).on('click', '#list', function(e){ e.preventDefault(); display('list'); }); } And here is the code found in /themes/default-bootstrap/product-list.tpl : <!-- Products list --> <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}"> I do use another theme, so I looked in the same files of the non default theme and found the same code as in the default bootstrap theme, so I guess the changements should be the same in both themes. I tried to change it substituting "grid" with "list" more less as shown in the tutorial that Vekia wrote about Presta 1.6.0.11 (I guess it could be related to that version or earlier, anyway is not about the latest version) Unfortunately I got no good results + some bugs, e.g. changing the modality by hand in front office nothing happens or causes to have tiles in the grid showing not truncated text, so one tile is longer one is shorter etcetera Refreshing the page also causes to show a grid with not truncated text In general grid stays to be default visualization and to obtain the list one have to click at least twice the list button.... Changing category cause the same problems. So I reverted all to the original files, but I really want to get it the other way, list view as default and grid view as an user option.... Anyone knows how to set default list view for the product list also in prestashop 1.6.0.14? Thank you in advance.
- 10 replies