Jump to content
jacksony

Search Configurable Options

Recommended Posts

Is there a way or SQL to search for that?

 

Eg. we want to search for a list of services which have the value of certain Configurable Option.

Share this post


Link to post
Share on other sites

SQL query:

SELECT `tblhosting`.id FROM `tblhosting` left join tblhostingconfigoptions on tblhosting.id = tblhostingconfigoptions.relid where tblhostingconfigoptions.id = 1;

Just replace the id for the configuration id you are interested in.  You can get that id via the configurable options editor's URL -- cid=1.

An addon module that grabs the configurable options and provides a search would be much easier.  For that you would use capsule:

$Services = DB::table('tblhosting')
            ->join('tblhostingconfigoptions', 'tblhosting.id', '=', 'tblhostingconfigoptions.relid')
            ->select('tblhosting.*', 'tblhostingconfigoptions.qty')
            ->where('tblhostingconfigoptions.id', 1)
            ->get();

And just replace the "1" with your module's search box input. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated