Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: common/lib/class.transaction.php
- ===================================================================
- --- common/lib/class.transaction.php (revision 6841)
- +++ common/lib/class.transaction.php (working copy)
- @@ -232,6 +232,7 @@
- $isFuzzy = false;
- $isGroupon720 = false;
- $isGroupon730 = false;
- + $isGiftCert = false;
- if( isset($this->tenderItems) ){
- foreach( $this->tenderItems as $tenderItem ) {
- if ($tenderItem instanceof PercentOffCouponTenderItem && ( strtolower($tenderItem->couponCode) == "fuzzy2011"
- @@ -251,6 +252,9 @@
- elseif ($tenderItem instanceof CouponTenderItem && (substr(strtolower($tenderItem->couponCode), 0, 7) == "grjul30") ) {
- $isGroupon730 = true;
- }
- + elseif ($tenderItem instanceof GiftCertificateTenderItem) {
- + $isGiftCert = true;
- + }
- }
- }
- @@ -427,6 +431,19 @@
- }
- }
- }
- + else if ( $isGiftCert ){
- + // mostly everything gets through! can't buy a gift cert with a gift cert though.
- + foreach($this->saleContexts as $context){
- + foreach ($context->items as $stockid => $item) {
- + if(!($context instanceof NonShipContext)){
- + if (in_array($item->id, $eligableStockIds)) {
- + // am i in the list of eligable ids?
- + $subTotal += ($item->price * $item->quantity);
- + }
- + }
- + }
- + }
- + }
- else{
- // DEFAULT promo rules, everything except the following items are eligible: gift certificate, clearance, dtg, muppets, unicef
- foreach($this->saleContexts as $context){
Add Comment
Please, Sign In to add comment