Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Custom Computer Creator v9 Support


sw45859

Recommended Posts

Is anyone supporting this contrib?

 

Hi Chris,

 

When I'm faced with the scenario of modding an already modded file and can't find where the original bits of code are I use a freeware program called Winmerge. You can then open the original file into the left pane and your modded file into the right and not only will it highlight all of the differences but it also spaces each file so that any code that is the same is horizontally inline with the other pane.

 

This should make it a lot easier to find the parts of your modded file that need to be altered.

 

Hope this helps

 

Carbon

 

PS: Ref your earlier posts about having the motherboard auto-select depending on the selected CPU... it is possible (I have it on my site) but it's a real headache to code. That's why the default solution is to use ccc.php to pre-select AMD or Intel before entering build.php to customise.

 

PPS: The original author of CCC has long gone, it's down to the community to support this contrib now.

Edited by Carbon
Link to comment
Share on other sites

  • Replies 542
  • Created
  • Last Reply

Top Posters In This Topic

Hi Chris,

 

When I'm faced with the scenario of modding an already modded file and can't find where the original bits of code are I use a freeware program called Winmerge. You can then open the original file into the left pane and your modded file into the right and not only will it highlight all of the differences but it also spaces each file so that any code that is the same is horizontally inline with the other pane.

 

This should make it a lot easier to find the parts of your modded file that need to be altered.

 

Hope this helps

 

Carbon

 

PS: Ref your earlier posts about having the motherboard auto-select depending on the selected CPU... it is possible (I have it on my site) but it's a real headache to code. That's why the default solution is to use ccc.php to pre-select AMD or Intel before entering build.php to customise.

 

PPS: The original author of CCC has long gone, it's down to the community to support this contrib now.

 

Well I tried it. Its not working, I decided to take a shot at the code with the fancier invoice and its a no go.

 

The box appears in the admin panel for Custom Computers but when I click on it, it redirects me to log in again and goes to the same place, no other options are available.

 

next thing is my catalog is gone? Its blank I am going to revert I guess cause I cant tell where I went wrong. If someone can help out with this it will be appreciated. Once I get done I plan on putting out a complete OSC 2.2 RC2a with these contribs already installed. But I have to get it working first.

 

If I knew where to start I would fix it but that is a whole butt load of files that were edited. So... the best option for me is to revert.

Link to comment
Share on other sites

  • 1 month later...

anyone please need to add qty box to the ccc 9.3.1 contrib so customers could change the qty they are ordering ??

 

this is possibole ?????

 

please someone !!!!!!!!!!!!!

Link to comment
Share on other sites

anyone please need to add qty box to the ccc 9.3.1 contrib so customers could change the qty they are ordering ??

 

this is possibole ?????

 

please someone !!!!!!!!!!!!!

 

Hi,

 

I'm not entirely sure why you want this as the quantity can be entered once the custom pc hits the shopping_cart.php page and to be honest, just how many PCs do you think your customers will order in one go?

 

If you really want this feature perhaps you can elaborate, like what page? in build.php?

 

Cheers

 

Carbon

Link to comment
Share on other sites

Hi,

 

I'm not entirely sure why you want this as the quantity can be entered once the custom pc hits the shopping_cart.php page and to be honest, just how many PCs do you think your customers will order in one go?

 

If you really want this feature perhaps you can elaborate, like what page? in build.php?

 

Cheers

 

Carbon

 

Hey thanks , i need to change the qty of each product in the builded computer not the whole computer like if someone what's to order 2 motherboard and 1 CPU in one order

he can't do it now.

you can check out what i'm tring to do in this page .

http://icaneat2.com/mixoy.com/demo/catalog/build.php

my site is in hebrew so i don't know if you could see the caption but the main idea you can

when you select a product in the option box it will open a text box witch you can enter the qty and then add to total order

and so on on each product.

 

let me know if you under stand me and if it is possble cuz i can't really understand the javascript code so to update the prices.

Link to comment
Share on other sites

