Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adjuts product model due to products attributes?


JEWbacca

Recommended Posts

I think I remember such a contribution, but this was a long time ago.... and I can't seem to find it now.

 

One of my products has nearly 300 attributes so I need a different part number to be associated with it according to the attribute...

 

Is anyone using such a contribution or can anyone suggest a way to do such a thing?

 

Thanks in advance,

 

Nate

Link to comment
Share on other sites

The Custom Computer Creator works similar this - essentially it creates a custom product in the database for the selections made to construct the computer. It however uses the products_model column as 'custom' so perhaps you would need another column for this. It does give it a unique products_id.

 

Just a thought :D

 

Matti

Link to comment
Share on other sites

Matti thank you very much for your reply. I will have to check out the Custom Computer Creator...

 

In the mean time does anyone else have any suggestions or remember such a contribution?

 

Thanks,

 

Nate

Link to comment
Share on other sites

I have just finished an all-day search of the contributions area.... sad to say I had no luck at all.

 

Once again my problem is that I have nearly 300 attributes for one product and would like the product model number to change when an attribute is selected.

 

I figured the best way to do this would be to associate a model number with each attribute... but if anyone has any other ideas on a good way to do this I'm very very intrested!

 

Thanks in advance for any ideas....

 

Nate

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
Once again my problem is that I have nearly 300 attributes for one product and would like the product model number to change when an attribute is selected.

 

I figured the best way to do this would be to associate a model number with each attribute... but if anyone has any other ideas on a good way to do this I'm very very intrested!

 

Any leads on this yet Jewbacca?

Link to comment
Share on other sites

  • 2 weeks later...

I am in a similar situation. Right now, for example, I have one product that will come in five different colors. I want to keep track of stock and have set the model numbers to the same as the vendors (a unique number for each color). Problem is, I have many products that will come in different colors, etc. but have all of them listed individually in the catalog as I have not found a way to get attributes to be associated with a specific product id.

 

Any clues?

Link to comment
Share on other sites

well I am having the same limitations here. Some of the products come with different flavors from the manufacturer having different skus assigned to them and then I have my own custom combinations of products to assist services, special customers needs etc. I was unable to properly setup the product attributes to cover each scenario so I set it up as different products to cover each case.

 

I thought about a bit and if I get the time this is what I will do:

- Create a subproducts table in the database to store variations of a product with all necessary fields like sku or model etc.

- Add the code to manipulate the admin/catalog elements of subproducts.

- Provide jscript or css for the products description pages (product_info.php) to alter the sku or other attributes on the fly.

 

With css for instance I would load all subproducts (descriptions/image names/features etc) from the dbase then use the div tag to offer navigation to the client via a submenu.

 

Its not trivial, all I can say and also depends how much your store has been customized. In my case I would need to make changes to several other contributions for something like this to work.

Link to comment
Share on other sites

  • 1 month later...

Well, I've given something similar a try. In checkout_process.php, after:

 

// Update products_ordered (for bestsellers list)
tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

 

I've inserted the following code. I've got each of my products set with a model number, and if the attribute is "right handed" I want to add an "R" to the model. Otherwise, it's left and I put an "L". Same for the material - whether it's steel or graphite. Here's my addition:

 

// Update products_ordered (for bestsellers list)
	$newmodel = $order->products[$i]['model'];
$hand = 'R';
$material = 'S';
if (isset($order->products[$i]['attributes'])) {
		for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
				$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
				$attributes_values = tep_db_fetch_array($attributes);
				$temp_attribute_name = $attributes_values['products_options_values_name'];
				if ($temp_attribute_name == 'Left Handed') {
						$hand = 'L';
				}
				if ($temp_attribute_name == 'Graphite') {
						$material = 'G';
				}
		}
}

$newmodel = $newmodel.$hand.$material;

 

Then I changed:

 

							'products_model' => $order->products[$i]['model'],

 

to:

 

							'products_model' => $newmodel,

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...