Zen Cart Logo
Forums / All Other Contributions/Addons / PC Configurator Module [Support Thread]

PC Configurator Module [Support Thread]

Views: 87,214

Results 1 to 20 of 255
10 Jul 2007, 1:02 PM
#1
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

PC Configurator Module [Support Thread]

DOWNLOAD LINK:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=667

Dear all,

I started a new module to create a pc configurator for ZEN CART.

For the start it is going nice but I need help.

I made a file to make some queries and all options are tracked automatically from database.

I is not yet done but you can see a sample here

http://www.lebrand.gr/eshop/index.php?main_page=page_4

Prices change automatically and a product link is provided if you want to see details of the product you choosed.

TRY THE FIRST OPTION TO SEE

If some one thinks he can help please inform me

I am thinking the possibility to make a product with 0 price.

As you can see, prices are being changed automatically with java script

Maybe there could be a way to change products price, and add it to the cart so it can be a normal order procedure.

I include all files I made till now.

10 Jul 2007, 3:24 PM
#2
shopyoungway avatar

shopyoungway

New Zenner

Join Date:
Jul 2005
Posts:
53
Plugin Contributions:
0

Re: PC Configurator Module [Support Thread]

hey great start to this im not that great with certain parts but do have good friends so let see what happens will keep in touch with you on this.

13 Jul 2007, 3:10 PM
#3
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Dear all,

Because of the reason that nobody seems to be interested, I decided to make this module with other way.

Below is a description of the project.

Well, after pc configurator form is complete, I make a post to post.php

There I assign all form values to variables :

$case = $_POST[cpc];
$case_price = $_POST[cpc_price];
$mobo_intel = $_POST[motherboard_intel];
$mobo_intel_price = $_POST[motherboard_intel_price];
$mobo_amd = $_POST[motherboard_amd];
$mobo_amd_price = $_POST[motherboard_amd_price];
$cpu_intel = $_POST[cpu_intel];
$cpu_intel_price = $_POST[cpu_intel_price];
$cpu_amd = $_POST[cpu_amd];
$cpu_amd_price = $_POST[cpu_amd_price];
$ram1 = $_POST[ram1];
$ram1_price = $_POST[ram1_price];
$ram2 = $_POST[ram2];
$ram2_price = $_POST[ram2_price];
$graphics_card = $_POST[graphics_card];
$graphics_card_price = $_POST[graphics_card_price];
$floppy_disk_drive = $_POST[floppy_disk_drive];
$floppy_disk_drive_price = $_POST[floppy_disk_drive_price];
$hard_disk_drive1 = $_POST[hard_disk_drive1];
$hard_disk_drive1_price = $_POST[hard_disk_drive1_price];
$hard_disk_drive2 = $_POST[hard_disk_drive2];
$hard_disk_drive2_price = $_POST[hard_disk_drive2_price];
$cd_rom_drive = $_POST[cd_rom_drive];
$cd_rom_drive_price = $_POST[cd_rom_drive_price];
$dvd_writer_drive = $_POST[dvd_writer_drive];
$dvd_writer_drive_price = $_POST[dvd_writer_drive_price];
$keyboard = $_POST[keyboard];
$keyboard_price = $_POST[keyboard_price];
$keyboard_set = $_POST[keyboard_set];
$keyboard_set_price = $_POST[keyboard_set_price];
$mouse = $_POST[mouse];
$mouse_price = $_POST[mouse_price];
$display_monitor = $_POST[display_monitor];
$display_monitor_price = $_POST[display_monitor_price];
$sound_card = $_POST[sound_card];
$sound_card_price = $_POST[sound_card_price];
$speakers = $_POST[speakers];
$speakers_price = $_POST[speakers_price];
$modem_fax = $_POST[modem_fax];
$modem_fax_price = $_POST[modem_fax_price];
$operating_system = $_POST[operating_system];
$operating_system_price = $_POST[operating_system_price];
$power_supply_unit = $_POST[power_supply_unit];
$power_supply_unit_price = $_POST[power_supply_unit_price];
$printer = $_POST[printer];
$printer_price = $_POST[printer_price];
$scanner = $_POST[scanner];
$scanner_price = $_POST[scanner_price];
$software_applications = $_POST[software_applications];
$software_applications_price = $_POST[software_applications_price];
$extra_parts = $_POST[extra_parts];
$extra_parts_price = $_POST[extra_parts_price];
$services_and_internet = $_POST[services_and_internet];
$services_and_internet_price = $_POST[services_and_internet_price];
$extra_options = $_POST[extra_options];
$extra_options_price = $_POST[extra_options_price];

