VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Topic started by: Cajetan on December 01, 2008, 22:56:05 pm

Title: Parameter search (dropdown)
Post by: Cajetan on December 01, 2008, 22:56:05 pm
Hello there, after reading these forums for years and using VM for a long time as well I'd like to give something back to the community. Hope I hit the right subforum. I attached a screenshot.

Features, simple as they are:
# Shows the parameters of a certain product-type as dropdownboxes, so you can filter your search with them.

-------------------------------------------
Current version: 0.7 (12/5/2008)
Updates:
- Now it is possible to exclude certain parameters within backend module configuration
version: 0.6
Updates:
- Added checkboxes for the display of introduction,name-search, price-search (Thanks korb!)
- Labels can be formatted with hex-colors (#000000) via administration
- The Labels of price-search and name-search are fetched from virtuemart itself
- The search-button now has a default value ('Search') (Thanks korb!)
- You can choose a product type from backend now

You'll find the download below
-------------------------------------------

Please note: I'm a super-scrub concerning programming and although I found out it works for me, it still requires some manual work in order to fit it to individual needs. I'm planning improvement on usability and flexibility though.

Any help, suggestions and hints are very very welcome!
Things that need to be solved:
#1 array-error when there are multi-select parameters
#2 Implementation of ajax

I'm not sure whether I stated everything correctly in the copyright as the little hacking I have done is based on the already existing parameter search built into VM ... Don't want to receive a ban for copyright infringements :) If there's a problem occuring please notify me!

Note for use: I limited the display of boxes according to parameter_type "V" as I got a ton more parameters than I want to show in the module[/u]. Thus selecting it via parameter_type. If more explanations are needed I hope I can deliver them. Additionally I used inline styles for CSS, god forgive me, I think it's better everybody uses his own IDs/classes and inserts them himself  :)

EDIT: Removed the Code for reading convenience.

Thanks in advance & have fun trying!

EDIT: My english got really really rusty, I think I need to participate a lot more ;)

Regards,
Cajetan

[attachment cleanup by admin]
Title: Re: Virtuemart+Joomla Module: Parameter search (dropdown)
Post by: korb on December 04, 2008, 17:56:33 pm
Hey I was just about t write a FRQ for making such a thing.

BUGS LIST - things we must settle first
Ok, I installed your module, but it does not show all parameters and I need to make it work for all my product types (6 so far). So first we need to eliminate the parameter type delimiter.
SO to do that, go to line 40 and delete
Code: [Select]
AND parameter_type='V'
The seccond problem is that "Search" string of that search button does not appear.

Third issue: what is product name field for? like a keyword? We need to know how to remove this just in case. Maybe a config in the module administration.

Fourth issue is not automatically detecting product_type_id, so we need to construct a query where we join tables (temporarly and locally merging) #_vm_product_product_type_xref and #_vm_product_category_xref in such a manner it will understand the relation between category_id and product_type_id, and we could get product_type_id for each category AUTOMATICALLY.

Last BIGEST ISSUE: if you have SEF on (like sh404SEF), and we have a multipage search results page, pagination does not work, I've seen some sites using VM with a href="../20-inch" where 20 inch is a parameter value, and this is placed in the link instead of "../product_type_id=1&product_type_diagonal_s=20%inch" so we desperately need a function to encode these variables that are shown in the links.

FRQ LIST - how to make this be the best filter ever seen.
1. we need a general filter that include these all:
-filter by manufacturer,
-filter by product types parameters (our case here),
-filter by stock (checkbox to show only products in stock or create a dropdown box with in stock/out of stock/all),
-filter by commented products (checkbox to show only products with at least one comment)
-filter by sales (checkbox to show only products with product_sales > 0)

2. we must have a backend option to exclude price as a parameter for the search.

3. if someone wants to use price let's make it use price intervals. This means the code inside will calculate 5 price intervals based to the prices of the category so we could have products classified as:
-low cost (price interval 1)
-medium-low cost (price interval 2)
-medium (price interval 3)
-premium (price interval 4)
-super premium (price interval 5).

I am no coder but I read a lot of ecommerce and ebusiness, and I can tell this is how to make VirtueMart the best open source shopping cart.

Those who are interested in this development, please subscribe (Notify) to the topic and donate to pay a developer to code it.

Get back with news.
Danny
Title: Re: Virtuemart+Joomla Module: Parameter search (dropdown)
Post by: Cajetan on December 04, 2008, 20:19:15 pm

Ok, I installed your module, but it does not show all parameters and I need to make it work for all my product types (6 so far). So first we need to eliminate the parameter type delimiter. SO to do that, go to line 40 and delete
Code: [Select]
AND parameter_type='V'

I'm working on this one, in my local version I've got a dropdown-menu in the backend displaying all available product types - but you can only choose one product type (and its parameters)

The limit you mentioned above is a means to prevent certain parameters from being shown; One might have 10 Parameters but only wants to show 4 of them.