Hey thanks , i need to change the qty of each product in the builded computer not the whole computer like if someone what's to order 2 motherboard and 1 CPU in one order

he can't do it now.

you can check out what i'm tring to do in this page .

http://icaneat2.com/mixoy.com/demo/catalog/build.php

my site is in hebrew so i don't know if you could see the caption but the main idea you can

when you select a product in the option box it will open a text box witch you can enter the qty and then add to total order

and so on on each product.

 

let me know if you under stand me and if it is possble cuz i can't really understand the javascript code so to update the prices.

 

Hi,

 

Build.php is NOT designed for adding different quantities, what it does is select various products from your OSC catalog and groups them together. Having said that, there is a way (which I devised for my site) and it's really quite simple...

 

Say you had a motherboard with a OSC product name of "Asus Crosshair" for £100, all you do is rename it to "1×Asus Crosshair" then create a duplicate product called "2×Asus Crosshair" and charge £200 for it (or less if you want to bulk discount)... and so on with all the other components you want to offer multiples of.

 

Hope this helps

 

Carbon

Link to comment
Share on other sites

Hi,

 

Build.php is NOT designed for adding different quantities, what it does is select various products from your OSC catalog and groups them together. Having said that, there is a way (which I devised for my site) and it's really quite simple...

 

Say you had a motherboard with a OSC product name of "Asus Crosshair" for £100, all you do is rename it to "1×Asus Crosshair" then create a duplicate product called "2×Asus Crosshair" and charge £200 for it (or less if you want to bulk discount)... and so on with all the other components you want to offer multiples of.

 

Hope this helps

 

Carbon

 

k thanks man , i guess this is the simplest way to do it.

 

i think i would do it like this.

 

do you know a way that the 1xPRODUCTNAME and so on ... will not show up in the categories only in the ccc page ?

Link to comment
Share on other sites

k thanks man , i guess this is the simplest way to do it.

 

i think i would do it like this.

 

do you know a way that the 1xPRODUCTNAME and so on ... will not show up in the categories only in the ccc page ?

 

Ah, I see your problem.

 

I won't be selling individual components only systems so I don't have that problem.

 

The GOOD news is YES what you want can be done, the BAD news is I ain't gonna do it for you ;)

 

 

Here's what you will need to do...

 

1: In build.php locate the code loop that renders each component catagory (ie: motherboards, cpu, sound etc), here's a clue...