$netprice = $_POST[netprice];
$totalprice = $_POST[totalpricegross];

I am now thinking to assign all product details variables to one variable.

Who can help in this ? I started with an array to assign all variables to one. Is this the right way ?

I also have assigned netprice and total price in variables.

My purpose is to prepare all variables needed, just when I put the data for a new product in admin/products.

So, from the posted form, I just can take all values that has to do with products details and assign them to a variable so later I can use it as PRODUCTS DESCRIPTION to insert it in the DATA BASE.

I also have netprice and totalprice values assigned to variables to use them for the same purpose.

What I have to do now is to assign specific values to all variables I need when I insert a new product to the DATABASE. This is very easy to do even for me who started PHP recently.

So, you may wonder how this is going to work ?

DID YOU EVER THINK THAT CUSTOMERS CAN CREATE PRODUCTS FOR YOU ?

SOME EASY STEPS :

  1. PC Configurator form is populated automatically with products that exists in our database.

  2. We POST the form to a file.php to gather the required information for product details and price to assign their values to specific variables and we also write some code in the file.php to assign spesific values to specific variables, those we need just when we insert a new product in the database.

  3. In the file.php we have prepared all needed variables. Now we present the product that our customer constructed in a good looking table and we PROVIDE a button; The MAGIC button. When customer press it, this constructed product is inserted into the database, in a specific category we had previously specified with variable, with specific image......and so on. Now we must REDIRECT our customer to HIS OWN CREATED PRODUCT because HE WANTS TO BUY IT. Now I am thinking that if I query the database for the last product id, to redirect the customer to his product, maybe someone else, almost the same time has created another product. So this will confuse the customer. So, to redirect the customer for sure to his product, we must add a new field to the database which could be a name or something else that customer provides in the PC Configurator form. Well if customer is logged in NO PROBLEM.

  4. Customer is now seeing his product in our shop and he is ready to order. So this way, customer buys what he wants and also creates products in our database. To improve this, we can assign a KEY VALUE to a variable for a specific PC Configuration Product so it is not imported twice in our database in the case that customer did not see this product and tried to create it again.

The bad is that products and prices change. The good is that our form is being populated automatically with products and prices.

But what about older products that customers had created and parts and prices changed ? Are we going to delete from database ?

Well, I am waiting for your opinion. I am sure that many of you could write that code in an hour, but in my opinion the point here is if you find this idea workable or if you have something else in mind so this module can be improved before I start writing the code.

Thank you all.

13 Jul 2007, 3:22 PM
#4
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Dear all,

Because of the reason that nobody seems to be interested, I decided to make this module with other way.

Below is a description of the project.

Well, after pc configurator form is complete, I make a post to post.php

There I assign all form values to variables :

