Results 1 to 5 of 5
  1. #1

    Default URL pagination parameter rewrite

    Recently I have found that something was not very nice for reading, and this something is the URL for paginated series of product listing.

    Curently I am using CEON URI mapping, but there is no function to remove the parameters.

    I want to convert:

    https://my_website.com/category1?sort=20a&page=2

    to

    https://my_website.com/category1/2

    I have tried to add some new rewrite rules (exept the ones that are already in the .httaccess) like that one (RewriteRule ^([A-Za-z0-9-]+)/?$ ?sort=20a&page=$1 [L])

    but nothing happens...

    What am I doing wrong, any ideas?
    My most recent work: magprom.net

  2. #2
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: URL pagination parameter rewrite

    Quote Originally Posted by perfumbg View Post
    Recently I have found that something was not very nice for reading, and this something is the URL for paginated series of product listing.Curently I am using CEON URI mapping, but there is no function to remove the parameters.I want to convert:https://my_website.com/category1?sort=20a&page=2to https://my_website.com/category1/2I have tried to add some new rewrite rules (exept the ones that are already in the .httaccess) like that one (RewriteRule ^([A-Za-z0-9-]+)/?$ ?sort=20a&page=$1 [L])but nothing happens...What am I doing wrong, any ideas?
    For Ceon URI to map from the address shown to the one desired, requires making a new database record to handle the additional parameters. A problem with that though because the sort order is listed before the page identifier is that if the sort order is changed, then the display will be back to what is currently seen but with the different sort order.On another note, I thought I saw in the version 5 thread something about how to integrate a new rewrite such as that where something additional could be used at least to identify the page number.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3

    Default Re: URL pagination parameter rewrite

    Quote Originally Posted by mc12345678 View Post
    For Ceon URI to map from the address shown to the one desired, requires making a new database record to handle the additional parameters. A problem with that though because the sort order is listed before the page identifier is that if the sort order is changed, then the display will be back to what is currently seen but with the different sort order.On another note, I thought I saw in the version 5 thread something about how to integrate a new rewrite such as that where something additional could be used at least to identify the page number.
    Thank you for the directions. I am trying to figure out something right now and if I'm on the right track i will share the results.

    Thanks again.
    My most recent work: magprom.net

  4. #4

    Default Re: URL pagination parameter rewrite

    So i have tracked down the code to

    /includes/clases/class.CeonUriMappingHandler.php around line 375

    PHP Code:
            } else if (!is_null($query_string_parameters)) {
                
    // Page is a Zen Cart page with preset parameters, must initialise the parameters
                
    $query_string_pairs explode('&'$query_string_parameters);
                
                foreach (
    $query_string_pairs as $query_string_pair) {
                    
    $parameter_parts explode('='$query_string_pair);
                    
                    
    // Parameter from database overrides any in query string
                    
    if (count($parameter_parts) == 2) {
                        
    $_GET[$parameter_parts[0]] = urldecode($parameter_parts[1]);
                    }
                }
            } 
    and I think i should do something like this

    PHP Code:
    $query_string_to_match str_replace('?sort=20a&' '/'$parameter_parts[1], $query_string_to_match); 
    and add it somewhere but not sure where exactly.

    I will update on success...
    My most recent work: magprom.net

  5. #5

    Default Re: URL pagination parameter rewrite

    I have found "something", it is not the exact same URL strcture i wanted, but it is Sunday, I have two year old daughter and so I had only 30 minutes...

    if somebody wants to know how to convert () the standart CEON url of categories with pagination to something like this

    https://website.com/category?page=2 instead o fhttps://website.com/category?sort=20a&page=2

    you should open includes/clases/class.ceonurimappingHREFLinkBuilder.php and search for

    PHP Code:
    $link .= zen_output_string($parameters); 
    around line 368 and change it to

    PHP Code:
    $link .= str_replace('sort=20a&''', (zen_output_string($parameters))); 
    this removes the anoying sort=20a& from the url, without braking anything.

    on row 362 /same file/ one can change the "?" separator to "/" but this breaks the pagination links, I asume that there is a lot more work to do to change only the separator

    as you know more work = more time, and 2y old daughter = less time so less time = unfinished work.

    I will update when or if I manage to work it out.
    My most recent work: magprom.net

 

 

Similar Threads

  1. rewrite url form creloaded
    By bn17311 in forum General Questions
    Replies: 2
    Last Post: 30 Aug 2010, 08:01 AM
  2. change url / url rewrite?
    By moesoap in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 30 Jun 2010, 02:13 PM
  3. Rewrite URL's for Categories/Products
    By gibbywmu in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 28 Aug 2009, 02:25 AM
  4. url rewrite ???
    By dannyd in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Feb 2007, 10:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR