travisb Posted October 1, 2004 Share Posted October 1, 2004 I am using the Product Attributes - Option Type Feature contribution and need a little help. I have some text boxes with value prices added. Does anyone know how to get the Value Price added to the product in the shopping cart if the text box is filled out? Right now, the option shows up in the cart, but the option price is not added to the product price. Quote Link to comment Share on other sites More sharing options...
travisb Posted October 4, 2004 Author Share Posted October 4, 2004 Does anyone know of a solution to this problem? I really need to get this fixed. Quote Link to comment Share on other sites More sharing options...
travisb Posted October 11, 2004 Author Share Posted October 11, 2004 Still looking for help with this. I am willing to offer money to someone who knows this solution. (if we are allowed to do that here) Quote Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted October 11, 2004 Share Posted October 11, 2004 I was able to reproduce this problem, I'll let you know if I find the solution Quote KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted October 11, 2004 Share Posted October 11, 2004 I made the following 2 changes to have the TEXT price included: You basically build in a switch to see if it's a text attribute and in that case ignore the option_values_id for the selection of the pricing data. Remember, text fields all have options_id set to 0 (or other constant that you defined). There can only be one text field for each product, thus it is safe to ignore the option_values_id In catalog/includes/classes/shopping_cart.php in the calculate function: // attributes price if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { //BoF CB also fetch the price if $value is a TEXT string //$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); if ($value == PRODUCTS_OPTIONS_VALUE_TEXT_ID) { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' "); } else { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); }; //EoB CB switch for TEXT string $attribute_price = tep_db_fetch_array($attribute_price_query); and in the attributes_price function function attributes_price($products_id) { $attributes_price = 0; if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { //BoF CB also fetch the price if $value is a TEXT string //$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); if ($value == PRODUCTS_OPTIONS_VALUE_TEXT_ID) { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' "); } else { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); }; //EoB CB switch for TEXT string Quote KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
travisb Posted October 18, 2004 Author Share Posted October 18, 2004 Thank you very much bruyndoncx. :D :D :D I thought I had the email notification turned on, or else I would have replied, and had the solution, last week. We are very excited to have this working now. Thanks again, Travis I made the following 2 changes to have the TEXT price included:You basically build in a switch to see if it's a text attribute and in that case ignore the option_values_id for the selection of the pricing data. Remember, text fields all have options_id set to 0 (or other constant that you defined). There can only be one text field for each product, thus it is safe to ignore the option_values_id Quote Link to comment Share on other sites More sharing options...
sabre Posted October 30, 2004 Share Posted October 30, 2004 Does anybody know how to make the extra fields "required" so that people have to fill them out to order the item? Thank you! Quote Link to comment Share on other sites More sharing options...
Elvis Posted November 17, 2004 Share Posted November 17, 2004 (edited) Hello from germany, I would gladly apreciate any help for the following problem: Is it possible to add the attributes price only once per product, independent of how many of this item would be purchased? I will try to explain it using an example. I am building an onlineshop for a printing company. So i created a product called envelopes. As attributes i have defined "Number of colours", here 4C or single colour. If i add a price for this attribute, it will be summed up, if someone orders 10 envelopes, it will cost him 10 times the "number of colours" price. Since this option should be the price for the basic costs for the printing job, it only has to be added once per product. Any idea how to get this running? Second example: If someone wants to buy some envelopes, he will have to pay a basic fee, depending on the number of colours. This price will not change, wether he buys 100 or 1000 envelopes. If he now wants to buy stationery also, he again has to pay another (different) basic fee, because the stationery will be printed on another printer. I hope, that I have explained my problem somehow, my english is not that good. Probably one of the osCommerce specialists out there could help me with that? Thank you very much Andr? Edited November 17, 2004 by Elvis Quote Link to comment Share on other sites More sharing options...
kortshop Posted November 17, 2004 Share Posted November 17, 2004 Hello from Norway! I also run a print shop and need exactly the same as you do. I have spent a lot of time searching the forums with no luck this far! I consider hiring a programmer to do this if nothing comes up here. Vidar Hello from germany, I would gladly apreciate any help for the following problem: Is it possible to add the attributes price only once per product, independent of how many of this item would be purchased? I will try to explain it using an example. I am building an onlineshop for a printing company. So i created a product called envelopes. As attributes i have defined "Number of colours", here 4C or single colour. If i add a price for this attribute, it will be summed up, if someone orders 10 envelopes, it will cost him 10 times the "number of colours" price. Since this option should be the price for the basic costs for the printing job, it only has to be added once per product. Any idea how to get this running? Second example: If someone wants to buy some envelopes, he will have to pay a basic fee, depending on the number of colours. This price will not change, wether he buys 100 or 1000 envelopes. If he now wants to buy stationery also, he again has to pay another (different) basic fee, because the stationery will be printed on another printer. I hope, that I have explained my problem somehow, my english is not that good. Probably one of the osCommerce specialists out there could help me with that? Thank you very much Andr? <{POST_SNAPBACK}> Quote Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted November 17, 2004 Share Posted November 17, 2004 It may or may not work, but you can look at the problem differently. Suppose your smallest batch size is 10 costing 120 where 20 is the fixed fee and 100 for 10 envelopes. Setting up base product as 120 with batch of 10 selected by default. Then you can add option to have 100 at +90, 200 + 190 etc There is also a small contribution to implement a mulitplication factor which might be useful too. HTH Quote KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.