$case = $_POST[cpc];
$case_price = $_POST[cpc_price];
$mobo_intel = $_POST[motherboard_intel];
$mobo_intel_price = $_POST[motherboard_intel_price];
$mobo_amd = $_POST[motherboard_amd];
$mobo_amd_price = $_POST[motherboard_amd_price];
$cpu_intel = $_POST[cpu_intel];
$cpu_intel_price = $_POST[cpu_intel_price];
$cpu_amd = $_POST[cpu_amd];
$cpu_amd_price = $_POST[cpu_amd_price];
$ram1 = $_POST[ram1];
$ram1_price = $_POST[ram1_price];
$ram2 = $_POST[ram2];
$ram2_price = $_POST[ram2_price];
$graphics_card = $_POST[graphics_card];
$graphics_card_price = $_POST[graphics_card_price];
$floppy_disk_drive = $_POST[floppy_disk_drive];
$floppy_disk_drive_price = $_POST[floppy_disk_drive_price];
$hard_disk_drive1 = $_POST[hard_disk_drive1];
$hard_disk_drive1_price = $_POST[hard_disk_drive1_price];
$hard_disk_drive2 = $_POST[hard_disk_drive2];
$hard_disk_drive2_price = $_POST[hard_disk_drive2_price];
$cd_rom_drive = $_POST[cd_rom_drive];
$cd_rom_drive_price = $_POST[cd_rom_drive_price];
$dvd_writer_drive = $_POST[dvd_writer_drive];
$dvd_writer_drive_price = $_POST[dvd_writer_drive_price];
$keyboard = $_POST[keyboard];
$keyboard_price = $_POST[keyboard_price];
$keyboard_set = $_POST[keyboard_set];
$keyboard_set_price = $_POST[keyboard_set_price];
$mouse = $_POST[mouse];
$mouse_price = $_POST[mouse_price];
$display_monitor = $_POST[display_monitor];
$display_monitor_price = $_POST[display_monitor_price];
$sound_card = $_POST[sound_card];
$sound_card_price = $_POST[sound_card_price];
$speakers = $_POST[speakers];
$speakers_price = $_POST[speakers_price];
$modem_fax = $_POST[modem_fax];
$modem_fax_price = $_POST[modem_fax_price];
$operating_system = $_POST[operating_system];
$operating_system_price = $_POST[operating_system_price];
$power_supply_unit = $_POST[power_supply_unit];
$power_supply_unit_price = $_POST[power_supply_unit_price];
$printer = $_POST[printer];
$printer_price = $_POST[printer_price];
$scanner = $_POST[scanner];
$scanner_price = $_POST[scanner_price];
$software_applications = $_POST[software_applications];
$software_applications_price = $_POST[software_applications_price];
$extra_parts = $_POST[extra_parts];
$extra_parts_price = $_POST[extra_parts_price];
$services_and_internet = $_POST[services_and_internet];
$services_and_internet_price = $_POST[services_and_internet_price];
$extra_options = $_POST[extra_options];
$extra_options_price = $_POST[extra_options_price];

$netprice = $_POST[netprice];
$totalprice = $_POST[totalpricegross];

I am now thinking to assign all product details variables to one variable.

Who can help in this ? I started with an array to assign all variables to one. Is this the right way ?

I also have assigned netprice and total price in variables.

My purpose is to prepare all variables needed, just when I put the data for a new product in admin/products.

So, from the posted form, I just can take all values that has to do with products details and assign them to a variable so later I can use it as PRODUCTS DESCRIPTION to insert it in the DATA BASE.

I also have netprice and totalprice values assigned to variables to use them for the same purpose.

What I have to do now is to assign specific values to all variables I need when I insert a new product to the DATABASE. This is very easy to do even for me who started PHP recently.

So, you may wonder how this is going to work ?

DID YOU EVER THINK THAT CUSTOMERS CAN CREATE PRODUCTS FOR YOU ?

SOME EASY STEPS :

  1. PC Configurator form is populated automatically with products that exists in our database.

  2. We POST the form to a file.php to gather the required information for product details and price to assign their values to specific variables and we also write some code in the file.php to assign spesific values to specific variables, those we need just when we insert a new product in the database.

  3. In the file.php we have prepared all needed variables. Now we present the product that our customer constructed in a good looking table and we PROVIDE a button; The MAGIC button. When customer press it, this constructed product is inserted into the database, in a specific category we had previously specified with variable, with specific image......and so on. Now we must REDIRECT our customer to HIS OWN CREATED PRODUCT because HE WANTS TO BUY IT. Now I am thinking that if I query the database for the last product id, to redirect the customer to his product, maybe someone else, almost the same time has created another product. So this will confuse the customer. So, to redirect the customer for sure to his product, we must add a new field to the database which could be a name or something else that customer provides in the PC Configurator form. Well if customer is logged in NO PROBLEM.

  4. Customer is now seeing his product in our shop and he is ready to order. So this way, customer buys what he wants and also creates products in our database. To improve this, we can assign a KEY VALUE to a variable for a specific PC Configuration Product so it is not imported twice in our database in the case that customer did not see this product and tried to create it again.

The bad is that products and prices change. The good is that our form is being populated automatically with products and prices.

But what about older products that customers had created and parts and prices changed ? Are we going to delete from database ?

Well, I am waiting for your opinion. I am sure that many of you could write that code in an hour, but in my opinion the point here is if you find this idea workable or if you have something else in mind so this module can be improved before I start writing the code.

Thank you all.