while($count = tep_db_fetch_array($ccc_count_query)){

 

2: You need to add a text input with 1 as the default value and a name AND id of something like itemqty<?php echo $i;?> so that the first component quatity input id and name renders as "itemqty1" and the next "itemqty2" etc.

 

3: In java.php locate the function called total() and find the component loop...

while ($ccc_java = tep_db_fetch_array($ccc_java_query)){

 

4: Within that loop you need to grab the value of the itemqty input and use it to multiply the price of the current item.

 

5: Within custom_checkout.php you need to locate the code loop that renders the component list to build the unique description of the Custom Computer...

while ($count = tep_db_fetch_array($ccc_count_query)){

 

6: The values of each itemqty text input from build.php will be posted to this page because they were within the build.php <form> so you need to use something like...

$HTTP_POST_VARS['itemqty' . $i]

... to modify the description line of each item with the quantity so that instead of Asus Crosshair you get 1×Asus Crosshair appended to the description. Without this step neither you or the customer will have a clue what the quantities are when the order comes through.

 

 

Anyhoo, that should be enough to get you going but do bear in mind that CCC only knows what products are included in a system BEFORE you customise it... after you have created a custom computer each component is NOT asscosciated with it !!!! YES IT'S TRUE, CCC only stores a unique DESCRIPTION so it's quite difficult to manipulate the data.

 

So bear that in mind if you need your shipping module to calculate weights etc because the above code just modifies a DESCRIPTION no stored variables.

 

 

Hope this helps...

 

Carbon

Link to comment
Share on other sites

Ah, I see your problem.

 

I won't be selling individual components only systems so I don't have that problem.

 

The GOOD news is YES what you want can be done, the BAD news is I ain't gonna do it for you ;)

Here's what you will need to do...

 

1: In build.php locate the code loop that renders each component catagory (ie: motherboards, cpu, sound etc), here's a clue...

while($count = tep_db_fetch_array($ccc_count_query)){

 

2: You need to add a text input with 1 as the default value and a name AND id of something like itemqty<?php echo $i;?> so that the first component quatity input id and name renders as "itemqty1" and the next "itemqty2" etc.

 

3: In java.php locate the function called total() and find the component loop...

while ($ccc_java = tep_db_fetch_array($ccc_java_query)){

 

4: Within that loop you need to grab the value of the itemqty input and use it to multiply the price of the current item.

 

5: Within custom_checkout.php you need to locate the code loop that renders the component list to build the unique description of the Custom Computer...

while ($count = tep_db_fetch_array($ccc_count_query)){

 

6: The values of each itemqty text input from build.php will be posted to this page because they were within the build.php <form> so you need to use something like...

$HTTP_POST_VARS['itemqty' . $i]

... to modify the description line of each item with the quantity so that instead of Asus Crosshair you get 1×Asus Crosshair appended to the description. Without this step neither you or the customer will have a clue what the quantities are when the order comes through.

Anyhoo, that should be enough to get you going but do bear in mind that CCC only knows what products are included in a system BEFORE you customise it... after you have created a custom computer each component is NOT asscosciated with it !!!! YES IT'S TRUE, CCC only stores a unique DESCRIPTION so it's quite difficult to manipulate the data.

 

So bear that in mind if you need your shipping module to calculate weights etc because the above code just modifies a DESCRIPTION no stored variables.

Hope this helps...

 

Carbon

 

Thanks alot mate , i will try and mod this changes you wrote and play with it a little.

Thanks alot man , i don't need the stuff do be writing in my DB it's not a problem.

 

Thanks alot man.

Link to comment
Share on other sites

Thanks alot mate , i will try and mod this changes you wrote and play with it a little.

Thanks alot man , i don't need the stuff do be writing in my DB it's not a problem.

 

Thanks alot man.

 

Great man it's working 100% i moded so when i change the input text field its changes the total and stuff thanks.

 

one last thing if i have one or more product on the same page it's added the categories name with the 1st option to the basket ( not with the price and all but still i can see it there and it's really noting )

 

so there is a way i can tell him when the price is 0 or something like that don't add the item to the basket under the master product ???

 

Thanks in advance.

Icaneat2

Link to comment
Share on other sites

Great man it's working 100% i moded so when i change the input text field its changes the total and stuff thanks.

 

one last thing if i have one or more product on the same page it's added the categories name with the 1st option to the basket ( not with the price and all but still i can see it there and it's really noting )

 

so there is a way i can tell him when the price is 0 or something like that don't add the item to the basket under the master product ???

 

Thanks in advance.

Icaneat2

 

Hi,

 

I couldn't understand what you were trying to say there (Don't worry, your English is way ahead of my Hebrew ;) ) so I took a guess that you want ANY product that has a price of zero to be removed from the shopping cart.

 

Here is a quick and dirty fix, but will only work when shopping_cart.php is actually visited so I would recommend that you set admin to always forward the customer to the cart after adding a product.

 

OK... in shopping_cart.php locate the code loop that renders out the products list, it will begin with something like...

for ($i=0, $n=sizeof($products); $i<$n; $i++) {
$cur_row = sizeof($info_box_contents) - 1;

 

Then insert the following php code...

if ($products[$i]['final_price']==0){
$cart->remove($products[$i]['id']);
}

 

Have fun

 

Carbon

Link to comment
Share on other sites

Hi,

 

I couldn't understand what you were trying to say there (Don't worry, your English is way ahead of my Hebrew ;) ) so I took a guess that you want ANY product that has a price of zero to be removed from the shopping cart.

 

Here is a quick and dirty fix, but will only work when shopping_cart.php is actually visited so I would recommend that you set admin to always forward the customer to the cart after adding a product.

 

OK... in shopping_cart.php locate the code loop that renders out the products list, it will begin with something like...

for ($i=0, $n=sizeof($products); $i<$n; $i++) {
$cur_row = sizeof($info_box_contents) - 1;

 

Then insert the following php code...

if ($products[$i]['final_price']==0){
$cart->remove($products[$i]['id']);
}

 

Have fun

 

Carbon

 

sorry man about my english but that not quite what i was talking about

goto this site : http://www.mixoy.com/demo/catalog/ccc.php

press the 2 link and now you see two products list ( option boxes ) and when you press the checkout right away with not adding any products.

it's still adding 2 "products" to the cart ( under 1 master product called 123 ) i want when you add a product with price of 0 it will not add him to the master product called 123

 

i hope you will understand me now if not i will upload a screen capture to let you see it.

 

thank you very much for your help.

 

when you add product to the

Link to comment
Share on other sites

sorry man about my english but that not quite what i was talking about

goto this site : http://www.mixoy.com/demo/catalog/ccc.php

press the 2 link and now you see two products list ( option boxes ) and when you press the checkout right away with not adding any products.

it's still adding 2 "products" to the cart ( under 1 master product called 123 ) i want when you add a product with price of 0 it will not add him to the master product called 123

 

i hope you will understand me now if not i will upload a screen capture to let you see it.

 

thank you very much for your help.

 

when you add product to the

 

Hehe,

 

I had a look but I cannot understand the language and there aren't any symbols or icons I can relate to. I tried a few links but nothing seemed to be added to the cart so it looks like you'll have to provide a screen shot.

 

Carbon

 

PS: I know it's a demo site but your admin/includes/configure.php file needs to have its CMOD changed to prevent the file being written to, and for some reason your links are showing session IDs in the status bar when hovered over which is a security leak.

Link to comment
Share on other sites

Hehe,

 

I had a look but I cannot understand the language and there aren't any symbols or icons I can relate to. I tried a few links but nothing seemed to be added to the cart so it looks like you'll have to provide a screen shot.

 

Carbon

 

PS: I know it's a demo site but your admin/includes/configure.php file needs to have its CMOD changed to prevent the file being written to, and for some reason your links are showing session IDs in the status bar when hovered over which is a security leak.

 

yeah i know about the configure.php and about the security leak i'm working on fixing it now , that's why my configure.php open to written.

 

here is a link to my shoping cart after building a computer.

the trick here is that i only added one product to the build computer but still he added two products

one product is under categoriy 444 it's a real product that i choose with price of 17.9$

the other product is under categoriy 333 i didn't choose anything from the combobox it's still on "Search by manufactor" but he still added him to

the "cart" it's has a price of 0.

 

Untitled2.jpg

 

so my question is if you can remove the product with the price of 0 from that desctiption on all pages ???

if the price is 0 i don't need to see him in my cart or in my description.

 

thanks alot man

sorry about all of that.

Link to comment
Share on other sites

yeah i know about the configure.php and about the security leak i'm working on fixing it now , that's why my configure.php open to written.

 

here is a link to my shoping cart after building a computer.

the trick here is that i only added one product to the build computer but still he added two products

one product is under categoriy 444 it's a real product that i choose with price of 17.9$

the other product is under categoriy 333 i didn't choose anything from the combobox it's still on "Search by manufactor" but he still added him to

the "cart" it's has a price of 0.

 

Untitled2.jpg

 

so my question is if you can remove the product with the price of 0 from that desctiption on all pages ???

if the price is 0 i don't need to see him in my cart or in my description.

 

thanks alot man

sorry about all of that.

 

 

I think I've finally got a handle on what you're asking for...

 

Try this...

 

in custom_checkout.php find the following around line 47...

		if ($HTTP_POST_VARS['new' . $i] == "Please Select" || $HTTP_POST_VARS['new' . $i] == ""){
	   $message .= '<tr><td class="smallText">' . $count['cat_name'] . ':</td><td class="smallText">'.TEXT_NONE_SELECTED.'</td></tr>';
	}else{
	   $message .= '<tr><td class="smallText">' . $count['cat_name'] . ':</td><td class="smallText">' . $HTTP_POST_VARS['new' . $i] .'</td></tr>';
	}

 

and replace with this...

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_POST_VARS['new' . $i . '_hidden'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);

if ($product_info['products_price']>0){
	if ($HTTP_POST_VARS['new' . $i] == "Please Select" || $HTTP_POST_VARS['new' . $i] == ""){
	   $message .= '<tr><td class="smallText">' . $count['cat_name'] . ':</td><td class="smallText">'.TEXT_NONE_SELECTED.'</td></tr>';
	}else{
	   $message .= '<tr><td class="smallText">' . $count['cat_name'] . ':</td><td class="smallText">' . $HTTP_POST_VARS['new' . $i] .'</td></tr>';
	}
}

 

Good luck

 

Carbon

Link to comment
Share on other sites

I think I've finally got a handle on what you're asking for...

 

Try this...

 

in custom_checkout.php find the following around line 47...

		if ($HTTP_POST_VARS['new' . $i] == "Please Select" || $HTTP_POST_VARS['new' . $i] == ""){
	   $message .= '<tr><td class="smallText">' . $count['cat_name'] . ':</td><td class="smallText">'.TEXT_NONE_SELECTED.'</td></tr>';
	}else{
	   $message .= '<tr><td class="smallText">' . $count['cat_name'] . ':</td><td class="smallText">' . $HTTP_POST_VARS['new' . $i] .'</td></tr>';
	}

 

and replace with this...

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_POST_VARS['new' . $i . '_hidden'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);

if ($product_info['products_price']>0){
	if ($HTTP_POST_VARS['new' . $i] == "Please Select" || $HTTP_POST_VARS['new' . $i] == ""){
	   $message .= '<tr><td class="smallText">' . $count['cat_name'] . ':</td><td class="smallText">'.TEXT_NONE_SELECTED.'</td></tr>';
	}else{
	   $message .= '<tr><td class="smallText">' . $count['cat_name'] . ':</td><td class="smallText">' . $HTTP_POST_VARS['new' . $i] .'</td></tr>';
	}
}

 

Good luck

 

Carbon

 

Thanks alot man it's working like a charm !!!!!!!

:-)

thanks man.

Link to comment
Share on other sites

Thanks alot man it's working like a charm !!!!!!!

:-)

