Author Topic: The joy of SEF  (Read 15068 times)

doorknob

  • Jr. Member
  • **
  • Posts: 151
Re: The joy of SEF
« Reply #15 on: September 16, 2008, 15:04:33 pm »
Danny,
I'm not really in a good position to suggest changes to the parameter search function because I haven't made any changes. I created a module that sits in the right column (image attached) and provides spemilded searching features. My module is based on the original code for parameter search but has been extensively modified. I'd be happy to send you the code I've got for the parameter search module (and related programs e.g. shop.browse) but you should be aware of the following issues:
1 The module is integrated with other changes that I have made and would not work stand-alone so you would have to compare the code with the original in a complex way to identify the differences.
2 The code has been modified to set initial values (because, as a module, it may be shown on the same page as the results of a search).
3 The code was changed so that it can use more than one parameter in the same search.
4 The search also uses a product category list to constrain the results.
5 The field names were shortened to reduce the size of the url.
6 The browse sql has been modified to allow for multiple parameters and multiple product categories.
7 The process for compiling the search_string (shop.browse) has been modified to cater for the changes.
8 Other changes in shop.browse and shop_browse_queries relate to changes that I made to the Advanced Search (extra logic and list of categories instead of a single category)
9 The code for the presentation templates has also been changed so that when the browse page navigation is used, all of the parameter fields are included.

I believe that my version of shop.browse also fixes a couple of other bugs:
1 breadcrumbs not shown correctly for search results
2 search_string not compiled for search results below 5 items (causes navigation problem if asc/desc or orderby is changed)

There's a lot of work to do to compare all of that code and sort out the bug fixes from the unwanted functionality (although some of the extra functionality would be compatible with the existing code e.g. allowing multiple product categories and product parameters in searches). I use UltraCompare to identify differences between code versions and I don't think this could be done without such a tool.

If you're prepared to take this on, I'll zip up all of the files and pm them to you.

Regards
Phil

[attachment cleanup by admin]

korb

  • Quality&Testing Team
  • Full Member
  • *
  • Posts: 685
  • VM 2.0 in heavy testing
    • Buy my work
Re: The joy of SEF
« Reply #16 on: September 16, 2008, 15:34:34 pm »
I have everything ready to run the file comparison and make the tests, your modifications sounds excelent. Just by reading your post I feel happy :)
Danny

basvanberkel222

  • Beginner
  • *
  • Posts: 16
Re: The joy of SEF
« Reply #17 on: January 27, 2009, 20:19:33 pm »
Guys,

I am having the same problem as you did.
If I click on page2, it is impossible for me to go to page 1.
Is there a simple fix for this?

I have downloaded the "new" pagenavigation class. And I commented out the limitbox. But that didn;t do it for me.

Using joomla1.5.8
Virtuemart 1.1.2
sh404sef 1.0.16_Beta - build_222 - Joomla 1.5.x -

doorknob

  • Jr. Member
  • **
  • Posts: 151
Re: The joy of SEF
« Reply #18 on: February 01, 2009, 18:04:26 pm »
The inability to get back to page 1 is caused by a bug in sh404sef. The developer of that product doesn't want to respect the concept of a value that defaults to the last value entered rather than a fixed value. He persistently calls this feature a bug. sh404sef doesn't have the sophistication to cope with this and works on the basis that page 1 is always the default and so a request for page 1 can be discarded because the default will kick in and rescue the day. Wrong. VM does not default to the first page, it defaults to the page you last requested. There is a similar bug with the browse sequence. If you change to a different sequence, you won't be able to change back again. You can fix the bugs in sh404sef as follows:

components/com_sh404sef/sef_ext/com_virtuemart.php
comment out lines 119 - 124 (fixes the browse sequence problem)

administrator/components/com_sh404sef/sh404sef.class.php
After line 2079, add the following code
Code: [Select]
  } else if ( strpos( $url, 'option=com_virtuemart' ) !== false ) {
    $ret=999; // The VM default is variable so set a default value that can never match the current value
This ensures that the default page number never applies.

You should also be aware that sh404sef will crash the browser if you have an array in the url (like in the product type search part of vm).
If you use any features that put arrays in the url then you might want to look at the fix I posted on the sh404sef site. It was posted before the current version was released and the developer has now put some of the code into the latest version but not all of it (beats me why he bothered because what he did doesn't fix the problem). Anyway, if you look at my original post and apply the missing bits to the latest version, it will work fine.

Take a look at my site and check out the pagination and search feature in the wine section (which uses a heavily modified product type parameter search)

http://www.eyeforabargain.co.uk/Wine-Offers.html

Regards
Phil