Osclass forums

Support forums => Tips, tricks, and tutorials => Topic started by: davidos68000 on March 08, 2015, 10:43:35 pm

Title: [SOLVED]call this function when the selection change
Post by: davidos68000 on March 08, 2015, 10:43:35 pm
Code Drop down categorie

Code: [Select]
<div class="row">
<?php osc_categories_select('sCategory'$category__('Select a category''spain')) ; ?>
</div>

So How we can call this function when the selection is change

this code call the attribu when we click Search (Submit bouton)

i need to call this function when the selection change


Code: [Select]
<?php
                
if(osc_search_category_id()) {
                    
osc_run_hook('search_form'osc_search_category_id()) ;
                } else {
                    
osc_run_hook('search_form') ;
                }
                
?>
</div>

Why we have to do this ??????

when i select category the attribut don't change only when i click applay (SubmiT bouton)

Exemple i isearch fo a car and i have the attribut to choose make, model,....

if i change the select to exemple dating, i still have the attribut for car, i have allaways to click applay for the attribut change

in the item-post.php it's good we just select and the attribut change

I want the same function for the search.php
Title: Re: call this function when the selection change
Post by: OPCAMO on March 09, 2015, 12:49:56 am
Sorry, I am having a hard time understanding what you are looking to do.  Are you have an issue with the category or the search?
Title: Re: call this function when the selection change
Post by: davidos68000 on March 09, 2015, 01:01:52 am
HELLO MY WEB SITE (test) http://plicos.com/ile-de-france-r781355 (http://plicos.com/ile-de-france-r781355)

Please help i have about 30 days  i looking for this

I have a select dropdown for category in Osclass (search.php)

when i select category the attribut don't change only when i click applay (Submit bouton)

Exemple i search for a car and i have the attribut to choose make, model,....

if i change the select to exemple dating, i still have the attribut for car, i have allaways to clic applay for the attribut change

it's not normal we imagine somebody look for a wommen and we ask him to choose model, mak...

in the item-post.php it's good we just select and the attribut change

I want the same function for the search.php  WHEN WE CHAGE THE SELECTION THE ATTRIBU CHAGE AUMATIC


So its simple go to my web site http://plicos.com/ile-de-france-r781355 (http://plicos.com/ile-de-france-r781355)
 choose a category you cant get the attribut if you don'click aplay (Submit bouton)
Title: Re: call this function when the selection change
Post by: davidos68000 on March 09, 2015, 01:07:13 am
i just want the same function like (item-post.php) http://plicos.com/item/new (http://plicos.com/item/new)

we  change the category automatc we have (plugin-hook)

i need this for (search.php) http://plicos.com/ile-de-france-r781355 (http://plicos.com/ile-de-france-r781355)
Title: Re: call this function when the selection change
Post by: fre2mansur on March 09, 2015, 11:21:11 am
Hi,

Default Osclass function if you go to search page with clicking category. custom fields of that categories will show.
ex if you go this link http://plicos.com/search/sOrder,dt_pub_date/iOrderType,desc/category,97 (http://plicos.com/search/sOrder,dt_pub_date/iOrderType,desc/category,97)
it will show. but if you are clicking location without category it will not be shown.

You cant make same as item-post.php. but you can with jquery on change function.
Title: Re: call this function when the selection change
Post by: davidos68000 on March 09, 2015, 07:29:35 pm
hi thanks for replay
can you send me the function for jquery and where i can put it
thank you
Title: Re: call this function when the selection change
Post by: davidos68000 on March 09, 2015, 08:54:05 pm
my code
can some body tell me how we make the function
to  get plugin-hooks when the selection change (with out click)
Code: [Select]
<?php osc_categories_select('sCategory'$category__('Select a category''spain')) ; ?>
</div>
<script>
$category = __get("category");
     if(!isset($category['pk_i_id']) ) {
         $category['pk_i_id'] = null;
     }
});
</script>

<div class="plugin-hooks">
            <?php
            
if(osc_search_category_id()) {
                
osc_run_hook('search_form'osc_search_category_id()) ;
            } else {
                
osc_run_hook('search_form') ;
            }
            
?>

something lik this but i don' now how to make it
Code: [Select]
$('------').change(function() {
help please :'( :'( :'( :'( :'( :'( :'(
Title: Re: call this function when the selection change
Post by: fre2mansur on March 10, 2015, 11:08:13 am
 osc_run_hook('search_form', osc_search_category_id()) ;
this code not working any way if you are not in current category.
but try this
<script>
$("select[name='sCategory']").change(function(){
    if($(this).val() == "Vechiles"){
        show Car attirbutes
//you must get car_form show here don't use hook function
    }
});
Title: Re: call this function when the selection change
Post by: davidos68000 on March 10, 2015, 12:57:50 pm
thank you for replay
but don't work
Title: Re: call this function when the selection change
Post by: davidos68000 on March 10, 2015, 01:24:24 pm
when i use
Code: [Select]
<?php
            
if(osc_search_category_id()) {
                
osc_run_hook('search_form'osc_search_category_id()) ;
            } else {
                
osc_run_hook('search_form') ;
            }
            
?>
if i click submit i have the attribu for the category selected, wat i'm looking for is (autosubmit) for this selcteor of category,
but i don'ont know how to do it for this
wich you can help me i'm getting crazy, 32days now i'm looking for this
Title: Re: call this function when the selection change
Post by: davidos68000 on March 10, 2015, 09:19:10 pm
THANKS FOR YOUR HELP
I FOUND IT BY MY SELF
Title: Re: call this function when the selection change
Post by: davidos68000 on March 10, 2015, 09:34:18 pm
thank you (fre2mansur)
i found it
Title: Re: call this function when the selection change
Post by: fre2mansur on March 10, 2015, 11:06:26 pm
Can you you show me how you solved and make this thered to solved  :)
Title: [SOLVED]Re: call this function when the selection change
Post by: davidos68000 on March 11, 2015, 12:45:04 am
so after 32 day th'as the Solution

in your search.php

Categorie selector
Code: [Select]
<div class="row">
<h6><?php _e('Category'); ?></h6>
<?php osc_categories_select('sCategory'$category__('Select a category''spain')) ; ?>
</div>
REMEMBER Categorie
Code: [Select]
<script>
$category = __get("category");
     if(!isset($category['pk_i_id']) ) {
         $category['pk_i_id'] = null;
     }
});
</script>
Run The  Hook
Code: [Select]
<div class="plugin-hooks">
            <?php
            
if(osc_search_category_id()) {
                
osc_run_hook('search_form'osc_search_category_id()) ;
            } else {
                
osc_run_hook('search_form') ;
            }
            
?>
And now you Go to your Theme/js/jquery.uniform.js
YOU ADD This in the END OF jquery.uniform.js
Code: [Select]
$(function() {
    $('#sCategory').change(function() {
        this.form.submit();
    });
});

sO THAT's all