24.01.2022 15:37
|
|
easy2website
Name: Johann Sammer
25.10.2011
Posts: 27
|
Artikelsortierung
Hallo liebes Team,
Gibt es eine Möglichkeit, die einzelnen Kategorien im Shop unterschiedlich zu sortieren? Ich habe das Problem, dass bei einem Kunden jede Kategorie unterschiedlich sortiert werden muss. Geht das mit einem AddOn, einem Modul etc.?
Herzlichen Dank schon mal im Vorraus!
Joomla: 3 / letzte JoomShopping: 3.x / letzte
|
|
24.01.2022 22:30
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Posts: 25941
|
Aw: Artikelsortierung
There is no such possibility.
Now only change code
components\com_jshopping\tables\category.php
function getDefaultProductSorting(){
return JSFactory::getConfig()->product_sorting;
}
Change to
function getDefaultProductSorting(){
if ($this->category_id == 1) {
return 1;
}
if ($this->category_id == 2) {
return 3;
}
if ($this->category_id == 3) {
return 2;
}
//..........
return JSFactory::getConfig()->product_sorting;
}
------------------------------------------
if ($this->category_id == XXX) {
return SORTID;
}
SORTID - (1 Name
2 - Price
3 - Date
6 - Popular
4 - Predefined
)
Letzte Änderung: 24.01.2022 22:39
|
|
24.01.2022 23:52
|
|
spike77
Name: Manfred
30.04.2015
Posts: 706
|
Aw: Artikelsortierung
Problem.
Categorie "BMW"
Need "Richtung von der Produktsortierung" A-Z --> SortID: Predefined (0,1,2,3,4, .... 100)
Categorie "Cars"
Need "Richtung von der Produktsortierung" Z-A --> SortID: Date (Newest --> to Old)
With your Code
if ($this->category_id == 127) {
return 3;
}
Joomshopping sorts from old to newest, but need newest to old in Categorie "Cars" AND 0-100 (Predefined in Backend) in Categorie "BMW" (not 100 to 0)
Possible??
Letzte Änderung: 25.01.2022 00:25
|
|
25.01.2022 08:03
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Posts: 25941
|
Aw: Artikelsortierung
function getDefaultProductSorting(){
if ($this->category_id == xxx) {
return 4;
}
return JSFactory::getConfig()->product_sorting;
}
function getDefaultProductSortingDirection(){
if ($this->category_id == xxx) {
return 0; // 0 -A-Z, 1 - Z-A
}
return JSFactory::getConfig()->product_sorting_direction;
}
|
|
25.01.2022 09:00
|
|
spike77
Name: Manfred
30.04.2015
Posts: 706
|
Aw: Artikelsortierung
That works perfect! Thanks.
Letzte Änderung: 25.01.2022 11:10
|
|
09.07.2022 10:16
|
|
spike77
Name: Manfred
30.04.2015
Posts: 706
|
Aw: Artikelsortierung
Is there a solution for JS 5.x ??
Problem.
Categorie "BMW"
Need "Richtung von der Produktsortierung" A-Z --> SortID: Predefined (0,1,2,3,4, .... 100)
Categorie "Cars"
Need "Richtung von der Produktsortierung" Z-A --> SortID: Date (Newest --> to Old)
With your Code
if ($this->category_id == 127) {
return 3;
}
Joomshopping sorts from old to newest, but need newest to old in Categorie "Cars" AND 0-100 (Predefined in Backend) in Categorie "BMW" (not 100 to 0)
Possible??
|
|
09.07.2022 21:36
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Posts: 25941
|
Aw: Artikelsortierung
Need change
components\com_jshopping\Model\Productlist\CategoryModel.php
function getProductFieldSorting($order){
if ($this->table->category_id == 127) {
return 3;
}
return \JSFactory::getConfig()->sorting_products_field_select[$order];
}
add:
function getDefaultProductSortingDirection(){
if ($this->table->category_id == xxx) {
return 0; // 0 -A-Z, 1 - Z-A
}
return \JSFactory::getConfig()->product_sorting_direction;
}
Letzte Änderung: 09.07.2022 21:39
|
|
10.07.2022 01:32
|
|
spike77
Name: Manfred
30.04.2015
Posts: 706
|
Aw: Artikelsortierung
something is wrong, don´t work
Add:
function getProductFieldSorting($order){
if ($this->table->category_id == 1040) {
return 3;
}
return \JSFactory::getConfig()->sorting_products_field_select[$order];
}
function getDefaultProductSortingDirection(){
if ($this->table->category_id == 1040) {
return 3 - Z-A; // 0 -A-Z, 1 - Z-A
}
return \JSFactory::getConfig()->product_sorting_direction;
}
Following Error:
Undefined constant "Joomla\Component\Jshopping\Site\Model\Productlist\Z"
Think return 3 - Z-A don´t work in JS5, what must i do for sort New to Old?
Letzte Änderung: 10.07.2022 03:17
|
|
11.07.2022 08:06
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Posts: 25941
|
Aw: Artikelsortierung
function getDefaultProductSortingDirection(){
if ($this->table->category_id == 1040) {
return 1;
}
return \JSFactory::getConfig()->product_sorting_direction;
}
|
|
11.07.2022 08:17
|
|
spike77
Name: Manfred
30.04.2015
Posts: 706
|
Aw: Artikelsortierung
1 ?
I don´t understand. 1 = Name. is´nt it? in each case he does not sort correctly with number 1
I don´t need name for selected categorys. I need sorting from newest to old (in JS 4.x it was code 3 - Z-A)
Mean: in Backend / Settings: Sort Products: predefined (Standard)
selected categorys (in CategoryModel.php) Sorting from Newest to old (example Category 1040, 1041,1042,1043)
Letzte Änderung: 11.07.2022 08:29
|
|
11.07.2022 09:42
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Posts: 25941
|
Aw: Artikelsortierung
getDefaultProductSortingDirection()
return 1 or 0
getProductFieldSorting
return 1,2,3,4,5 ....
Letzte Änderung: 11.07.2022 09:43
|
|
11.07.2022 11:15
|
|
spike77
Name: Manfred
30.04.2015
Posts: 706
|
Aw: Artikelsortierung
I just do not know what you mean!? What are the Sorting id´s? In JS3.x was:
SORTID - (1 Name
2 - Price
3 - Date
6 - Popular
4 - Predefined
)
No matter what number I enter, the sorting in the frontend from new to old is just not correct
function getProductFieldSorting($order){
if ($this->table->category_id == 1040) {
return 5;
}
return \JSFactory::getConfig()->sorting_products_field_select[$order];
}
function getDefaultProductSortingDirection(){
if ($this->table->category_id == 1040) {
return 1;
}
return \JSFactory::getConfig()->product_sorting_direction;
}
|
|
11.07.2022 11:20
|
|
spike77
Name: Manfred
30.04.2015
Posts: 706
|
Aw: Artikelsortierung
spike77 - 11.07.2022 11:15
I just do not know what you mean!? What are the JS5.x Sorting id´s? for getProductFieldSorting? In JS3.x was:
SORTID - (1 Name
2 - Price
3 - Date
6 - Popular
4 - Predefined
)
No matter what number I enter, the sorting in the frontend from new to old is just not correct
function getProductFieldSorting($order){
if ($this->table->category_id == 1040) {
return 5;
}
return \JSFactory::getConfig()->sorting_products_field_select[$order];
}
function getDefaultProductSortingDirection(){
if ($this->table->category_id == 1040) {
return 1;
}
return \JSFactory::getConfig()->product_sorting_direction;
}
|
|
11.07.2022 11:34
|
|
admin
(Support Team)
Name: Admin
05.08.2010
Posts: 25941
|
Aw: Artikelsortierung
Sorry.
add 2 function to
components\com_jshopping\Model\Productlist\CategoryModel.php
function getDefaultProductSorting(){
if ($this->table->category_id == 1040) {
return 3;
}
return \JSFactory::getConfig()->product_sorting;
}
function getDefaultProductSortingDirection(){
if ($this->table->category_id == 1040) {
return 1;
}
return \JSFactory::getConfig()->product_sorting_direction;
}
Letzte Änderung: 11.07.2022 11:36
|
|
11.07.2022 11:48
|
|
spike77
Name: Manfred
30.04.2015
Posts: 706
|
Aw: Artikelsortierung
No problem ;) No it works ... Thank you!
|
|