Help - Search - Members - Calendar
Full Version: Contribution search: stock quantity for special product configurations
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Contribution Development
whiteML
Hey, I searched some about following, but just found hundreds of sites filled with text.


I am searching for a contrib that allows me to set the stock for special configurations of a product.

e.g.:
my product is a simple box
option 1 is the material (wood/steel/plastic/cardboard)
option 2 is the color (yellow/blue/red)

if a customer purchase a box-wood-blue the stock of the configuration box-wood-blue should be substracted by one, not each single part (the product (box -1), material (wood -1) and color (blue -1)).
I can only order that special configurations and can't just 'add' the blue color to an 'uncolored' box, because they were manufactured like that.
I don't want a product for every configuration!

So in my example I would need a table with 3 columns and 4 rows to type in the current stock.
The contrib should also show the availlable configurations on the product page, when some configurations are out of stock.
Each options should be able to be priced seperately.

Is there any contrib, which could fulfill my wishes or does anyone have an idea how to realize that.

Thanks
whiteML
whiteML
Hi again,

I started to try, but I don't managed to get a dynamic input field for the products quantities (I need that field at the marked place)

The field should read the products quantity and write it to the database table products_alt_options_to_products together with
the actual product ID as products_id,
$linecounter as products_alt_options_values_line_id and
$columncounter as products_alt_options_values_column_id,


Can anyone help me with that?

thx


here my current code from catalog/admin/categories.php starting around line 600

CODE
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_quantity', $pInfo->products_quantity); ?></td>
</tr>

<!-- BOF products alternative attributes -->
<?php
// manually set number of rows and lines
$columncounter=1;
$columns=2;
// manually set number of lines
$linecounter=1;
$lines=3;
?>
<tr>
<td></td>
<td><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('products_alt_options_column_id', $products_alt_options_array, $pInfo->products_alt_options_id); ?></td>
</tr>
<td></td>
<td></td>
<?php
while ($columncounter < $columns+1){
?>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('products_alt_options_values_id', $products_alt_options_values_array, $pInfo->products_alt_options_values_id); ?></td>
<?php
++$columncounter;
}
?>
</tr>
<tr>
<?php
while ($linecounter < $lines+1){
$columncounter=1;
if ($linecounter == 1)
{
?>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('products_alt_options_line_id', $products_alt_options_array, $pInfo->products_alt_options_id); ?></td>
<?php
}
else
{
?>
<td></td>
<?php
}
?>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('products_alt_options_values_id', $products_alt_options_values_array, $pInfo->products_alt_options_values_id); ?></td>
<?php
while ($columncounter < $columns+1){
?>




<!-- HERE SHOULD BE THE INPUT FIELD -->




<?php

++$columncounter;
}
++$linecounter;
?>
</tr>
<tr>
<?php
}
?>


<tr>

</tr>

</table></td>
</tr>
<!-- EOF products alternative attributes -->

<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
<tr>
<td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td>
<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_model', $pInfo->products_model); ?></td>
</tr>
chrisytsma
I think I get where you are going with this. Let me clarify...

You have products with different attributes. And you want to be able to keep inventory based on each attribute, not just the product as a whole. So your product stock might be made up like this:

Box - Stock=16
Wood Box - Stock=4
Steel Box - Stock=4
Plastic Box - stock=4
Cardboard Box - Stock=4

16 is the total amount of boxes in stock since you have 4 of each kind. I can easily see that you would be able to add a column to the products_attribute table that says 'stock' and configure your store to subtract stock stock from those attributes in that table when they are purchased.

But what makes it more difficult is when you have more than one attribute as the number of values for each attribute increases the complexity of your stock. In addition to your type of box, you have colors as well. So you would have a total of 12 different box types (4x3) that you would have to keep track of with stock. This cant be done by just adding a stock column to the products_attribute table. You would need a separate table.

Is all of this what you are trying to accomplish?

Chris
whiteML
QUOTE (chrisytsma @ Jul 9 2008, 12:13 AM) *
But what makes it more difficult is when you have more than one attribute as the number of values for each attribute increases the complexity of your stock. In addition to your type of box, you have colors as well. So you would have a total of 12 different box types (4x3) that you would have to keep track of with stock. This cant be done by just adding a stock column to the products_attribute table. You would need a separate table.

Is all of this what you are trying to accomplish?

Chris


correct...

my thoughts:
- I want to split it from the standard included attributes/options, so there should be the new tables products_alt_options, products_alt_options_values, products_alt_prices and products_alt_options_to_products
- The stock status of the products should be shown on the product_info page in a table with red/green light.
- products_alt_options_to_products should include the quantity with line_id and column_id

So my main problem is to define a table in the admin/categories.php (Create new product) where I can insert all quantities, product-'materials' and
product-'colors' and get them into the database.

wML



chrisytsma
Wow, Ill be honest. Thats out of my league...

I hope you find what you are looking for.
You may have to end up paying someone to do that for you.

-Chris
scubadive4fun
I've come across the same problem in having a single product quantity.

A simple example would be selling t-shirts. How do I keep track of quantities for different sizes of the same design shirt?

Any help would be greatly appreciated.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.