Welcome, Guest. Please login or register.
Login with username, password and session length

Need help or want to talk to other developers? Join the VirtueMart Chat! Read more...

  Advanced search

247031 Posts in 67504 Topics- by 258313 Members - Latest Member: Matej.iStraxx
VirtueMart ForumVirtueMart 1.1.xAttributes, Child ProductsProduct type parameter name in search (custom browsepage)
Pages: [1]   Go Down
Author Topic: Product type parameter name in search (custom browsepage)  (Read 4998 times)
Full Member
Posts: 145

« on: June 14, 2011, 20:45:37 pm »

Hi everyone

I just found in the file /administrator/components/com_virtuemart/html/shop.parameter_search_form.php the comment which I think will say search plugin to look just in the specific product_type table and look for certain product parameter_name BUT I don't know where to use in which browsepage I should use it.
COuld you help me to setup it? I am not sure I should include it to my shop category browsepage or I should created HTML file?
Here is the comments fro mthe file:

** BrowsePage - You can use your tepmlate for searching:
** 1) write file with html table (without tags <table> and </table>) and 
**    take its name into variable browsepage in Product Type
** 2) You can use this page from tag <!-- Default list of parameters - BEGIN --> to
**    tag <!-- Default list of parameters - END --> and changed it.
** 3) tag {product_type_<product_type_id>_<parameter_name>} will be replaced input field, or select field
**    tag {product_type_<product_type_id>_<parameter_name>_comp} will be replaced comparison
**        for this parameter. It is important for correct SQL question.
**    tag {product_type_<product_type_id>_<parameter_name>_value} will be replaced value for this
**        parameter (when you click on button "Change Parametes" in Browse page).
if (!empty($browsepage)) { // show browsepage

I understand this field product_type_<product_type_id>_<parameter_name>_

Which browse page Product type search is using? I found this 'product_type_browsepage' => vmGet($d, 'product_type_browsepage'),
$browsepage = $db->f("product_type_browsepage");

But which file is that browsepage?  i don't know

Would be good to create Browsepage specially for product_type search
« Last Edit: June 14, 2011, 23:32:43 pm by useris » Logged
Full Member
Posts: 145

« Reply #1 on: June 15, 2011, 00:12:32 am »


I read the guide about product types http://virtuemart.net/documentation/User_Manual/Product_Types.html
and there is the text :
Some things you need to know about "Product Type Browse Page" and "Product Type Flypage". This assumes that you already have other, specific templates files for products assigned to Product Types. By default, category browse page layout is managed by "browse_1.php" file and product flypage layout is managed by "flypage.tpl.php" file, and both are good no matter if your products are assigned or not to a Product Type. In our case here, "Product Type Browse Page" is the one managing the layout when perform an Advanced Search According to Parameters.

I don't really understand what does it mean. Which browsepage I should use? Could it be browse_1 or browse_2? If yes, so I must customize it and insert tag {product_type_typex_<parameter_name>}

Right now when I try to make a search for product type in the index.php?option=com_virtuemart&page=shop.browse&Itemid=65&product_type_id=1 it will display dropdown boxes with all product type values.
But if I write anything in the "Product type browse page" field in the search all dropdown boxes are hided (not visible). This is very good but now search need to find proper product.
For ex. if I type 45.25 it should only find product which has 45.45 but not 46.12 (this is how it is now)
« Last Edit: June 15, 2011, 00:14:16 am by useris » Logged
Full Member
Posts: 145

« Reply #2 on: June 15, 2011, 10:23:32 am »

It seems that noone have done this or I am the only in the first one in this forum that need this function. I just want to search product types but without dropdown boxes. I am very close to find solution but I need to figure out which Browsepage to use nad how to add field product_type_<product_type_id>_<parameter_name>_ into it.
Global Moderator
Hero Member
Posts: 4741

« Reply #3 on: June 16, 2011, 16:27:14 pm »

useris IF you ONLY have a single product type you want them to search. YOU CAN
 modify the regular search for like this

<form action="index.php?page=shop.browse&amp;option=com_virtuemart" method="post">
<input type="hidden" value="<?php echo $product_type_id ?>" name="product_type_id">
global $VM_LANG, $mm_action_url, $sess;
$product_type_id = $params->get('product_type_id',0);

then mod_virtuemart_search.xml
add this
<param name="product_type_id" type="text" default="" label="Product Type Id" description="" />

THEN, publish the search module and put the product_type id in the module settings

"Banquet Tables Pro"
Pages: [1]   Go Up
Jump to: