Refactor product loading logic and update URL routing
- Refactored the product loading logic in the ShopProduct class to improve performance and readability. - Updated the URL routing in the index.php file to handle redirects and routes based on the request URI. - Added a new method in the S class to check if adding a redirect will create a cycle in the redirect map. - Updated the S class to use the new method for adding redirects and generating URL routes. - Removed unnecessary code related to generating .htaccess rules.
This commit is contained in:
@@ -276,8 +276,7 @@ class ShopProduct
|
||||
$response = [ 'status' => 'error', 'msg' => 'Podczas ładowania produktów wystąpił błąd. Proszę spróbować ponownie.' ];
|
||||
|
||||
\S::set_session( 'products_list_current_page', \S::get( 'current_page' ) );
|
||||
if ( \S::get( 'query' ) )
|
||||
\S::set_session( 'products_list_query', \S::get( 'query' ) );
|
||||
\S::set_session( 'products_list_query', \S::get( 'query' ) );
|
||||
|
||||
if ( $products = \admin\factory\ShopProduct::ajax_products_list( \S::get_session( 'products_list_current_page' ), \S::get_session( 'products_list_query' ) ) ) {
|
||||
$response = [
|
||||
@@ -313,12 +312,9 @@ class ShopProduct
|
||||
parse_str( $query, $query_array );
|
||||
}
|
||||
|
||||
if ( \S::get( 'show_xml_data' ) === 'true' )
|
||||
{
|
||||
if ( \S::get( 'show_xml_data' ) === 'true' ) {
|
||||
\S::set_session( 'show_xml_data', true );
|
||||
}
|
||||
else if ( \S::get( 'show_xml_data' ) === 'false' )
|
||||
{
|
||||
} else if ( \S::get( 'show_xml_data' ) === 'false' ) {
|
||||
\S::set_session( 'show_xml_data', false );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user