Right now I have no clue how to solve that issue :(
EDIT: Thinking of checkboxes for backend again, showing all available parameters, and the admin would be able to choose the wanted ones.

Quote from: korb
The seccond problem is that "Search" string of that search button does not appear.
I'm very new to module creating, will check out default values for params
Edit: Default label now is "Search"

Quote from: korb
Third issue: what is product name field for? like a keyword? We need to know how to remove this just in case. Maybe a config in the module administration.
Indeed, it is. Maybe a checkbox in the backend would be a lot more convenient in case you want to turn it on/off?

Quote from: korb
Fourth issue is not automatically detecting product_type_id, so we need to construct a query where we join tables (temporarly and locally merging) #_vm_product_product_type_xref and #_vm_product_category_xref in such a manner it will understand the relation between category_id and product_type_id, and we could get product_type_id for each category AUTOMATICALLY.
That's a big one =)

Quote from: korb
Last BIGEST ISSUE: if you have SEF on (like sh404SEF), and we have a multipage search results page, pagination does not work, I've seen some sites using VM with a href="../20-inch" where 20 inch is a parameter value, and this is placed in the link instead of "../product_type_id=1&product_type_diagonal_s=20%inch" so we desperately need a function to encode these variables that are shown in the links.

Is this an issue for the module? Thought the search-engine is creating the URL for those.

Quote from: korb
FRQ LIST - how to make this be the best filter ever seen.
1. we need a general filter that include these all:
-filter by manufacturer,
-filter by product types parameters (our case here),
-filter by stock (checkbox to show only products in stock or create a dropdown box with in stock/out of stock/all),
-filter by commented products (checkbox to show only products with at least one comment)
-filter by sales (checkbox to show only products with product_sales > 0)
2. we must have a backend option to exclude price as a parameter for the search.
3. if someone wants to use price let's make it use price intervals. This means the code inside will calculate 5 price intervals based to the prices of the category so we could have products classified as:
-low cost (price interval 1)
-medium-low cost (price interval 2)
-medium (price interval 3)
-premium (price interval 4)
-super premium (price interval 5).

I am no coder but I read a lot of ecommerce and ebusiness, and I can tell this is how to make VirtueMart the best open source shopping cart.
Those who are interested in this development, please subscribe (Notify) to the topic and donate to pay a developer to code it.
Get back with news.
Danny

Thank you very much for your input :) Lots of cool ideas in your feature-list as well, especially the 3rd one, using price intervals (bold). I'd be very glad if this turned into a teamwork-thread as my coding-knowledge is limited.

Regards,
Cajetan
Title: Re: Filter Module: Parameter search (dropdown)
Post by: korb on December 04, 2008, 21:01:25 pm
Thanks for feedback, I waited a long time for a partner to do this. We realy need this, because VM is very lost in time, so we need to bring it back to life.
Title: Re: Filter Module: Parameter search (dropdown)
Post by: Cajetan on December 04, 2008, 22:26:22 pm
I updated the version to 0.6, there are some changes, most are dealing with usability issues. Code's not clean yet :)