16 Jul 2007, 3:55 PM
#5
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

The new module is being developed very fast and there are many changes.

I include a zip file if somebody wants to see what is going on.

16 Jul 2007, 5:06 PM
#6
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: PC Configurator Module [Support Thread]

lebrand2006:

The new module is being developed very fast and there are many changes.

I include a zip file if somebody wants to see what is going on.
No readme/instructions in download..so where do files go in a zencart install??
:blink:

17 Jul 2007, 7:36 PM
#7
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Dear friends,

This is a complete new module I managed to write from the start.

Now Zen Cart, have it's OWN Pc Configurator !!!!

Just a few lines of code missing for the distribution to be done.

This is the first Version. Many version will come, based on your ideas.

So if you have any suggestions, please POST it here.

Well, you can try it here :

http://www.lebrand.gr/eshop/index.php?main_page=page_4

  1. Create a custom pc, then press "Επόμενο - Next" button

  2. Now your configuration will be presented to you. Press "Επόμενο - Next" link

  3. In the last page your product has been created and added to the shop database.

Only some lines of code, and you will be directly redirected to the product's info page !!!

If you want to see the product you just created, go to :

http://www.lebrand.gr/eshop/index.php?main_page=index&cPath=183

On the next few days, I will develop it to be ready.

Then there will be some testing period to fix some bugs ( if we find ) and then I will upload it to downloads will complete instructions.

Have in mind that it is working on 1.3.X.X

You should also install quick updates, to be more easier because a new column is created in TABLE PRODUCTS DESCRIPTION and it can be updated automatically with the modified quick updates I made.

Have fun

18 Jul 2007, 2:12 AM
#8
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Hi Misty.

I managed to make this module work just today. Many things have to be done. I will be testing it for 5-10 days to fix some bugs and make it better and then I will post here first , the first version for crash test.

When all things go well, then I will upload it to downloads.

Does anybody know any function to produce uniq numbers based on a limited value, like 99.999.999.999 ?

I want to use it to produce a serial number for each custom pc. Now I use the session id without letters combined with floored price to produce a serial number.

But if session id remains the same, this is not good, so I need a function like this.

As for instructions, I will make it detailed and I will post it here latter with all needed files and modifications.

18 Jul 2007, 2:21 AM
#9
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Just forgot to upload what has been done!!

There are no instructions in the zip file but there is all code used.

Also I inluded 2 nice pictures , one for Intel PC and one for AMD PC.

18 Jul 2007, 3:10 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: PC Configurator Module [Support Thread]

lebrand2006:

Does anybody know any function to produce uniq numbers based on a limited value, like 99.999.999.999 ?

I want to use it to produce a serial number for each custom pc. Now I use the session id without letters combined with floored price to produce a serial number.

But if session id remains the same, this is not good, so I need a function like this.

I might be inclined to start with a call to the zen_create_random_value() function, specify whether you alpha, numeric, or mixed, and maybe combine that with some other value, such as microtime or something. Then store the generated number in a new database table for comparison purposes and compare ... just to be sure no duplicates are ever generated.

18 Jul 2007, 8:09 AM
#11
miweb avatar

miweb

New Zenner

Join Date:
Jul 2007
Posts:
31
Plugin Contributions:
0

Re: PC Configurator Module [Support Thread]

looking forward!!!!! I just need this kind of module :clap:

18 Jul 2007, 3:29 PM
#12
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Dear all,

Many things have to be done.

Today I will prepare the following :

  1. Full configuration screen in Admin area

In PC Configuration Screen, there are 28 fields that can carry option names and values.

So in configuration screen in Admin area we should give the option so we can select one by one which fields to activate and also select a name.

So if we only activate 3 fields "Computer Cases", "Motherboards" and "Proccesors" then in the PC Configuration Screen in the shop, there will only be presented these 3 fields on the table and their option names and values.

I am also thinking that there could be some modifications in products and configuration TABLES and also in products.php and configuration.php files in order that we could be able to group specific products to be presented as option names where we want it, combined with configuration settings so everyone can be able to configure all options and values based on his needs.

Because this could take some more time, and maybe somebody else have better ideas PLEASE post any ideas here so we can make this module better from the start and allow more users use it based on their needs.

  1. Change the function which creates the Products Serial Number