thanks man.

 

 

Hey man , sorry about all my questions / requests , but i have one last request.

 

if it is possoble to make like after i choose a product on the last page ( build.php )

a multi select box with all the attributes i added in the admin page to this product.

and then choose all the attributes i want with CTRL and it will add it like this picture

 

Untitled.jpg

 

 

Thanks alot man.

 

it's a great conrtib i will use it alot.

Link to comment
Share on other sites

Hey man , sorry about all my questions / requests , but i have one last request.

 

if it is possoble to make like after i choose a product on the last page ( build.php )

a multi select box with all the attributes i added in the admin page to this product.

and then choose all the attributes i want with CTRL and it will add it like this picture

 

Untitled.jpg

Thanks alot man.

 

it's a great conrtib i will use it alot.

 

I had to laugh as it just occured to me that you're using Custom Computer Creator to build custom cakes! :lol:

 

Re Attributes, I want to make sure that I understand your request...

 

I don't use attributes in my site so I'm a little bit rusty but as I understand it OSC allows you to add attributes to a product so if you were selling clothes the attribute could be size and the options could be small, medium and large.

 

Now when we put that into the context of CCC it would be like selecting a case and then having an additional select dropdown menu to select the colour.

 

^^^^^^^ Is this what you are after?

 

Carbon

