Arpit Posted June 20, 2003 Share Posted June 20, 2003 I am not sure if you have noticed this, but every release of osCom has this, the text box where you specify the quantity of products, the shopping_cart.php, there you can specify products with decimal places, so a customer could mistakeably orders 2.5 shirts, now I dont know how to give a customer 2.5 of any item, and the weird thing is, the price total includes the price for that 0.5 shirt, so this is what you do, In includes/classes/shopping_cart.php around line 99 make sure that the variable 'qty' has (int) in front of it so it looks like, if ($this->in_cart($products_id)) { $this->update_quantity($products_id, (int)$qty, $attributes); if you are using CVS2.2 then add (int) in catalog/shopping_cart.php around line 149 $info_box_contents[$cur_row][] = array('align' => 'right', 'params' => 'class="productListing-data" valign="top"', 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), (int)$products[$i]['quantity']) . '</b>'); } Now if someone tries to enter 2.6 or any quantity with decimal, it would round the quantity and the price would not change :idea: The late twentieth century has witnessed a remarkable growth in scientific interest in the subject of extinction ---------------------------------------------------- Arpit Link to comment Share on other sites More sharing options...
Guest Posted June 20, 2003 Share Posted June 20, 2003 Arpit, That's not a bug, it is a feature. :D Actually some of us use it too....If you sell fabric by the yard, or rope by the foot or nails by the pound being able to sell .5 is a good thing. :D Thank you for providing a fix for those that don't need it though. :D Link to comment Share on other sites More sharing options...
azer Posted June 21, 2003 Share Posted June 21, 2003 i think that in the admin configuration u should be able to set this feature off or on ... MS2 Link to comment Share on other sites More sharing options...
jpf Posted June 23, 2003 Share Posted June 23, 2003 Better yet - it should be by item that way if SOME of your items are sold by the fraction - you can - But if a large qty has to be sold by a whole unit DON'T have this "Fractional" flag on will only allow whole numbers. Link to comment Share on other sites More sharing options...
voided Posted July 4, 2003 Share Posted July 4, 2003 how about you turn up an error if the value is not int ? maybe instead of 1.5 the client wanted 15 products... so i think it would be better to show them the error they made right away. just a thought Designrfix.com | Graphic Design Inspiration & Web Design Resources - @designrfix Link to comment Share on other sites More sharing options...
dreamscape Posted July 5, 2003 Share Posted July 5, 2003 That's not a bug, it is a feature. :D Kim, how long have you been waiting to use that one? :wink: :lol: The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke Link to comment Share on other sites More sharing options...
Guest Posted July 8, 2003 Share Posted July 8, 2003 Any ideas on why when placing an order, anything ordered in an amount higher than 1 in shopping_cart.php, defaults back to 1 in checkout_shipping.php and checkout_confirmation.php? I'm using MS1, the only mods are CanadaPost and an Update Currency cron, and only have one product. I have tried "falsing" the stock options in Admin, but have 995 in stock anyway there. Violet Link to comment Share on other sites More sharing options...
Aqua121 Posted July 12, 2003 Share Posted July 12, 2003 That's not a bug, it is a feature. :D you must be joking! :? I think most of us sell 1 whole of an item, not a fraction of it. :lol: thanx god for some1 pointing me here, I just got an order today for 1.5 of a product, and I'm quite puzzled how to ship that :sarcasm: cheers, Cheers, Susan * * * * * Find a way, or make one! Link to comment Share on other sites More sharing options...
johno692001 Posted September 15, 2003 Share Posted September 15, 2003 I keep having the same problem. Just the other day I shipped half of a product and the customer complained that it was the wrong half ;) (apologies - spent too long in front of my monitor today) Link to comment Share on other sites More sharing options...
rekhis Posted September 16, 2003 Share Posted September 16, 2003 Thanks Arpit, I am building my site and I needed this fix! Link to comment Share on other sites More sharing options...
raize Posted October 7, 2003 Share Posted October 7, 2003 Great website..........Can you tell me how you got rid of the numbers from the category list? Link to comment Share on other sites More sharing options...
JohnnyGTO Posted October 8, 2003 Share Posted October 8, 2003 I'm missing somthing here. I change the value to (int) as you showed and when I test the script it seems to work, the value entered is rounded down but the value increases unless update is pushed a second time. $Id: shopping_cart.php,v 1.73 2003/06/09 23:03:56 hpdl Exp $ Link to comment Share on other sites More sharing options...
TomThumb Posted October 14, 2003 Share Posted October 14, 2003 Great website..........Can you tell me how you got rid of the numbers from the category list? If you have not found it yet. Admin, Configuration, My Store, Show Category Counts False while (!succeed) {try()}; GMT -6:00 Link to comment Share on other sites More sharing options...
Guest Posted November 6, 2003 Share Posted November 6, 2003 Thank you , i had fix my shopping cart now :)) if anyone order quarter of cd from me :rolleyes: how am i going to ship :unsure: Link to comment Share on other sites More sharing options...
unitz Posted November 24, 2003 Share Posted November 24, 2003 thx alot 4 this, just wat i needed.. works like a baby :) Link to comment Share on other sites More sharing options...
peterx Posted November 27, 2003 Share Posted November 27, 2003 What is needed are units of measures for material pricing and delivery quantities. Common products such as shirts are sold in C62 (iso eaches) while others such as rope are sold in MTR (iso metres) Eaches materials are only sold in whole form while rope products may have decimal quantities eg. 2.5 metres at $40.40 per metre. This feature is common in supply chain solutions. Link to comment Share on other sites More sharing options...
sjd256 Posted November 28, 2003 Share Posted November 28, 2003 Arpit, That code modification works * but * although the item price shows the rounded price the sub-total does not show the right price i.e. 1 x widget @ ?29.99 Line Price = ?29.99 Sub-Total = ?29.99 1.5 x widget @ ?29.99 Line price=?29.99 Sub-Total = ?44.99 Any ideas would be greatly appreciated. Cheers Steve Link to comment Share on other sites More sharing options...
yogidegr8 Posted December 5, 2003 Share Posted December 5, 2003 My customer wants online one shoe.... He order 0.5 .... Hahahaha .. :blink: Link to comment Share on other sites More sharing options...
Guest Posted December 10, 2003 Share Posted December 10, 2003 Doesn't seem to work for me either :| I'm getting the same problems as above, in the line price it says a rounded up figure yet in totoal it accounts for the .x ?? Any help would be superb! Last thing I want is someone ordering 2.6 guitars :blink: Cheers Link to comment Share on other sites More sharing options...
jdelgado Posted December 11, 2003 Share Posted December 11, 2003 Hey, it ain't working for me either! Weird since all of you said it worked. This is what I wrote at line 149 following your instructions: $info_box_contents[$cur_row][] = array('align' => 'right', 'params' => 'class="productListing-data" valign="top"', 'text' => '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), (int)$products[$i]['quantity']) . '</b>'); Now when someone tries to buy 2.5 items of 10 euros each, the Total shows 20 euros ... but the Subtotal at the bottom of the shopping cart says 30 euros (that corresponds to the price of 2 and a half units), and if you browse around my webstore and then go the shopping cart it still will show you've ordered 2.5 units. :huh: So it is not working fine. I guess I've forgot to do something, right? But can think of what it is. Thanks in advance, Jose Delgado - - - - - - - - - - - - "I wish I were smart enough so I could end all my posts with one of those famous and brillant phrases!" J. Delgado, amateur philosopher (2003) Link to comment Share on other sites More sharing options...
logiczero Posted December 12, 2003 Share Posted December 12, 2003 On line 148 of catalog/shopping_cart.php, find: 'text' => tep_draw_input_field('cart_quantity[]', (int)$products[$i]['quantity']) and replace it with: 'text' => tep_draw_input_field('cart_quantity[]', (int)$products[$i]['quantity'], 'onBlur="this.value = parseInt(this.value);"') This causes the field to truncate its value to an integer when the user clicks outside of the field (i.e. when s/he clicks 'Update'). Link to comment Share on other sites More sharing options...
Guest Posted December 18, 2003 Share Posted December 18, 2003 i need this fix too... thanks a lot!! :) Link to comment Share on other sites More sharing options...
joeyjgarcia Posted December 18, 2003 Share Posted December 18, 2003 What about just displaying a message informing the customer that they are ordering a fractional quantity and disable the respective buttons until they fix it, unless, of course, fractional quantities are ok. Some say round up, others say round down, yet others say maybe they meant to have the decimal point moved to the right. This forces the customer to make the fix. Just a thought. Link to comment Share on other sites More sharing options...
ItsOnlyMe Posted December 31, 2003 Share Posted December 31, 2003 Logiczero, Thanks for the code bit, it works. However, the sizing doesn't work anymore. 'size="4"' I tried to put it before like tep_draw_input_field('cart_quantity[]', (int)$products[$i]['quantity'], 'size="4"','onBlur="this.value = parseInt(this.value);"' or after like tep_draw_input_field('cart_quantity[]', (int)$products[$i]['quantity'], 'onBlur="this.value = parseInt(this.value);"', 'size="4"') but it doesn't work. Sorry, I'm a Delhi guy & have no clue of php. Any idea how can I use your code fix, plus still be able to fix the input box size to 4? Cheers mate... :rolleyes: Link to comment Share on other sites More sharing options...
Guest Posted December 31, 2003 Share Posted December 31, 2003 tep_draw_input_field('cart_quantity[]', (int)$products[$i]['quantity'], 'size="4"','onBlur="this.value = parseInt(this.value);"' should be tep_draw_input_field('cart_quantity[]', (int)$products[$i]['quantity'], 'size="4" onBlur="this.value = parseInt(this.value);"' Hth, Matt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.