- Added checkboxes for the display of introduction,name-search, price-search (Thanks korb!)
- Labels can be formatted with hex-colors (#000000) via administration
- The Labels of price-search and name-search are fetched from virtuemart itself
- The search-button now has a default value ('Search') (Thanks korb!)
- You can choose a product type from backend now
- The limit of the module only showing parameters with multiple values ('V' in the databank) has been removed (effectively showing ALL parameters from the product type)

You can get the file from the opening post.

Concerning the idea to ensure people can check the parameters they want to display: with current un-hacked joomla versions it's not possible to create multi-select lists or to display SQL-Queries in another way (e.g. text-boxes) than in a regular dropdown-box. Thus the user won't get any feedback on the parameters in a product type.

But, one could enter the parameters he wants to use in a textbox... The problem is: This system relies on the user correctly entering everything correctly.

The file is back online

Regards,
Cajetan
Title: Re: Filter Module: Parameter search (dropdown)
Post by: Cajetan on December 05, 2008, 00:29:10 am
Hope there's no problem with doubleposting policy when I write about the next released version ...

Well, version 0.7 is now available for download, together with the option to exclude certain parameters from display on frontend.

Please use this example, as at the moment the formatting needs to be followed strictly:
Code: [Select]
'Parameter1', 'Parameter5', 'Parameter7', ...
In fact you should be able to exclude as many parameters as you want.

Regards,
Cajetan
Title: Re: Filter Module: Parameter search (dropdown)
Post by: Han Leentvaar on December 05, 2008, 02:05:37 am
Hi, for V.07:
When price search is disabled, the search button is also disabled.
Corrected code begins line 87:
Code: [Select]
   else {
    echo "<div>";
    echo "<label style='font-weight:bold;color:". $label_color ."'>". $VM_LANG->_('PHPSHOP_CART_PRICE') ."</label><br />";
    $item_name = "price";
  $get_item_value = vmGet($_REQUEST, $item_name, "");
  $get_item_value_comp = vmGet($_REQUEST, $item_name."_comp", "");
  echo "<select class=\"inputbox\" name=\"price_comp\">";
  echo "<option value=\"lt\"".(($get_item_value_comp=="lt")?" selected":"").">&lt;</option>\n";
  echo "<option value=\"le\"".((empty($get_item_value_comp)||$get_item_value_comp=="le")?" selected":"").">&lt;=</option>\n";
  echo "<option value=\"eq\"".(($get_item_value_comp=="eq")?" selected":"").">=</option>\n";
  echo "<option value=\"ge\"".(($get_item_value_comp=="ge")?" selected":"").">&gt;=</option>\n";
  echo "<option value=\"gt\"".(($get_item_value_comp=="gt")?" selected":"").">&gt;</option>\n";
  echo "<option value=\"ne\"".(($get_item_value_comp=="ne")?" selected":"").">&lt;&gt;</option>\n";
  echo "</select> ";
  echo "<input type=\"text\" class=\"inputbox\"  name=\"price\" value=\"$get_item_value\" size=\"20\" />\n";
  echo "</div>";
}
   echo "<div>";
   echo "<div align='center'><br /><input type='submit' class='button' name='search' value='". $button_label."'></div>";
   echo "</div>";
   ?>

I myself am still looking to the problem that I get an error (3 times):
Warning: Invalid argument supplied for foreach() in /home/klavar/domains/klavarskribo.nl/public_html/administrator/components/com_virtuemart/classes/ps_product_type.php on line 459


When I observe these lines (457) in ps_product_type.php:
Code: [Select]
if ($db->f("parameter_multiselect")=="Y" && $db->f("parameter_values")) { // Multiple section List of values
$get_item_value = vmGet($_REQUEST, $item_name, array());
I see a difference when I use the dropdown search and the original product type search.
The dropdown gives
Item name: product_type_1_handschrift
Item value: Ja

While the official one gives:
Item name: product_type_1_handschrift
Item value: Array


Seems not correct... The official one shows an array...

Regards, Han (Joomla 1.5.8, VM 1.1.2)
Title: Re: Filter Module: Parameter search (dropdown)
Post by: korb on December 05, 2008, 03:45:27 am
OK back with news:

First this is not a filter yet, it is Advaced Search Accordiong to Parameters, because a filter does not need search button, and when you select a parameter value, the search is automatically started.

Then the main concern is autodetect product type id for each category.

Then the URL and route. The filter does not have to redirect to index.php like VM parameter search does. It should only add
Code: [Select]
&parameter_value, like
Code: [Select]
&1000MHz to the link and not redirect to index.php, so in this case pagination is normal like it supose to be and the variables
Code: [Select]
product_type_parameter=value ofcourse MUST NOT APPEAR IN THE LINK. I will soon attach a GUI (graphical user interface) with some explinations inside.

The other features mentioned by me are easy implementations, most important is what I stated this post.
Danny
Title: Re: Parameter search (dropdown)
Post by: Cajetan on December 05, 2008, 14:12:20 pm
Quote from: Han Leentvaar
When price search is disabled, the search button is also disabled.

Thanks a lot for pointing this one out, Han!

Quote from: Han Leentvaar
I myself am still looking to the problem that I get an error (3 times):
Warning: Invalid argument supplied for foreach() in /home/klavar/domains/klavarskribo.nl/public_html/administrator/components/com_virtuemart/classes/ps_product_type.php on line 459

But the output seems to work ??? I'll try to fix it asap!

Quote from: korb
First this is not a filter yet, it is Advaced Search Accordiong to Parameters, because a filter does not need search button, and when you select a parameter value, the search is automatically started.

While I think certain filters (like # of displayed products in browse page) do not need a "Filter"/"Search"-button, I believe it'll be better to keep the button  just in case someone wants to select multiple parameters (I can only imagine the search being triggered by the selection of ONE field, which would effectively exclude the other parameters).

Quote from: korb
Then the URL and route. The filter does not have to redirect to index.php like VM parameter search does. It should only add &parameter_value, like &1000MHz to the link and not redirect to index.php, so in this case pagination is normal like it supose to be and the variables product_type_parameter=value ofcourse MUST NOT APPEAR IN THE LINK. I will soon attach a GUI (graphical user interface) with some explinations inside.

As I'm no coder either, I'm just experimenting :) There's an addition to the form-action I'm trying:

Search for this line (line 55 in 0.7):
Code: [Select]
<form action="<?php echo URL ?>index.php" method="post" name="attr_search">

Behind index.php add the following:
Code: [Select]
?option=com_virtuemart&page=shop.browse
Please note
- The entry of your current page in breadcrumbs-module does not yield any value!
- This is just a "cosmetic" change! Pagination should start when you have at least 5 products matching the parameters you chose


Concerning the connection of categories and the parameter search: There is a way to get the needed values from the tables you mentioned, no problem. But how would you assign parameter search to categories? However, the possibility exists to connect different parameter searches to single products. Is it that what you're talking about?

Thanks a lot for your feedback you two, I really appreciate it!

Regards,
Cajetan
Title: Re: Parameter search (dropdown)
Post by: korb on December 05, 2008, 15:53:18 pm
In our form we really need to add manufacturer_id and category_id, and with the help of experienced developers, we could try to do what I posted the second post this topic.
This must be and work as a filter and not as the old and buggy parameter search.
Danny
Title: Re: Parameter search (dropdown)
Post by: korb on December 06, 2008, 18:06:13 pm
NO one else interested in this development?
Title: Re: Parameter search (dropdown)
Post by: Cajetan on December 07, 2008, 16:07:42 pm
Well, I'm still interested and still working on the module :)

Regards,
Cajetan
Title: Re: Parameter search (dropdown)
Post by: korb on December 07, 2008, 23:23:02 pm
What is the status, the next phase of the development?
Title: Re: Parameter search (dropdown)
Post by: Cajetan on December 07, 2008, 23:36:16 pm
#1 Trying to fix the error reported by Han
#2 Implementing Ajax

Both are not that easy, but Ajax runs at least (under certain circumstances; those  being: a special component needs to be installed  :( ) Together with another member of this forum I thought about this whole category-connectedness and we decided it'd be too complicated as well because you'd need additional fields/an additional table within the database. Plus you need to assign every category to a certain module in the backend (with the aforementioned database-changes).

#1 works correctly in case you don't have any MULTISELECT Parameters :) Still trying to figure out how to handle the needed arrays :(

Regards,
Cajetan
Title: Re: Parameter search (dropdown)
Post by: avra911 on December 30, 2008, 13:31:43 pm
Multiple select problem in parameter search should be solved in the VM1.1.2 core as a must.

this should be an important update to the next release.

check this
http://forum.virtuemart.net/index.php?topic=48719.msg160053#msg160053
it seems to work fine for me
Title: Re: Parameter search (dropdown)
Post by: avra911 on December 30, 2008, 13:46:39 pm
And about the 3 or 4 times ERROR:

Quote
Quote from: Han Leentvaar
I myself am still looking to the problem that I get an error (3 times):
Warning: Invalid argument supplied for foreach() in /home/klavar/domains/klavarskribo.nl/public_html/administrator/components/com_virtuemart/classes/ps_product_type.php on line 459

But the output seems to work Huh I'll try to fix it asap!

in ps_product_type.php

replace
Code: [Select]
$get_item_value = vmGet($_REQUEST, $item_name, array());with
Code: [Select]
$get_item_value = vmGet($_GET, $item_name, array());
i don't know but it's working for me.

razvan
Title: Re: Parameter search (dropdown)
Post by: avra911 on January 01, 2009, 18:35:46 pm
One more thing,

I did a little change in the ps_product.php and now the advanced parameter search on multiple select is working.

Try changing this:
Code: [Select]
if ($dbpt->f("parameter_type")!="B") { // if it is not breaker
$value=$d["product_type_".$product_type_id."_".$dbpt->f("parameter_name")];
if ($dbpt->f("parameter_type")=="V" && is_array($value)) {
$value = join(';',$value);
}

with this

Code: [Select]
if ($dbpt->f("parameter_type")!="B") { // if it is not breaker
$value=$d["product_type_".$product_type_id."_".$dbpt->f("parameter_name")];
if ($dbpt->f("parameter_type")=="V" && is_array($value)) {
$value = join(',',$value);
}

I didn't have time to check more for the problem but at least the search seems to work.

Best regards and have a new year,
Razvan



PS:


also in file product.product_form.php
change

Code: [Select]
if ($dbpt->f("parameter_type")=="V") { //  Type: Multiple Values
    $size = min(count($fields),6);
    echo "[]\" multiple size=\"$size\">\n";
    $selected_value = array();
    $get_item_value = $dbp->f($dbpt->f("parameter_name"));
    $get_item_value = explode(";",$get_item_value);

with

Code: [Select]
if ($dbpt->f("parameter_type")=="V") { //  Type: Multiple Values
    $size = min(count($fields),6);
    echo "[]\" multiple size=\"$size\">\n";
    $selected_value = array();
    $get_item_value = $dbp->f($dbpt->f("parameter_name"));
    $get_item_value = explode(",",$get_item_value);
Title: Re: Parameter search (dropdown)
Post by: Marc O. on January 07, 2009, 17:39:38 pm
I also am very interested in this module. I tried it on our test system but unfortunately it doesn't seem to show any dropdown menu's here. Can somebody explain how to use it?
Title: Re: Parameter search (dropdown)
Post by: Marc O. on January 07, 2009, 21:29:53 pm
I also am very interested in this module. I tried it on our test system but unfortunately it doesn't seem to show any dropdown menu's here. Can somebody explain how to use it?

I managed to get it to work (and learned about "product types" while doing so (didn't use product types, didn't even know about product types)). :o ;D

Looks like a truly great module. Actually, a couple of months ago I asked on this forum whether something like this already existed. Looks like the number one on my wishlist is ready for implementation on my live site now. Thanks for that guys!

So far I only have two questions/remarks:
1) When I choose to hide the price search, the Search button also disappears from the frontend. (see below)
2) On the "search results" page, there is the text "Search in Category: <product type>" and a button "change parameters". Is there a way to make that disappear?

Thanks again for your good work.

Marc

Edit:
Corrected code in this post (http://forum.virtuemart.net/index.php?topic=48719.msg156907#msg156907) solved the issue of the disappearing Search button
Title: Re: Parameter search (dropdown)
Post by: MikeUK on January 08, 2009, 23:31:32 pm
Hi guys

Quickie question. As far as searching by price, are you looking to do this by price in product type or actual product price?
Title: Re: Parameter search (dropdown)
Post by: animas on January 10, 2009, 05:21:05 am
Nice useful module. We hope to see more updates in future.
Title: Re: Parameter search (dropdown)
Post by: darengr on January 20, 2009, 16:50:22 pm
Hi to all for this great effort. I would appreciate if someone that got this module working, just confirm that the file attached in the first post is COMPLETE with the rest of the modifications. I tried it, but without any luck.
Many thanks!
Title: Re: Parameter search (dropdown)
Post by: Marc O. on January 20, 2009, 17:11:18 pm
Hi,

It works for me (see http://www.onrust-yacht-charters.com). Did you check this post:
http://forum.virtuemart.net/index.php?topic=48719.msg156907#msg156907

Cheers,
Marc
Title: Re: Parameter search (dropdown)
Post by: darengr on January 20, 2009, 17:28:31 pm
Hi Marc, thanks for your reply, well the post is this same post, correct? Did you use the .zip file from the first post without any other manual modifications?
Can I just ask you some things on your site?
1. the extended yacht search is the result of this module, correct? So you defined all these parameters and add them to your product, yes?.
2. the search by... type, size, destination modules and the lower left end, are the standard VM categories, yes?

doesn't it give you a duplicate effort to catogerise AND define parameters for each product (actually the same info twice)?

many thanks!
Title: Re: Parameter search (dropdown)
Post by: Marc O. on January 20, 2009, 18:18:16 pm
Hi,

Yes, we used the filed that is attached to the first post, but I changed some lines, as explained in http://forum.virtuemart.net/index.php?topic=48719.msg156907#msg156907

Re you questions:
1) Yes, the extended yacht search is the result of this module. First we defined a product type (only one in our case). Second, within this product type we defined three parameters: Yacht Type, Yacht Size and Yacht Destination. Third, for each parameter we defined the possible values. Those parms and values are what you see in the "Extended Yacht Search".

2) Correct.

Yes, it's duplicate effort but we're only using the "Extended Yacht Search" for a couple of days now in our production site. Going to figure out what to do with the categories. As a matter of fact, we're keeping the categories (because they include some SEF relevant information) but just looking what to do with it on our site.

Hope this helps! Let me know if it doesn't. Happy to assist if possible.

Cheers,
Marc
Title: Re: Parameter search (dropdown)
Post by: darengr on January 21, 2009, 13:00:54 pm
@Marc: Many thanks for info and thought sharing. I think I will treat the advanced search by parameter a cherry now, and go for the cake, that is the categories (only), in a combination with the manufacturer. I just updated another similar post with more info, which you could find useful, it is here: http://forum.virtuemart.net/index.php?topic=50137.0

I 'll be in touch, I am interested in any solution for combined categories searching (or filtering) and happy to test any progress on this field.

Tell me if you find that other info of any use, and keep in touch!
best regards for now!
Title: Re: Parameter search (dropdown)
Post by: Marc O. on January 21, 2009, 13:51:33 pm
I think the best way to filter on multiple categories (like you also explained in your other post here: http://forum.virtuemart.net/index.php?topic=50137.0) is using the product types together with the module on this page. However you might "abuse" the manufacturer module with the same goal.

To be honest, I don't think it's a lot of work extra. You might choose your parameters equal to your main categories (in your example "color", "fashion") and the values of these parameters to equal the subcategories ("blue", "red", "modern", "classical"). It's a bit of extra work when setting up products, but I guess it's not a show stopper especially because there doesn't seem to be an alternative.

By the way, I also experience the phenomenon of changing categories and subcats when moving from one product to the next, so I'm very curious to how you solve(d) that.
Title: Re: Parameter search (dropdown)
Post by: bulesz on January 21, 2009, 21:40:49 pm
Working with CSVI, the product management is very easy, using the parameters too! ;)
Title: Re: Parameter search (dropdown)
Post by: cosg2004 on January 23, 2009, 17:43:17 pm
Excellent initiative Cajetan,

I installed the module last night on my store. It works nicely with few exceptions (I surely undersatnd it is an working process). Comments:

1. I disagree with Korbs comment on "filter" like features. I personaly hate when having more parameters to get the filter output after each selection. Hence my preference to select all the parameters and hit "Search" like in the actual module. IMHO.
2. Han's code is missing an <div> I think, as it screwed up my other published modules.
3. Pagination navigation does not work with this module, but this is an VM issue I think.

After a few cosmetic changes check how it looks : jewelrybeautiful.com

Korb, how do you suggest we should (material) contribute to this initiative?
(donation site)

Cheers, Constantine
Title: Re: Parameter search (dropdown)
Post by: korb on January 24, 2009, 23:06:49 pm
Hmm, well, if you want to contribute, you must help cajetan with what he needs. I have no interest but to see this feature rich module available for comunity.
Right now I imagine Caje beeing in finals. (He's a student..)

Quote
3. Pagination navigation does not work with this module, but this is an VM issue I think.
well, if you don't have much experience with VM templates, I disagree here, because browse pages especialy for parameter search results are managed by VM defaults in global configuration - site, and by default it is "no tables div based".

Ah if you use sh404SEF for VM, parameter search page navigation does not work, but I managed to fix it. If I could get a good IF statement, I could code the entire parameter search SEF thing.

But why don't like a filter like parameter search? It is very popular for IT shops... I just thought that is a possible roadmap..

Anyway, if you have any other questions...
Danny
Title: Re: Parameter search (dropdown)
Post by: korb on February 02, 2009, 04:37:58 am
It seems our main coder for this is away, maybe final examinations...
Title: Re: Parameter search (dropdown)
Post by: cosg2004 on February 02, 2009, 18:30:09 pm
Hi Danny
But why don't like a filter like parameter search? It is very popular for IT shops... I just thought that is a possible roadmap..
The reason is that each time you select a parameter you have to wait for the page to reload even though you know beforehand you need refine the search based on more parameters.
This can be avoided with a regular search button (aka you select all params and then hit search). Again this is a minor detail so I don't insist on it.

The module works fine once the types / params have been determined for each product. I managed to do that through CSVI (the free -older edition). I got around the category / product issue (see previous posts) by assigning a "category" like parameter to each product. Again, just a walk in the park with CSVI.

Cheers, Constantine
Title: Re: Parameter search (dropdown)
Post by: korb on February 03, 2009, 00:42:40 am
No news about this?
Title: Re: Parameter search (dropdown)
Post by: korb on February 04, 2009, 13:24:59 pm
I think the array error is not because of the ps_product_type.

Look at the form:
Code: [Select]
<form action="<?php echo URL ?>index.php" method="post" name="attr_search">
 <input type="hidden" name="option" value="com_virtuemart" />
 <input type="hidden" name="page" value="shop.browse" />
 <input type="hidden" name="product_type_id" value="1" />
 <input type="hidden" name="Itemid" value="<?php echo $sess->getShopItemid() ?>" />

This is not good
Code: [Select]
<input type="hidden" name="product_type_id" value="1" />The value should be echoed and not put a default there. You cannot search a product type with other's parameters right?

And scrolling down file we have same thing
Code: [Select]
<input type='hidden' name='product_type_1_<?php echo $db->f("parameter_name"); ?>_comp' value='find_in_set' />
   <select class='inputbox' name='product_type_1_<?php echo $db->f("parameter_name"); ?>' style='width:150px'>

that
Code: [Select]
name='product_type_1_<?php echo $db->f("parameter_name"); ?>_comp' should be
Code: [Select]
product_type_<?php echo $product_type_id?>_parameters...That is the reason I think is not searching correctly in my install.
Danny
Title: Re: Parameter search (dropdown)
Post by: korb on February 05, 2009, 05:02:41 am
Next best implementation I think is much more important: remember last parameter values used in search.
Title: Re: Parameter search (dropdown)
Post by: VMone on February 10, 2009, 19:41:34 pm

In any case, can someone compile the codes in this thread that grew over the time to some latest version of codes in a new post. Actually do not really know no more where to start to pick codes.

Would be very great! Thanks!
Title: Re: Parameter search (dropdown)
Post by: korb on February 10, 2009, 21:52:31 pm
Good idea
Title: Re: Parameter search (dropdown)
Post by: VMone on February 10, 2009, 22:02:14 pm
................
Title: Re: Parameter search (dropdown)
Post by: korb on February 10, 2009, 22:06:19 pm
well, ok, I have seen that module, but if you read one of my first posts this topic, you will see a better price range idea, as a part of a filter. This module from TPlazza is nice and slick, but out of date as functionality.
Title: Re: Parameter search (dropdown)
Post by: VMone on February 10, 2009, 22:13:54 pm
Okay, just a thought...more important would be to have the current code version, as I really do not know where you are right now? I know where you are by what your last posts say, but can someone who has worked on this since some time or you compile all the enhancement done since the first post to the latest version I can test? 

Thanks!
Title: Re: Parameter search (dropdown)
Post by: korb on February 10, 2009, 22:35:36 pm
Ok I've seen what this module+component combo can do. Well, it is hard to predict that the code from module would work or not within our parameter search module.
First of all, as a component, it uses his own pages to display results.
I don't say it's impossible, but time is limited.
Title: Re: Parameter search (dropdown)
Post by: VMone on February 11, 2009, 04:16:34 am
Time is limited, I know, that is why the hacks I desperately need for my store to open it, have to be done by some professionals for cash, I also would have liked to get it done with some hacks from the forum, but as my knowledge about coding is limited is some way, I will have to give it up to seek a cost free solution.

So, what I like to know is, put the tp component away again, this module what you work on here is working as it should by now or did you still tweak anything on it? The problem may be, it works with product attributes, I can't add those manually to my inventory, too many products, that is why I need some extra sort out field or a module that works without needing attributes, same with any search functions.

Still I like the idea and the example I have seen on the Yacht Homepage, that is why I asked if there is some latest version or if the one attached somewhere on the 1st page of this thread is the latest version?
Title: Re: Parameter search (dropdown)
Post by: szekelyz on February 22, 2009, 18:10:22 pm

Thank you for notifying me!
Title: Re: Parameter search (dropdown)
Post by: Alt148 on February 23, 2009, 15:48:11 pm
Hi Everybody,

I have modified the Search Dropdown from Cajetan Oberhaus a little. Now the module will first ask which Product Type group you want to search. And also it will remember which selections you have made.

However, I am not a professional programmer, and also not everything is working as it should be.

1. When you use a type with multiple values, there are no results.
2. I also blocking line 33 in browse_orderbyform.tpl.php in components/com_virtuemart/themes/(Your theme)/browse/includes/
"echo $ps_product_type->get_parameter_form($product_type_id);"
So the error lines are gone. (However I am not sure if it is the correct way)
3. I am also pretty sure, some code can be written better, easier!

I hope to get a good result when you select a type from the multiple values, however I am afraid that files in VM has to be altered, which I do not prefer to do.

Please I am interested in comments.

And thanks to Cajetan Oberhaus for the main part!

[attachment cleanup by admin]
Title: Re: Parameter search (dropdown)
Post by: szekelyz on February 23, 2009, 16:17:50 pm
Hi Catejan!

Nice work! Congra!

 But I am interesting if you can add for the first pos. row a category drop down select option....

And Multiselect option to product type parameters.

Is it managable?!

Zsolt

Title: Re: Parameter search (dropdown)
Post by: VMone on February 23, 2009, 20:54:09 pm
@szekelyz

--------------------

Hi Guys!

I have something wich could be interesting for anyone in this issue.

I have the Ecommerceplaza component and the category -> price range modules and also the first posted module.

What is the status with implementation of multiselect prod_type solution?

I have something prepared, but I need some extra help. I am looking for  a contributor.

The first attachement is the modified dropdown module by me. The second one working together with the Ecommerceplaza component.

Cheers


-------------------------------------

I have been asking for some feedback about this at TemplatePlazza.com and so I follow their comments. Be so kind and remove this attachment again, as it is part of a paid template and not a free extension. I would highly appreciate it when you follow their guidelines in this case.

But as you are responsible for yourself and your posts, I can only tell you this and really would like when you also follow those and do not keep this extension here online accesible to anyone in this free forum as TemplatePlazza.com and their team would not like this.

I think you understand, thanks!
Title: Re: Parameter search (dropdown)
Post by: Alt148 on February 24, 2009, 14:54:53 pm
In addition to my message yesterday. The fact that the multiple values search doesn't work is due to the problem in VM.

By editing the core code of VM as described in this topic the multiple value search works:


http://forum.virtuemart.net/index.php?topic=44445.msg141667#msg141667

Please check for yourself the status of the error in VM.
Title: Re: Parameter search (dropdown)
Post by: VMone on February 24, 2009, 16:43:03 pm

Thank you for notifying me!

No problem, I just asked them as it was unclear and I think none of us wants to go against the template clubs we really like and use a lot..;)
Title: Re: Parameter search (dropdown)
Post by: Marc O. on April 02, 2009, 20:44:38 pm
I've been wondering one thing: When using the parameter search, the url of the page with the search results turns into (in my case) www.onrust-yacht-charters.com/index.php. From a SEO point of view, this is far from optimal.

Would it be possible somehow to append the parameter and selected values to the url? Would be great if that could be picked up by sh404SEF to translate it into a sef url, but that's a nice to have (for me at least). I thought I had read something about that somewhere on this forum, but I can't find it anymore....

Also, it would be very nice if Joomfish could handle this so I can translate the parameters and values as I have a multi lingual site.
Title: Re: Parameter search (dropdown)
Post by: Alt148 on April 02, 2009, 22:11:39 pm
As far as I know, all the parameters are in the URL, since the form uses the GET method. I have to test it myself with SH404SEF, but my first idea is that SH404SEF takes out the parameters from the URL.

You can try this by turning of SH404SEF, then you will see the parameters. (Please do this on a test version of your website!)

Also a translation by Joomfish is possible. However that requires a little bit of altering the files and also change a couple of fields in the database. In a couple of weeks I expect my site to be published. Maybe then I can show you how I fixed it.
Title: Re: Parameter search (dropdown)
Post by: Marc O. on April 03, 2009, 18:21:43 pm
As far as I know, all the parameters are in the URL, since the form uses the GET method. I have to test it myself with SH404SEF, but my first idea is that SH404SEF takes out the parameters from the URL.

You can try this by turning of SH404SEF, then you will see the parameters. (Please do this on a test version of your website!)

I tested it (on our test server) with sh404SEF turned off, all cache cleared, but it still doesn't append the parameters at all.
Title: Re: Parameter search (dropdown)
Post by: korb on April 05, 2009, 02:23:30 am
There is a bugtracker on this: after performing a param search, no parameters in the link....
Title: Re: Parameter search (dropdown)
Post by: Marc O. on April 05, 2009, 09:30:54 am
OK, thanks for that info. We'll just have to wait a little while I guess.
Title: Re: Parameter search (dropdown)
Post by: Alt148 on April 06, 2009, 10:46:44 am
As far as I know, all the parameters are in the URL, since the form uses the GET method. I have to test it myself with SH404SEF, but my first idea is that SH404SEF takes out the parameters from the URL.

You can try this by turning of SH404SEF, then you will see the parameters. (Please do this on a test version of your website!)

I tested it (on our test server) with sh404SEF turned off, all cache cleared, but it still doesn't append the parameters at all.

Hi Marc. O,

Do you know a little basic PHP? If so I will attach my customized mod. and try to explain a little what I have done. I am not a programmer and know only a little PHP by myself.

Also your Database has to be altered a little bit to get it working in different languages. BTW, I am Dutch and I got the idea you're too. So if you send me an e-mail I can try to help you in Dutch, which is a little more practical to me.
Title: Re: Parameter search (dropdown)
Post by: Marc O. on April 06, 2009, 12:46:48 pm
Yes, I'm Dutch too ;-)

My PHP/MySQL knowledge is close to zero, but I don't mind trying to get it working (that's what test servers are for, right).

You've got mail: thanks for the offer!
Title: Re: Parameter search (dropdown)
Post by: Marc O. on April 06, 2009, 21:27:13 pm
As far as I know, all the parameters are in the URL, since the form uses the GET method.

See, there is the difference. In the version 0.7 (1st post in this topic) the POST method is used. When I change that to GET, the parameters are appended to the url. However it just looks like it's still doing something wrong here. This is what is added to my url (still on test server):
option=com_virtuemart&page=shop.browse&product_type_id=1&Itemid=1&product_type_1_Yacht_Type_comp=find_in_set&product_type_1_Yacht_Type=Crewed+Gulets&product_type_1_Yacht_Size_comp=find_in_set&product_type_1_Yacht_Size=&product_type_1_Charter_Destination_comp=find_in_set&product_type_1_Charter_Destination=&search=Search

Shouldn't it be possible to have it append the parameters and their values only and not the other "stuff"?
Title: Re: Parameter search (dropdown)
Post by: Marc O. on April 06, 2009, 21:28:59 pm
Oh, and it would be nice if it remembered the chosen values after pressing "Search".....
Title: Re: Parameter search (dropdown)
Post by: Alt148 on April 07, 2009, 11:50:57 am
Hi Marc,

Each type (Size, Type, Destination) needs two variables in the URL, the first represents the how it has to look in the array of the database, the other is what to find in that part. The 'find_in_set' tells Virtuemart he has to look for something in a serie (one of the multiple values), the other one is the 'something'.

When one of the parameters is missing in the URL, Virtuemart excludes all products in that product type.

The parameters are remembered untill the visitor chooses the 'product' (Detailed view). Then no information is placed anywhere. Maybe it is possible to place it in session, however at this moment, the module doesn't.

To experiment with this module, you can also play with the advanced search, product type tool of Vituemart itself. The module does almost do the same, just sending form variables to the URL.

If something isn't working as I described let me know. Always willing to help!  ;)
Title: Re: Parameter search (dropdown)
Post by: Marc O. on April 07, 2009, 21:29:38 pm
The parameters are remembered untill the visitor chooses the 'product' (Detailed view). Then no information is placed anywhere. Maybe it is possible to place it in session, however at this moment, the module doesn't.

Well, that's not the case for version 0.7 attached to the first post. After you press "Search", all pull down menus are being reset to the default entry.
Title: Re: Parameter search (dropdown)
Post by: Marc O. on April 19, 2009, 13:59:16 pm
For SEO reasons, I would like to have the selected filter criteria included in the resulting page titles. Right now, it only says "Browse", which doesn't really make sense for search engines. Is there an easy way to do that?
Title: Re: Parameter search (dropdown)
Post by: slakalot on July 08, 2009, 17:50:48 pm
Great module, thanks guys :)

I don't know if you are still working on it or not, but I am trying to get any help I can and am hoping someone might have an answer to my problem.

I have 2 categories for the exact same products. They use different flypages to show restricted documents to registered users and no documents to another level of user.

I want to run the module twice, once for each category on different pages. Therefore I want the results to display on the correct flypage.

Is there a way to restrict the search to a category so that the correct flypage is returned?

Cheers! And again thanks, this module was just what I needed.
Anita
Title: Re: Parameter search (dropdown)
Post by: VlaDo on December 03, 2009, 00:28:33 am
Is this project really cancelled ?


Title: Re: Parameter search (dropdown)
Post by: MikeUK on December 03, 2009, 08:34:21 am
Is this project really cancelled ?

Hi. I don't know if the original posters of this project are still involved, but a project is never canceled, and the success of a project depends if and how many people are still interested in it. Feel free to continue it.

Also thank you for highlighting that inappropriate post on the page before. It has been removed so it does not confuse others.
Title: Re: Parameter search (dropdown)
Post by: korb on December 03, 2009, 19:46:00 pm
This module with a little SQL querry improvements can be useful and can succesfully replace the old parameter search form..

I already posted in this thread some ideas regarding this.
Danny
Title: Re: Parameter search (dropdown)
Post by: nyamdavaa on April 29, 2010, 10:10:21 am
Hi Everybody,

I have modified the Search Dropdown from Cajetan Oberhaus a little. Now the module will first ask which Product Type group you want to search. And also it will remember which selections you have made.

However, I am not a professional programmer, and also not everything is working as it should be.

1. When you use a type with multiple values, there are no results.
2. I also blocking line 33 in browse_orderbyform.tpl.php in components/com_virtuemart/themes/(Your theme)/browse/includes/
"echo $ps_product_type->get_parameter_form($product_type_id);"
So the error lines are gone. (However I am not sure if it is the correct way)
3. I am also pretty sure, some code can be written better, easier!

I hope to get a good result when you select a type from the multiple values, however I am afraid that files in VM has to be altered, which I do not prefer to do.

Please I am interested in comments.

And thanks to Cajetan Oberhaus for the main part!

first thanks  all for this great module, i have download this module , but i got error
Parse error: parse error in D:\xampp\htdocs\ziozia1\modules\mod_virtuemart_search_dropdown\mod_virtuemart_search_dropdown.php  on line 189  ,,,  how can i fix this
Title: Re: Parameter search (dropdown)
Post by: tehribo on April 15, 2011, 12:00:40 pm
Please help.

I installed the module but when I choose the parameters, nothing changes and the page do not reload.

I am using "VirtueMart 1.1.0 stable" , because I did not find upgrade patch from this version :(

But I tried the modul to a clean Virtuemart installation with VirtueMart 1.1.7a stable
Title: Re: Parameter search (dropdown)
Post by: useris on June 10, 2011, 14:48:04 pm
Hi,

Can this module search in product_type table?
Title: Re: Parameter search (dropdown)
Post by: marius2k on August 23, 2011, 13:03:24 pm
hy!
how can i modify the dimension of the "multiple value" field? i want to make max. 10 caracters

br.
Title: Re: Parameter search (dropdown)
Post by: ganchclub on August 24, 2012, 00:29:27 am
Thanks a lot! All is working great!

Long time surfing, and at last.

Thanks!