Skip to content
View in the app

A better way to browse. Learn more.

Clicshopping AI, Free generative artificial intelligence e-commerce Open Source , Open Source Store Onlne

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

It's new ? seems to be some new stats does not included inside the tab. Go to install it !

Yes it look nice.

 

It enough easy to make another one : Take this file IndexDashboardTopStockWarning and rename it : IndexDashboardTopTest
Change inside the class and the request

The file will be like this !

........... must be removed and adapted at your needs.

<?php
  /**
 *
 *  @copyright 2008 - https://www.clicshopping.org
 *  @Brand : ClicShopping(Tm) at Inpi all right Reserved
 *  @Licence GPL 2 & MIT
 *  @licence MIT - Portion of osCommerce 2.4
 *  @Info : https://www.clicshopping.org/forum/trademark/
 *
 */

  namespace ClicShopping\OM\Module\Hooks\ClicShoppingAdmin\Dashboard;

  use ClicShopping\OM\CLICSHOPPING;
  use ClicShopping\OM\Registry;
  use ClicShopping\OM\HTML;

  class IndexDashboardTopTest {
    protected $db;

    public function __construct() {

      if (CLICSHOPPING::getSite() != 'ClicShoppingAdmin') {
        CLICSHOPPING::redirect();
      }

      $this->db = Registry::get('Db');
    }

    public function execute() {
      $Qproducts = $this->db->prepare('select count(*) as count from :table_products
                                      where ..........
                                     ');

      $Qproducts->execute();

      $number_products_test = $Qproducts->valueInt('count');

      if ($number_products_test > 0) {
        $text = CLICSHOPPING::getDef('text_number_products_........');
        $text_view = CLICSHOPPING::getDef('text_view');

        $output = '
<div style="padding-right:0.5rem; padding-top:0.5rem">
    <div class="card bg-warning">
      <div class="card-body">
        <div class="row">
          <h5 class="card-title text-white"><i class="fas fa-bell-slash"  aria-hidden="true"></i> ' . $text . '</h5>
        </div>
        <div class="col-md-12">
          <span h5 class="text-white">' . $number_products_test . '</span>
          <span><small class="text-white">' . HTML::link(CLICSHOPPING::link(null, 'A&...........'), $text_view, 'class="text-white"') . '</small></span>
        </div>
      </div>
    </div>
</div>
';

 

looking the file, there is 6 hooks allow that

out of stock

stock warning

newsletter

product expected

Review

MemberB2B

Looking the code, the hook appears only if the condition is correct and as Drack code above, it's easy to make another one.

 

 

 

  • Author

@Drack,

Thank you for your example. I test but about the language, I have this test_products_notification. How to change that to have the english and french language.

Thank you.

@Oka,
You can add a new defintion with your administration, tools / Language / look the index admin and add your definition.

@Drack,

Thank you for our example. The hook is new, I don't see the last time. Nice idea.

  • Author

@Julie,

Thank you for your help. I will look at this option.

I think, it's better to have not more than your screen width. For example, il you have 10, you will have some statistics on 2 row. 
It think it's better to focus on what is important for you.
Inside the dashboard, you also have lot of statistics, it's not important to make the same inside the top dashboard.
 

I agree with @Drack, focus on the value is the most important. @McJordadino remember you, you have some statistics in other page inside the administration.

No you can't but if you customize a little you can add an element inside your DB and insert the hooks a condition with a return on false.

 

There an example :

You can see a status there :

http://localhost/shop/ClicShoppingAdmin/index.php?A&Configuration\Modules&Configure

 

look the Module directory :Apps/Configuration/Modules/Module/ClicShoppingAdmin/Config/MO/Params

 

2/ Inside you can see a status files, copy and paste inside the same directory.

Change the filename status_stats_products.php for example

You can have something like this :

<?php
  /**
 *
 *  @copyright 2008 - https://www.clicshopping.org
 *  @Brand : ClicShopping(Tm) at Inpi all right Reserved
 *  @Licence GPL 2 & MIT
 *  @licence MIT - Portion of osCommerce 2.4
 *  @Info : https://www.clicshopping.org/forum/trademark/
 *
 */


  namespace ClicShopping\Apps\Configuration\Modules\Module\ClicShoppingAdmin\Config\MO\Params;

  use ClicShopping\OM\HTML;

  class status_stats_products extends \ClicShopping\Apps\Configuration\Modules\Module\ClicShoppingAdmin\Config\ConfigParamAbstract {
    public $default = 'True';
    public $sort_order = 10;

    protected function init() {
        $this->title = $this->app->getDef('cfg_products_modules_status_stats_products_title');
        $this->description = $this->app->getDef('cfg_products_modules_status_stats_products_description');
    }

    public function getInputField()  {
      $value = $this->getInputValue();

      $input =  HTML::radioField($this->key, 'True', $value, 'id="' . $this->key . '1" autocomplete="off"') . $this->app->getDef('cfg_products_modules_status_true') . ' ';
      $input .=  HTML::radioField($this->key, 'False', $value, 'id="' . $this->key . '2" autocomplete="off"') . $this->app->getDef('cfg_products_modules_status_false');

      return $input;
    }
  }

 

2/ Now don't forget to reate the files inside  your language  directory

 

3/ Now actualize your page, a new configuration is added inside the configuration database : CLICSHOPPING_APP_MODULES_MO_STATUS_STATS_PRODUCTS

 

4/ now go in this directory :  Includes/Module/Hooks/ClicShoppingAdmin/Dashboard

Edit your hooks stats_products .php for example and add after :  function  execute()

this :

 

if (!defined('CLICSHOPPING_APP_MODULES_MO_STATUS_STATS_PRODUCTS') || CLICSHOPPING_APP_MODULES_MO_STATUS_STATS_PRODUCTS == 'False') { 
  return false; 
}

 

Now you can control your hook and display the information or not.

 

 

 

 

Thank you for this example. I think there is  another post about the hook status. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.