Products Serial Number was being created, cleaning the session id from letters and combine it with the floored price of the product.

This could cause problems, when somebody tries to make another PC Configuration.

The new function will create a unique Products Serial Number, which will be assigned to a session variable and also inserted in the database.

So this way we can easily call and present the product which our customer last created.

  1. Change the way that we create products id

Because of the reason of the above change, there is no need to produce products id.

So products id will be normaly auto increment as usually.

  1. Prepare the code for a new template for selected product presentation.

When customer selects a product in PC Configurator, this product is automatically linked with Java Script .

This link is presented on the right side of the selection.

When customer follow it ( press it ) a pop up window open to show the product.

Actually the URL is based on products id and the template page is Product Info Page.

But our customer only wants to see product details.

So we should prepare a new template for this purpose, so the pop up window only shows product details and nothing more.

This is for today.

PLEASE, IF SOMEBODY HAVE NEW IDEAS

POST it here, so we can develop this module for everyone's needs.

Thank you all in advance.

18 Jul 2007, 7:12 PM
#13
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Admin Configuration Screen for PC Configurator - Version 1 is ready.

There are 28 Options where you can select what product group to display for every field on PC Configurator on the shop.

This is also usefull to set the sort order of display.

So PC Configurator fields on the shop will be exactly ordered as you see it in Admin area and they will also hold option names based on what product group you have selected for each one.

Version 1.1 will have more options to Configure some other values needed for PC Configurator, instead of configuring these values in the "pc_configurator_defines.php" file.

Well for now, this is something you can install in your shop and try it.

Wait for more soon.

18 Jul 2007, 7:23 PM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: PC Configurator Module [Support Thread]

This mod will make a lot of people very happy, and I hope some who have use for it will post their ideas here too. When stable, I expect the code could be modified for other similar purposes also.

Good work so far!

18 Jul 2007, 10:57 PM
#15
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Dear all,

Forgive me; this is going a little bit slow but please have in mind that even my ideas work, I am a new learner of PHP, SQL and JAVA SCRIPT so I am reading and writing code at the same time. I believe that if I could explain what exactly my idea is this would be a lot easier for someone else to write the code. But please let me try. I think I am in a good way. As for my English, I hope you understand me !!!

I am still writing code from the morning ( now here is night 01:07 )

After the Admin Configuration Screen I have prepared new SQL Patches to insert the right structure for PC Configurator Master Category with its subcategories.

So this way we will track with a safe way all products from a category, to assocciate them with a drop down list.

Also , based on Configuration in Admin area we will construct the PC Configurator table. See below how this happens :

Inside every <TR> </TR> on our table we hold 2 <TD>

The first <TD> holds the drop down list with products and products information link and the second <TD> holds the price of selected product.

Well in this module, we use 28 fields ( <TR> ) to show the customer the Options.

PC Configurator table will be constructed automatically, based on what product groups we have activated.

I tested the following and it is working good.

Bellow it is not all the code I describe but only one query to SHOW or NOT the first <TR>

<?php /* Here we query to find IF the FIRST product group is ACTIVATED and what products should be listed in this drop down list, based on our selection in Admin->Pc Configurator. IF this product group is not activated, and has the value "off" we do not present the first <TR> at all. Also with this way, we assocciate the value of products group name we have selected to the SELECTED item in the drop down list. So if we have selected "Computer Cases" for the first product group, the first OPTION will have SELECTED the name "Computer Cases" and the drop down list will contain all products inside the category "Computer Cases" we have created before. */ $check_configuration_value_1 = $db->Execute (" select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key= 'PRODUCTS_GROUP_PC_CONFIGURATOR_1' "); $configuration_value_1 = $check_configuration_value_1->fields['configuration_value']; if( $configuration_value_1 != "off" ) { ?>

HERE IS THE FIRST <TR> which actualy holds 2 <TD>

In the first <TD> we show our drop down list and products link.

The second <TD> holds the selected product's price.

If we have not activated the first product group , content in this area will not be presented at all.

This way our PC Configurator Table in shop is constructed automatically, based on our selections.

<?php } ?>

Sorry for writing down all this, but maybe this would be helpfull for other learners and even give some new ideas.

Well, next to come is to prepare and test code to create the drop down list.

This list should hold Products Name and Price.

