Jump to content

Tri produts par défaut par quantité en stock (front)


Recommended Posts

Bonjour,

 

J'utilise Prestashop: 1.5.3.1 et voudrais avoir le tri par défaut dans les catégories (front) par quantité en stock.

 

Les seules possibilités qui se présentent actuellement dans l'admin (Préférences=>produits) sont les suivantes:  

 

- nom du produit

- prix du produit

- date d'ajout

- position dans la catégorie

- marque

- date de modification

 

Est-ce que quelqu'un sais comment ajouter le tri par par défaut par quantité en stock dans les options?

 

Merci beaucoup pour votre aide!

 

Bonne journée,

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Salut,
 
via ftp tu vas dans ton prestashop   =>  override/controllers/admin/AdminPPreferencesController.php
 
Vers la ligne 108, tu changes :

'PS_PRODUCTS_ORDER_BY' => array(
						'title' => $this->l('Default order by'),
						'desc' => $this->l('The order in which products are displayed in the product list.'),
						'type' => 'select',
						'list' => array(
							array('id' => '0', 'name' => $this->l('Product name')),
							array('id' => '1', 'name' => $this->l('Product price')),
							array('id' => '2', 'name' => $this->l('Product add date')),
							array('id' => '3', 'name' => $this->l('Product modified date')),
							array('id' => '4', 'name' => $this->l('Position inside category')),
							array('id' => '5', 'name' => $this->l('Manufacturer')),
							array('id' => '6', 'name' => $this->l('Product quantity')),
							array('id' => '7', 'name' => $this->l('Product reference'))
							 	
						),
						'identifier' => 'id'
					),

par

'PS_PRODUCTS_ORDER_BY' => array(
						'title' => $this->l('Default order by'),
						'desc' => $this->l('The order in which products are displayed in the product list.'),
						'type' => 'select',
						'list' => array(
							array('id' => '0', 'name' => $this->l('Product name')),
							array('id' => '1', 'name' => $this->l('Product price')),
							array('id' => '2', 'name' => $this->l('Product add date')),
							array('id' => '3', 'name' => $this->l('Product modified date')),
							array('id' => '4', 'name' => $this->l('Position inside category')),
							array('id' => '5', 'name' => $this->l('Manufacturer')),
							array('id' => '6', 'name' => $this->l('Product quantity')),
							array('id' => '7', 'name' => $this->l('Product reference')),
							array('id' => '8', 'name' => $this->l('Product quantity')) 	
						),
						'identifier' => 'id'
					),

et ça devrait fonctionner.

Link to comment
Share on other sites

Salut,

 

via ftp tu vas dans ton prestashop   =>  override/controllers/admin/AdminPPreferencesController.php

 

Vers la ligne 108, tu changes :

'PS_PRODUCTS_ORDER_BY' => array(
						'title' => $this->l('Default order by'),
						'desc' => $this->l('The order in which products are displayed in the product list.'),
						'type' => 'select',
						'list' => array(
							array('id' => '0', 'name' => $this->l('Product name')),
							array('id' => '1', 'name' => $this->l('Product price')),
							array('id' => '2', 'name' => $this->l('Product add date')),
							array('id' => '3', 'name' => $this->l('Product modified date')),
							array('id' => '4', 'name' => $this->l('Position inside category')),
							array('id' => '5', 'name' => $this->l('Manufacturer')),
							array('id' => '6', 'name' => $this->l('Product quantity')),
							array('id' => '7', 'name' => $this->l('Product reference'))
							 	
						),
						'identifier' => 'id'
					),

par

'PS_PRODUCTS_ORDER_BY' => array(
						'title' => $this->l('Default order by'),
						'desc' => $this->l('The order in which products are displayed in the product list.'),
						'type' => 'select',
						'list' => array(
							array('id' => '0', 'name' => $this->l('Product name')),
							array('id' => '1', 'name' => $this->l('Product price')),
							array('id' => '2', 'name' => $this->l('Product add date')),
							array('id' => '3', 'name' => $this->l('Product modified date')),
							array('id' => '4', 'name' => $this->l('Position inside category')),
							array('id' => '5', 'name' => $this->l('Manufacturer')),
							array('id' => '6', 'name' => $this->l('Product quantity')),
							array('id' => '7', 'name' => $this->l('Product reference')),
							array('id' => '8', 'name' => $this->l('Product quantity')) 	
						),
						'identifier' => 'id'
					),

et ça devrait fonctionner.

 

Bonjour,

 

Merci pour ce conseil.

Par contre, chez moi, dans la version Prestashop: 1.5.3.1 dans le fichier override/controllers/admin/AdminPPreferencesController.php  il n'y a que ces lignes:

<?php

class AdminPPreferencesController extends AdminPPreferencesControllerCore
{

}
Link to comment
Share on other sites

 

Bonjour,

 

Merci pour ce conseil.

Par contre, chez moi, dans la version Prestashop: 1.5.3.1 dans le fichier override/controllers/admin/AdminPPreferencesController.php  il n'y a que ces lignes:

<?php

class AdminPPreferencesController extends AdminPPreferencesControllerCore
{

 

Bon c'est pas trop académique mais modifie le controllers/admin/AdminPPreferencesController.php : ça t'évitera de t'embrouiller :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...