Link to comment
Share on other sites

I had to laugh as it just occured to me that you're using Custom Computer Creator to build custom cakes! :lol:

 

Re Attributes, I want to make sure that I understand your request...

 

I don't use attributes in my site so I'm a little bit rusty but as I understand it OSC allows you to add attributes to a product so if you were selling clothes the attribute could be size and the options could be small, medium and large.

 

Now when we put that into the context of CCC it would be like selecting a case and then having an additional select dropdown menu to select the colour.

 

^^^^^^^ Is this what you are after?

 

Carbon

 

basicliy yeah , but after selecting a case and then having an additional select multi dropdown menu ( multi selecting menu ) to select the colours

like case: atx colour: red,black,green (selected).

and if it could be any attribute will have his own qty ( no calculate prices to the attributes ) it will be the best thing every.

 

the main idea is that i want to make like a recipe menu to order

like choose

cakes:

dropdown menu with the cakes type.

then after i choose cake type like : chocalte cake.

it will open a multi dropdown menu with the attribute like , bitter choclate cake ( own qty ) , milk cake ( own qty)

and so on for all products.

 

now the qty for the master product is working great. so all i need is to show in the cart under the master product with it own qty.

 

let me know if something like that can be done with this contrib ??

 

thanks alot man.

Link to comment
Share on other sites

