Cannot display Products table in dashboard

  • @rahul Hi Raul ,
    I'm afraid that I cannot understand your request about the code.
    However what I'm doing here is simply calling this route:


    and from the debugger panel, we have these views rendered which is the default views templates comes with the package.
    Screenshot from 2019-05-08 17-27-04.png
    Screenshot from 2019-05-08 17-27-20.png

  • Hi,

    I am asking for view file of that route.

    Rahul Shukla

  • @rahul Actually it's the same default view file of the package, I didn't change it if that what you mean!

  • @rahul This is the orders views file

        {{ __('admin::app.sales.orders.title') }}
        <div class="content">
            <div class="page-header">
                <div class="page-title">
                    <h1>{{ __('admin::app.sales.orders.title') }}</h1>
                <div class="page-action">
                    <div class="export-import" @click="showModal('downloadDataGrid')">
                        <i class="export-icon"></i>
                            {{ __('admin::app.export.export') }}
            <div class="page-content">
                @inject('orderGrid', 'Webkul\Admin\DataGrids\OrderDataGrid')
                {!! $orderGrid->render() !!}
        <modal id="downloadDataGrid" :is-open="modalIds.downloadDataGrid">
            <h3 slot="header">{{ __('') }}</h3>
            <div slot="body">
        @include('admin::export.export', ['gridName' => $orderGrid])

  • Banned

    @yaser-az I think you must have missed the code needed to render datagrid on your admin's product page.

    That must be:

     <div class="page-content">
        @inject('products', 'Webkul\Admin\DataGrids\ProductDataGrid')
        {!! $products->render() !!}

  • Hello @bagisto-mogul, thanks for replying ,
    Actually this is the code inside Webkul/Admin/src/Resources/views/catalog/products/index.blade.php

    <div class="page-content">
      @inject('products', 'Webkul\Admin\DataGrids\ProductDataGrid')
      {!! $products->render() !!}

    The same for orders view inside Webkul/Admin/src/Resources/views/sales/orders/index.blade.php

    <div class="page-content">
          @inject('orderGrid', 'Webkul\Admin\DataGrids\OrderDataGrid')
          {!! $orderGrid->render() !!}

    As you see the code of injection and rendering already inside the view files.
    Any suggestion ?

  • @rahul About the active class for menu items, I cannot see where this $menu variable comming from ?
    How can I set my own menu items using this $menu variable ?

  • Banned

    @yaser-az You can over ride the ui.css file being compiled from the UI package in order to change the design of datagrid. By creating your own and not using ours.

    Menu for the admin panel is generated from the AdminServiceProvider, take a look and you will see $menu variable is shared with these blade files 'admin::layouts.nav-left', 'admin::layouts.nav-aside', 'admin::layouts.tabs'.

  • @bagisto-mogul said in Cannot display Products table in dashboard:

    @yaser-az You can over ride the ui.css file being compiled from the UI package in order to change the design of datagrid. By creating your own and not using ours.

    Hi @bagisto-mogul , as you can see in this image that the content of the table is empty which means that the orderGrid is not returning anything from the DB.
    I believe it's not a styling problem at all!
    Screenshot from 2019-05-14 18-19-41.png

  • Banned

    @yaser-az It seems like you have upgraded you application from v0.1.4 to v0.1.5 or to later master.

    I must inform you that all your products data is still intact in products table.
    But recently we are removing dependency of table called products_grid.

    So in the version which you started using first in that your admin products were being displayed using the table called products_grid.

    But in the recent updates the data is being displayed from products_flat table.

    Sorry for the inconvenience but we will provide a migratory sync function that will migrate your old data of products from the product table sets into products_flat table.

    Thanks for making this far with Bagisto.

    Good Luck with it.


  • @bagisto-mogul thanks for replay.
    Actually there is no products yet in the DB, but it should display the table and the pagination UI though!
    In my case it's not displaying anything! Not sure if this is because the new package release!

  • Banned

    @yaser-az If there are no products in your database then you would not be able to see anything in datagrid.
    But an empty table looks like the shot below:

    alt text

    The screenshot you posted neither shows your product index page nor the browser console at that stage.

    And I want to know if you create products then can you see results in your product grid.

  • This post is deleted!

Log in to reply