Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8715555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:52:28+00:00 2026-06-13T05:52:28+00:00

I am creating a custom ecommerce system for a client who sells custom grad

  • 0

I am creating a custom ecommerce system for a client who sells custom grad gear. I have the following screen shot of my product layout…

Ecom image

I have the form on the right side of the page that has a max price, colors and materials. When you click the Update options it sends all the data via jquery’s ajax function over to my codeigniter controller where i need to pull a new list of products with the options that they have selected and within the price range they have selected. I then pass the products array to a codeigniter view and return the view to the cart with the ajax success variable.

So I can get this working with just colors, or just materials, but my problem is figuring out how to pull a set of products that has all of the materials and options I need. I guess I just can’t wrap my brain around the best way to do it. I thought about pulling a list with the correct colors, then a list with the correct materials, then a list with the correct pricing and then deleting duplicates in a merged array, but it just doesn’t feel like thats the best way to do it.

This particular client only needs “color” and “material” as an option so my products table is set up to have the id of the color and the id of the material all in the products table. Then I have a colors and materials table with the id and the color or the id and the material.

What are you guys thoughts on the best way to do this? I’d like to use codeigniters active record to do the mysql stuff.

///// EDITS ///////////////////////////////////////

Here is an image of my product Tables:
product tables

Also, here is my jquery controlling the submit of data to the codeigniter controller:

//Filter Options Ajax

$(‘#updateOptions’).click(function(event) {

//Prevent the default href action
event.preventDefault();

var filterOptions = $('#filterForm').serialize();

//Get the site url
var siteUrl = $('#siteUrl').val();

//Roll up the product listing div and show a loader
$('div.products').slideUp( 500, 'easeInExpo' );
$('div.loader').delay(500).fadeIn();

//Get a new list of products and repopulate the information
$.ajax({
     type: "POST",
     url: siteUrl + "category/filterProducts",
     data: { filterOptions: filterOptions },
     success: function(data) {
        $('div.loader').fadeOut(500);
        $('div.products').html(data).delay(500).slideDown( 500, 'easeOutExpo' );
     } 
});

});

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:52:29+00:00Added an answer on June 13, 2026 at 5:52 am

    Something like this:

    if ($min_price = $this->input->get_post('min_price')) {
        $this->db->where('price <', $min_price);
    }
    

    Then the url prices.php?min_price=100 would add WHERE price < 100 to your query.

    For colors (I’m using | for a delimiter, but use what works for you):

    if ($colors = $this->input->get_post('colors')) {
        $colors = explode($colors, '|');
        $this->db->where_in('color', $colors);
    }
    

    Then the url prices.php?min_price=100&colors=red|blue will add

    WHERE price < 100 AND color IN ('red', 'blue')
    

    If you are posting your colors using an array (checkboxes) try this:

    if ($colors = $this->input->post('colors')) {
        $this->db->where_in('color', $colors);
    } elseif ($colors = $this->input->get('colors')) {
        $colors = explode($colors, '|');
        $this->db->where_in('color', $colors);
    }
    

    This lets you use the url or the POST to add your colors, depending on how you’re doing things.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating custom UserControl in ASP.NET and I'm using System.ComponentModel.Attributes to decorate properties with
I have mastered creating custom data types and adding fields with CCK. Then I
I am creating custom membership provider for my asp.net application. I have also created
I am creating a custom module for a Magento ecommerce site, and the module
I've been following the Documentation on creating custom form types given in the docs:
So I followed the following tutorial on creating custom views associated with device orientations:
I'm learning about creating custom routes in ASP.NET MVC and have hit a brick
I've been following this guide on creating custom display attributes (specifically extra html attributes)
I have a Rails blog using friendly_id for creating custom urls. The blog has
Creating custom IHttpModules, I have realized that the requests for static files (e.g.: .css

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.