basicliy yeah , but after selecting a case and then having an additional select multi dropdown menu ( multi selecting menu ) to select the colours

like case: atx colour: red,black,green (selected).

and if it could be any attribute will have his own qty ( no calculate prices to the attributes ) it will be the best thing every.

 

the main idea is that i want to make like a recipe menu to order

like choose

cakes:

dropdown menu with the cakes type.

then after i choose cake type like : chocalte cake.

it will open a multi dropdown menu with the attribute like , bitter choclate cake ( own qty ) , milk cake ( own qty)

and so on for all products.

 

now the qty for the master product is working great. so all i need is to show in the cart under the master product with it own qty.

 

let me know if something like that can be done with this contrib ??

 

thanks alot man.

 

 

I had a look at the files involved and couldn't see an easy way to do it.

 

It looks like everytime you add a product (depending on the page), OSC checks to see if there are attributes for that product. If it finds attributes it redirects to the product_info.php page which has the additional code to render the attributes drop-down menus, so step 1 would be to transplant that code into build.php, here is the unmodified code...

 

<?php
  $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
  while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
	$products_options_array = array();
	$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
	while ($products_options = tep_db_fetch_array($products_options_query)) {
	  $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
	  if ($products_options['options_values_price'] != '0') {
		$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	  }
	}

	if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
	  $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
	} else {
	  $selected_attribute = false;
	}
?>
		<tr>
		  <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
		  <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
		</tr>
<?php
  }
?>

 

... it looks like the only thing you have to inject into it is the product_id which is easy.

 

Next you will need to examine how product_info.php processes the attributes. You will need to look at includes/classes/shopping_cart.php and look for the function add_cart.

 

This should be enough to figure out how to display, select and update the attributes but you will still need to follow the code trail to incorporate the extra info (attributes) into the custom PC (or cake in your case).

 

Here's a quick rundown...

 

build.php is where you select components which then gets passed to...

custom_checkout.php which creates a NEW product with all the component choices written as a description.

 

If the NEW product is loaded into a normal OSC page it will refer to it as a normal product using products_id.

If the NEW product is loaded into a CCC page it will use the fsb variable to retreive product data AND selections.

 

So... seeing as your attributes won't affect pricing I would see how to use custom_checkout.php to modify the description in a similar way you did to add quantities. If you then edit the PC (cake) by re-loading back into build.php then it should retrieve your attributes selections and any updates/changes will happen when custom_checkout.php re-creates the description.

 

Hope this helps

 

Carbon

Link to comment
Share on other sites

I had a look at the files involved and couldn't see an easy way to do it.

 

It looks like everytime you add a product (depending on the page), OSC checks to see if there are attributes for that product. If it finds attributes it redirects to the product_info.php page which has the additional code to render the attributes drop-down menus, so step 1 would be to transplant that code into build.php, here is the unmodified code...

 

