Post by MounaOpenCart » Fri Jul 17, 2015 10:21 pm

I want to make 3 dependents drop down list, each drop down dependent to the previous drop down, so when I select an item from first drop down , all data fetch from database and add to second drop down as item. I know how to do this in a normal php page using ajax, but as opencart uses MVC I don't know how can I get the selected value
all i could do is
<script type="text/javascript"><!--
$('select[name=\'manufacturer\']').on('change', function() {
url = 'index.php?route=product/pdcompatible';

var manuf = $('select[name=manufacturer]').val();


});

</script>-->
if i do an alert(manuf) i get the value of it but how can I access to manuf 's var in my model in order to do something like :
public function getTypeCompatible2($manuf) {
$query = $this->db->query("SELECT distinct `type` FROM `oc_compatible` where `manufacturer` ='$manuf' ");
return $query->rows;

}

Newbie

Posts

Joined
Thu Jul 16, 2015 11:08 pm
Who is online

Users browsing this forum: No registered users and 9 guests