shipping_cart.php mod help
gadellj <[email protected]> 13 Aug 2003 23:52:30 -0000
| Newsgroups | gmane.comp.web.oscommerce.devel |
|---|---|
| Message-ID | <a708013294280d5f9eefa9db97ad4c3a@osCommerce-Forums> |
This message was sent from: Development
http://forums.oscommerce.com/viewtopic.php?p=213365#213365
----------------------------------------------------------------
Hi,
I'm trying to code a modification that will allow a particular item's price to be multiplied by its attributes contents. For example. If I have a sign that is 12" tall, and the cost is dependent on its length in feet, I'd like to have a text field that allows the user to enter the length, then OSC will multiply that times the price_prefix of that particular attribute. Make sense? So in the end you have attribute_value * attribute_price_prefix + item_price.
Anyway, I'm running into problems - I believe I need to add some code into shopping_cart, but I can't get any information out of the variables. Here is my code to print out the contents of the variables for debugging and a sample if statement. They show up empty. This code will be around line 140 in shopping_cart.php, part of the for ($i=0, $n=sizeof($products); $i<$n; $i++) loop.
[code]echo "price prefix is: " . $attributes_values['price_prefix'] . ".\n";
echo "options value is: " . $attributes_values['options_values_price'] . ".\n";
if (($attributes['price_prefix'])=='x') {
products[$i]['final_price'] = $products[$i]['final_price'] * $products[$i][$option]['options_values'];
}[/code]
Any ideas?
Joe