<?php
  $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
  while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
	$products_options_array = array();
	$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
	while ($products_options = tep_db_fetch_array($products_options_query)) {
	  $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
	  if ($products_options['options_values_price'] != '0') {
		$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	  }
	}

	if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
	  $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
	} else {
	  $selected_attribute = false;
	}
?>
		<tr>
		  <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
		  <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
		</tr>
<?php
  }
?>

 

... it looks like the only thing you have to inject into it is the product_id which is easy.

 

Next you will need to examine how product_info.php processes the attributes. You will need to look at includes/classes/shopping_cart.php and look for the function add_cart.

 

This should be enough to figure out how to display, select and update the attributes but you will still need to follow the code trail to incorporate the extra info (attributes) into the custom PC (or cake in your case).

 

Here's a quick rundown...

 

build.php is where you select components which then gets passed to...

custom_checkout.php which creates a NEW product with all the component choices written as a description.

 

If the NEW product is loaded into a normal OSC page it will refer to it as a normal product using products_id.

If the NEW product is loaded into a CCC page it will use the fsb variable to retreive product data AND selections.

 

So... seeing as your attributes won't affect pricing I would see how to use custom_checkout.php to modify the description in a similar way you did to add quantities. If you then edit the PC (cake) by re-loading back into build.php then it should retrieve your attributes selections and any updates/changes will happen when custom_checkout.php re-creates the description.

 

Hope this helps

 

Carbon

 

Thanks man i will give it a try.

 

Thanks alot man.

Link to comment
Share on other sites

Has anyone come up with a solution for the radio buttons?

 

Let me now,

 

C. Scott Williams

 

Hi,

 

The short answer is no however, this company can sell you a modified version that does...

 

http://www.itwebexperts.com/custom_computer_builder.php

 

...I'm 99% sure that I could do it but unfortunately I'm too busy with my own site.

 

 

Carbon

Link to comment
Share on other sites

Hi All,

 

After loads of blood, sweat and tears I have finally completed the "Design a System" section of the secure order site and would really appreciate it if you guys could test it for me.

 

Here's the related news article...

 

The User Specified Design system goes live for testing. If you’ve been reading our Website news articles you’ll be familiar with this unique feature, for those that haven’t here’s a quick recap... If a customer just wants to buy a ready made package they can “Select” one of our preconfigured systems, or changes can be made by choosing “Customise” but what if the customer wants something that isn’t available?

 

This is where the “Design” system comes in as it allows customers to either select known components or specify their own which means that they get what they want and we don’t miss a sale. Because each system created this way is totally unique we have developed a system that automatically confirms the request and begins the quotation process which includes regular updates and an interactive online history. Design revisions can be made either before or after quoting with automatic approval requests and dynamic expiry dates.

 

If you would like to try the Design system click here.

 

Cheers

 

Carbon

Link to comment
Share on other sites

i love it!... i think the only thing i personally would change (if i was good enough lol... which i'm not) is hide/remove the scroll bar so it looks as though the customers needs to go through one step at a time selecting next/previous as they go.

 

but apart from that it looks fantastic! is this what the custom computer creator does? once customized to you're site that is ;)

 

FANTASTIC JOB!!!

Link to comment
Share on other sites

i love it!... i think the only thing i personally would change (if i was good enough lol... which i'm not) is hide/remove the scroll bar so it looks as though the customers needs to go through one step at a time selecting next/previous as they go.

 

but apart from that it looks fantastic! is this what the custom computer creator does? once customized to you're site that is ;)

 

FANTASTIC JOB!!!

 

Thanks for the feedback, I did toy with the idea of removing the scrollbars (<body scroll="no">) but ultimately I decided it was a no-no to remove browser functionality especially when it concerns navigation which is very important.

 

So, how far into "testing" did you go? I know you didn't do a test order otherwise the site would have sent me a txt msg to my mobile ;)

 

Anyone else game? The site isn't live so you can play as much as you like and give fake info to place an order.

 

Cheers

 

Carbon

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...