"Sort by" Section Disappears When Selecting "Price"
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
"Sort by" Section Disappears When Selecting "Price"
I encountered an issue. When users select the "Price" option in the "Sort by" functionality, the entire "Sort by" section disappears from the page.
Steps to Reproduce:
remove all mshop_index_price records
1. Navigate to the catalog page.
2. Click on the "Sort by" dropdown.
3. Select "Price" as the sort option.
Expected Behavior:
- The "Sort by" section should remain visible, with the "Price" option highlighted as active.
Actual Behavior:
- The entire "Sort by" section disappears, leaving no visible options to change the sort order.
Analysis:
Upon inspecting the PHP code, it appears the issue might be related to how the `$priceDir` variables is set and used in the conditional logic. Specifically, the issue could occur because the code doesn’t properly handle cases where the sort value is null or there’s no content to show. When the "Price" option is selected, this condition may cause the HTML for the "Sort by" section to fail to render.
---
vendor\aimeos\ai-client-html\templates\client\html\catalog\lists\pagination.php
laravel 10
php 8.2
aimeos 2023.10
Steps to Reproduce:
remove all mshop_index_price records
1. Navigate to the catalog page.
2. Click on the "Sort by" dropdown.
3. Select "Price" as the sort option.
Expected Behavior:
- The "Sort by" section should remain visible, with the "Price" option highlighted as active.
Actual Behavior:
- The entire "Sort by" section disappears, leaving no visible options to change the sort order.
Analysis:
Upon inspecting the PHP code, it appears the issue might be related to how the `$priceDir` variables is set and used in the conditional logic. Specifically, the issue could occur because the code doesn’t properly handle cases where the sort value is null or there’s no content to show. When the "Price" option is selected, this condition may cause the HTML for the "Sort by" section to fail to render.
---
vendor\aimeos\ai-client-html\templates\client\html\catalog\lists\pagination.php
laravel 10
php 8.2
aimeos 2023.10
Re: "Sort by" Section Disappears When Selecting "Price"
If no products for the selected currency are found, then no products are returned and the total count is 0. This also removes the pagination including the sort options: https://github.com/aimeos/ai-client-htm ... #L147-L158
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: "Sort by" Section Disappears When Selecting "Price"
I have two products that have a price, and they are available in the database index_price table. However, the total count is always returning 0. I checked the currency, and it is correct too.
Re: "Sort by" Section Disappears When Selecting "Price"
Enable debug logging and check the conditions in the SQL statement:
https://aimeos.org/docs/2024.x/config/m ... /#loglevel
https://aimeos.org/docs/2024.x/config/m ... /#loglevel
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star