The OLD QUERIES I have made is not the right way.

In the old way there were LIMITS on how many products to show on the drop down list. Actually a part of these queries was made to select my shop's products based on their ORDER !!!!

Now, with the new way, this module will be completely independable.

I will be back soon !!!

19 Jul 2007, 3:37 AM
#16
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Dear all,

I fixed the problem with UNIQUE serial number when a customer creates a new Custom PC.

As DrByte suggested I made a new DATABASE TABLE :

CREATE TABLE serials (
serial_id int(11) NOT NULL auto_increment,
serial_number varchar(128) NOT NULL default '',
PRIMARY KEY (serial_id)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

Then we use the following code to create a serial number and check if it is UNIQUE.

If query result = created serial number, then our page reload until the serial number is UNIQUE.

// If you want to test if this code working just comment $serial_number = md5(uniqid(rand(), true));
// and uncoment $serial_number = '5' ;
// Then you will notice that the page where you put this code will be ALLWAYS reloading !!!
// because serial number "58ffj63g9c6ds56gfd45ghd4ghds56gfsa326" exist on the data base

// CREATES THE SERIAL NUMBER
$serial_number = md5(uniqid(rand(), true));

//$serial_number = '58ffj63g9c6ds56gfd45ghd4ghds56gfsa326' ;

//CHECK TO SEE IF CREATED SERIAL NUMBER EXISTS ON THE DATABASE
$check_serial = "SELECT serial_number
FROM " . TABLE_SERIALS . "
WHERE serial_number = '" . $serial_number . "'";

$serial_execute = $db->Execute($check_serial);

$serial_result = $serial_execute->fields['serial_number'];

//IF NUMBER EXISTS PAGE RELOAD AND A NEW SERIAL NUMBER IS CREATED
if($serial_result != "" ) { ?>

<SCRIPT language=Javascript> window.location.reload( true ); </SCRIPT> <?php // IF NUMBER DOES NOT EXIST IT IS INSERTED IN DATABASE AS A UNIQUE NUMBER }else{ $productserial = $serial_number; //echo $productserial; $db->Execute("INSERT INTO " . TABLE_SERIALS . " (serial_number) VALUES ('" . $productserial . "')"); }

Many thanks to DrByte for the idea of creatingr a new DATABASE TABLE

As we talk about RELOADING I would love to share the MATRIX RELOADED swf I use on my website https://www.lebrand.gr

Waiting for new suggestions

19 Jul 2007, 4:29 AM
#17
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Patches for Creating Master Category and Subcategories for PC Configurator are ready.

This way we produce the Structure for Our Master category and all subcategories where we will place our products.

If there are products already in the database we can link them or duplicate them to the category we want or also use the module quick updates to change massively many product's categories in seconds.

Well, when time comes will can solve this issue easily.

Below is the SQL Patches :

INSERT INTO categories VALUES (28100, '', 0, 0, now(), now(), 1);
INSERT INTO categories_description VALUES (28100, 1, 'PC Configurator Options', '');

INSERT INTO categories VALUES (28101, '', 28100, 1, now(), now(), 1);
INSERT INTO categories_description VALUES (28101, 1, 'Computer Case', '');

INSERT INTO categories VALUES (28128, '', 28100, 28, now(), now(), 1);
INSERT INTO categories_description VALUES (28128, 1, 'Power Supply', '');

INSERT INTO categories VALUES (28102, '', 28100, 2, now(), now(), 1);
INSERT INTO categories_description VALUES (28102, 1, 'Intel Motherboard', '');

INSERT INTO categories VALUES (28103, '', 28100, 3, now(), now(), 1);
INSERT INTO categories_description VALUES (28103, 1, 'AMD Motherboard', '');

INSERT INTO categories VALUES (28104, '', 28100, 4, now(), now(), 1);
INSERT INTO categories_description VALUES (28104, 1, 'Intel Proccesor', '');

INSERT INTO categories VALUES (28105, '', 28100, 5, now(), now(), 1);
INSERT INTO categories_description VALUES (28105, 1, 'AMD Proccesor', '');

INSERT INTO categories VALUES (28106, '', 28100, 6, now(), now(), 1);
INSERT INTO categories_description VALUES (28106, 1, 'Ram Memory', '');

INSERT INTO categories VALUES (28107, '', 28100, 7, now(), now(), 1);
INSERT INTO categories_description VALUES (28107, 1, 'Extra Ram Memory', '');

INSERT INTO categories VALUES (28108, '', 28100, 8, now(), now(), 1);
INSERT INTO categories_description VALUES (28108, 1, 'Hard Disk Drive', '');

INSERT INTO categories VALUES (28109, '', 28100, 9, now(), now(), 1);
INSERT INTO categories_description VALUES (28109, 1, 'Extra Hard Disk Drive', '');

INSERT INTO categories VALUES (28110, '', 28100, 10, now(), now(), 1);
INSERT INTO categories_description VALUES (28110, 1, 'Graphics Card - VGA', '');

INSERT INTO categories VALUES (28111, '', 28100, 11, now(), now(), 1);
INSERT INTO categories_description VALUES (28111, 1, 'Floppy Disk Drive', '');

INSERT INTO categories VALUES (28112, '', 28100, 12, now(), now(), 1);
INSERT INTO categories_description VALUES (28112, 1, 'CD ROM - DVD ROM', '');

INSERT INTO categories VALUES (28113, '', 28100, 13, now(), now(), 1);
INSERT INTO categories_description VALUES (28113, 1, 'DVD RW - CD ROM', '');

INSERT INTO categories VALUES (28114, '', 28100, 14, now(), now(), 1);
INSERT INTO categories_description VALUES (28114, 1, 'Modem - Fax', '');

INSERT INTO categories VALUES (28115, '', 28100, 15, now(), now(), 1);
INSERT INTO categories_description VALUES (28115, 1, 'Extra PC Parts', '');

INSERT INTO categories VALUES (28116, '', 28100, 16, now(), now(), 1);
INSERT INTO categories_description VALUES (28116, 1, 'Other Extra Options', '');

INSERT INTO categories VALUES (28117, '', 28100, 17, now(), now(), 1);
INSERT INTO categories_description VALUES (28117, 1, 'Keyboard + Mouse SET', '');

INSERT INTO categories VALUES (28118, '', 28100, 18, now(), now(), 1);
INSERT INTO categories_description VALUES (28118, 1, 'Keyboard', '');

INSERT INTO categories VALUES (28119, '', 28100, 19, now(), now(), 1);
INSERT INTO categories_description VALUES (28119, 1, 'Mouse', '');

INSERT INTO categories VALUES (28120, '', 28100, 20, now(), now(), 1);
INSERT INTO categories_description VALUES (28120, 1, 'Sound Card', '');

INSERT INTO categories VALUES (28121, '', 28100, 21, now(), now(), 1);
INSERT INTO categories_description VALUES (28121, 1, 'Speakers', '');

INSERT INTO categories VALUES (28122, '', 28100, 22, now(), now(), 1);
INSERT INTO categories_description VALUES (28122, 1, 'Display Monitor', '');

INSERT INTO categories VALUES (28123, '', 28100, 23, now(), now(), 1);
INSERT INTO categories_description VALUES (28123, 1, 'Operating System', '');

INSERT INTO categories VALUES (28124, '', 28100, 24, now(), now(), 1);
INSERT INTO categories_description VALUES (28124, 1, 'Printer', '');

INSERT INTO categories VALUES (28125, '', 28100, 25, now(), now(), 1);
INSERT INTO categories_description VALUES (28125, 1, 'Scanner', '');

INSERT INTO categories VALUES (28126, '', 28100, 26, now(), now(), 1);
INSERT INTO categories_description VALUES (28126, 1, 'Software/Applications', '');

INSERT INTO categories VALUES (28127, '', 28100, 27, now(), now(), 1);
INSERT INTO categories_description VALUES (28127, 1, 'Support Services/Internet Services', '');

19 Jul 2007, 10:29 AM
#18
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

I wrote the code to query the database to gather all values ( actually categories names ) .

A file is included in the first screen to run all queries.

Then table is automatically created, based on your selections in Admin->Configuration-> PC Configurator.

It is working fine so far.

We also use selected values to display the selected names on option names.

http://www.lebrand.gr/eshop/index.php?main_page=page_4

This screen is created automatically now !!!

Now we will procced to query for every categories products to assocciated it with option names, based on our selections in configuration.

As you can see I use page_4 - page_3 and page_2.

It would be very nice if someone help to create 3-4 new pages for pc_configurator.php

I am also thinking for extra configuration values even if this module is not yet done. It would be easily customizable even for other products configuration; not only computers.

So I am waiting for your suggestions If you have any.

Thank you all in advance

23 Jul 2007, 12:43 AM
#19
lebrand2006 avatar

lebrand2006

Zen Follower

Join Date:
Apr 2006
Location:
City Drama in Greece
Posts:
158
Plugin Contributions:
3

Re: PC Configurator Module [Support Thread]

Dear all,

Pc Configurator is developing quite fast.

Some changes has been made to 3 files in Admin, collect_info.php, update_product.php and copy_to_confirm.php.

These changes has to do with the new column in products_description which is description_categories_id.

So this new column has been created

ALTER TABLE products_description ADD COLUMN description_categories_id int(11) NOT NULL default '0' AFTER products_id;

for more flexibility in queries.

The queries for products in specific categories, so they can be presented on <selects> based on the configuration in admin->Pc Configurator.

As I am new in PHP, JAVASCRIPT, AJAX, SQL I took my time to read more and search deeper in Zen Cart and generaly in the above languages.

So new ideas came, as for compatibility check when someone configures a computer and some of them are under construction.

As for writing code for queries, more and more complex ( actualy I understand most of it but writing so complex is not so easy in the start - most times I copy-paste what I need and/or modify ) I am trying to find a good way to loop in a specific category, query all of it's products and put it in an array(?) to present it in an <OPTION> in the shop where <OPTION>(S) is where customers configure their computer.

Well, I found plenty of them in Zen Cart, and also on the net, but I suppose I better use code from Zen Cart . It is doing all the job !!!

Next days I am going to start testing which of...let's call them "subs" [ queries ]
I am going to use.

Please if someone have in mind a good way to loop through a category, select all of it's products and present it on a <SELECT> , would be nice to inform me.

Another issue I mentioned above is about compatibility when configuring a computer.

I was thinking of using some AJAX as our main PC Configurator page loads once
and we are in the need of presenting specific items [pc_parts] based on customer's selection, as one of them is when customer select Motherboard we should present only compatible proccesors and so on.

I am thinking about adding some new fields in admin/includes/modules/product/collect_info.php (I have already added one hidden field which is 'description_caterogies_id' and being updated(or inserted) automatically as 'master_categories_id' does) where administrator can select compatibility for some products.

But, these fields are going to be presented based on the products category, so when you insert a motherboard you will have the oportunity to select proccesors and ram compatibility and when you insert a graphics card, power supply compatibility and so on.

Based on these selections, we can use some AJAX to present the right products to the customer, these which are compatible to each other.

There is another issue about products picture where I will also need some help. Even it is working, because of the reason there are 2 pictures, one for Intel PC's and one for AMD when you delete all automatically created products, these pictures are also being deleted. I just found a temporarily way, not to delete these pictures, by keeping 2 products, one of each category, and just flag their status to off.

Well the basic idea grown to much and I am now thinking more wide, so we can make this module more flexible day by day.

This way it could have many uses; not only to configure a computer but also other products.

Have a nice day ( or night ! )

23 Jul 2007, 2:18 PM
#20
s_p_ike avatar

s_p_ike

Zen Follower

Join Date:
Feb 2005
Location:
Italy
Posts:
178
Plugin Contributions:
0

Re: PC Configurator Module [Support Thread]

Hi,
I too started working on a configurator. Mine isn't by default for Zen Cart, but I wanted to integrate it in Zen as soon as is finished.

Actually I almost completed the front-end interface (still some things to do, like table layout for products and ability to sort the table on the fly, evaluate if give the ability to add more than 1 unit for the same item, create a link for details (probably tooltip or modal window that retrieves info via AJAX)...) and of course all the graphics.

I'm using a different approach:

A step process, to take account of the compatibility: example, step 1 select motherboards, step 2 select cpu but only among cpus compatible with the motherboard selected in step 1.

All the logic is done, just left some php controls and queries...

But unfortunately I'm not so quick as you ;)

I'm using jquery as js framework, with Interface plugin, some custom code and AJAX to load php page.

A pre-pre-alpha demo is here: http://sviluppo.atfriends.net/configuratore/