Jump to content



Latest News: (loading..)

- - - - -

All sites have this bug, so heres the fix


This topic has been archived. This means that you cannot reply to this topic.
54 replies to this topic

#1   Arpit

Arpit
  • Members
  • 68 posts

Posted 20 June 2003 - 12:50 PM

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,  

Quote

if ($this->in_cart($products_id)) {  
$this->update_quantity($products_id,

Quote

(int)
$qty, $attributes);

if you are using CVS2.2 then add (int) in catalog/shopping_cart.php around line 149

Quote

$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

#2   BirdBrain

BirdBrain
  • Members
  • 2,752 posts

Posted 20 June 2003 - 03:45 PM

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
Kim
~~~~~~~~~~~~~

#3   azer

azer
  • Members
  • 842 posts

Posted 21 June 2003 - 07:02 PM

i think that in the admin configuration u should be able to set this feature off or on ...
MS2

#4   jpf

jpf
  • Members
  • 977 posts

Posted 23 June 2003 - 08:02 PM

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.

#5   voided

voided
  • Members
  • 327 posts

Posted 04 July 2003 - 05:07 PM

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

#6   dreamscape

dreamscape
  • Members
  • 1,546 posts

Posted 05 July 2003 - 12:08 AM

Quote

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

#7   CookieBytes

CookieBytes
  • Members
  • 125 posts

Posted 08 July 2003 - 05:27 AM

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

#8   Aqua121

Aqua121
  • Members
  • 106 posts

Posted 12 July 2003 - 02:36 AM

Quote

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!

#9   johno692001

johno692001
  • Members
  • 2 posts

Posted 15 September 2003 - 12:14 AM

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)

#10   rekhis

rekhis
  • Members
  • 70 posts

Posted 16 September 2003 - 03:26 AM

Thanks Arpit, I am building my site and I needed this fix!

#11   raize

raize
  • Members
  • 26 posts

Posted 07 October 2003 - 08:54 PM

Great website..........Can you tell me how you got rid of the numbers from the category list?

#12   JohnnyGTO

JohnnyGTO
  • Members
  • 11 posts

Posted 08 October 2003 - 07:06 PM

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 $

#13   TomThumb

TomThumb
  • Members
  • 354 posts

Posted 14 October 2003 - 03:18 AM

raize, on Oct 7 2003, 08:54 PM, said:

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

#14   jaleel

jaleel
  • Members
  • 39 posts

Posted 06 November 2003 - 05:28 PM

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:

#15   unitz

unitz
  • Members
  • 9 posts

Posted 24 November 2003 - 01:18 PM

thx alot 4 this, just wat i needed.. works like a baby :)

#16   peterx

peterx
  • Members
  • 29 posts

Posted 27 November 2003 - 06:27 AM

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.

#17   sjd256

sjd256
  • Members
  • 94 posts

Posted 28 November 2003 - 04:06 AM

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

#18   yogidegr8

yogidegr8
  • Members
  • 128 posts

Posted 05 December 2003 - 06:04 PM

My customer wants online one shoe.... He order 0.5 .... Hahahaha .. :blink:

#19   plukkers.com

plukkers.com
  • Members
  • 18 posts

Posted 10 December 2003 - 05:20 PM

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

#20   jdelgado

jdelgado
  • Members
  • 74 posts

Posted 11 December 2003 - 06:37 PM

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)