Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Crazy Computer Builder Mod In the Making

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-11-2004, 04:58 PM
 
netcoweb netcoweb is offline
 

Advanced Member
  
Join Date: Oct 2002
Location: Bay Area, CA
Posts: 36
 

Default Crazy Computer Builder Mod In the Making

Probably not the best place to post, but here it is.

I'm trying to build a computer builder page that uses products in stock to build your own computer for my site. I want it to only display products that are compatible with other products. Say when I add a motherboard as a new product, i want to be able to say it accepts Socket A processors supports up to 3.2 ghz, 5 pci slots, agp 8x/4x, ddr 400/300 blah blah blah. Then it will populate the processor field with compatable processors, 5 different fileds for pci slots. Anyways i know this is a pretty easy task and that I can do it with querys which im not really good at. I just need to be pointed in the right direction. How would I go about doing querys to the database to find something like this:

Find all motherboards that support amd duron

DATA
-------------
AMD Athlon XP/Athlon/Duron
AMD Athlon/Duron
AMD Athlon XP/Duron
Intel P4

Then it would display:
AMD Athlon XP/Athlon/Duron
AMD Athlon/Duron
AMD Athlon XP/Duron

I'm not sure what to look for.

1 more question

In a form, how can i add new items on the fly without loosing all the data i already entered.

Say I'm entering all the specs for a motherboard and theres a new item athlon xp 64 bit, heres an example.

AMD
---------
0 Athlon XP
0 Athlon
0 Duron
Add Item:__________ Update

When i get to part where i dont have an option to check something, i want to be able to add it on the fly and check it and not loose all the data I entered above this part. I know i can do this with javascript but im not sure what function to look at. I've been out of the programming loop for a while so I need a little refreshing, well you can say a lot because it's pretty basic stuff. I got everything down on paper how i want it pretty much but little stuff like this keeps my mind in a loop as far as how to do it.

Thanks in advanced, any links or sample code would help.

Gabe
Reply With Quote
  #2  
Old 03-11-2004, 05:04 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

easy way to do it is to buy the product configurator mod from xcart.

It was designed to do exactly what your talking about
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 03-11-2004, 05:10 PM
 
netcoweb netcoweb is offline
 

Advanced Member
  
Join Date: Oct 2002
Location: Bay Area, CA
Posts: 36
 

Default

I didnt hear to many good things about that. Most people had no idea how to use it. I dont know if it has changed since the last time i checked it out. I'll have to go and look into that.

Thanks,
Gabe
Reply With Quote
  #4  
Old 03-11-2004, 05:44 PM
 
netcoweb netcoweb is offline
 

Advanced Member
  
Join Date: Oct 2002
Location: Bay Area, CA
Posts: 36
 

Default x-config

I checked it out and played with it for a bit and yeah it's pretty cool but for me to use something like that would take forever to just get 1 computer the way i want it on my site. That and it doesn't look like you can select products from your site and have it automatically enter all the data for you. It doesn't look like it would pull that item out of inventory either and for every item, you have to hit update. Actually after every little step, nothing is on the fly. It could be a good foundation and save me the time of getting to the part but i would have to chop most of it up. But thats what most of us x-carters do anyways.
Reply With Quote
  #5  
Old 03-11-2004, 10:16 PM
 
netcoweb netcoweb is offline
 

Advanced Member
  
Join Date: Oct 2002
Location: Bay Area, CA
Posts: 36
 

Default

I guess x-config does or might do what i want it to do but it looks to complicated. I figured out a way to do this through the extra fields module.

Extra Fields gives you a text box for field name and one for default value. I want to change the default value into a drop down menu and then under where it says Add extra field i want to add, Add extra value, There will be a dropdown menu to choose the field name you want to add to and then a text box for the value.

Is there a way that I can post the same field name multiple times with different values and then do a query for the field name and gather all the values into a combo box?

Here's what I got up to but I wouldn't know how to word it.

Code:
# # Get extra_fields # $extra_fields = func_query("select * from $sql_tbl[extra_fields] where 1 $provider_condition order by fieldid"); $smarty->assign("extra_fields", $extra_fields); $smarty->assign("main","extra_fields"); @include $xcart_dir."/modules/gold_display.php"; $smarty->display("provider/home.tpl");

it needs to be something like

SELECT * FROM extra_fields GROUP BY fieldname WHERE 1 $provider_condition ORDER BY fieldid

i dont know, help??

Thanks,
Gabe
Reply With Quote
  #6  
Old 03-12-2004, 11:07 AM
 
netcoweb netcoweb is offline
 

Advanced Member
  
Join Date: Oct 2002
Location: Bay Area, CA
Posts: 36
 

Default Shouldn't this work??

Shouldn't this work? The select box is empty and when i look at the html code the name comes up fine but the options dont come up at all.

I changed this:
Code:
<td> <input type=text name="extra_array[{$extra_fields[field].fieldid}][value]" size=24 value="{$extra_fields[field].value|escape:"htmlall"}"> </td>

To this:
Code:
<td> <select name="extra_array[{$extra_fields[field].fieldid}][value]"> <option value="{$extra_fields[field].value|escape:"htmlall"}"> {$extra_fields[field].value|escape:"htmlall"} </option> </select> </td>
Reply With Quote
  #7  
Old 03-12-2004, 01:36 PM
 
netcoweb netcoweb is offline
 

Advanced Member
  
Join Date: Oct 2002
Location: Bay Area, CA
Posts: 36
 

Default

Got the drop down to work finally, now i just need to find out how to combine the same fields and different values into the same drop down box... HELP

Code:
{sectionб═name=fieldб═loop=$extra_fields} <inputб═type=hiddenб═name="extra_array[{$extra_fields[field].fieldid}][active]"б═value="N"> <tr> б═б═б═<td><inputб═type=textб═name="extra_array[{$extra_fields[field].fieldid}][field]"б═size=24б═value="{$extra_fields[field].field|escape:"htmlall"}"></td>б═б═б═б═ б═б═б═б═<td> # # Drop down list # <selectб═name=extra_array[{$extra_fields[field].fieldid}][value]>{html_optionsб═values=$extra_fields[field].valueб═output=$extra_fields[field].value}б═selected="1" б═б═б═б═</td> <td><inputб═type=checkboxб═name="extra_array[{$extra_fields[field].fieldid}][active]"б═value="Y"б═{ifб═$extra_fields[field].activeб═eqб═"Y"}checked{/if}></td> <td><inputб═type=buttonб═value="Delete"б═onClick="self.location='extra_fields.php?mode=delete&fieldid={$extra_fields[field].fieldid}'"></td> </tr> {/section
[/code]
Reply With Quote
  #8  
Old 03-14-2004, 11:02 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Why re-invent the wheel?

Product Configurator once you get the hang of it is fairly easy to setup and use for your basic computer building setups.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:08 AM.

   

 
X-Cart forums © 2001-2020