Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] Negative Prices and a Solution



******    message to minivend-users from Chris Rapier <rapier@psc.edu>     ******

I had a situation where new customers were geting a straight $5 off
their orders. This, unfortunately, led to the possibility that my
clients would end up owing their customers money. Not a good situation
to be in. I was working on a couple ways to attack this but settled on
actually modifying Interpolate.pm. However, I wanted a general solution
so that I wasn't locked into using this hack. 

So I added the following lines to Interpolate.pm in the subtotal
subroutine.

	if (($::Scratch->{no_neg_prices})  && ($subtotal < 0)) {
	  $subtotal = 0;
	}

This requires that you include [set no_neg_prices]1[/set] somewhere on
the site. I put it on the basket page as all orders have to pass through
there. 

I've included a diff for those that are interested in applying this
against 4.03. I'm not sure if Mike updated anything in Interpolate.pm
for 4.04. 

5165,5169d5164
< 
<       if (($::Scratch->{no_neg_prices})  && ($subtotal < 0)) {
<         $subtotal = 0;
<       }
< 

If anyone finds a bug with this or has a solution that doesn't involve
hacing Interpolate.pm please let me know.

Chris Rapier
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: