Guest User

Untitled

a guest
Nov 20th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. Index: common/lib/class.transaction.php
  2. ===================================================================
  3. --- common/lib/class.transaction.php (revision 6841)
  4. +++ common/lib/class.transaction.php (working copy)
  5. @@ -232,6 +232,7 @@
  6. $isFuzzy = false;
  7. $isGroupon720 = false;
  8. $isGroupon730 = false;
  9. + $isGiftCert = false;
  10. if( isset($this->tenderItems) ){
  11. foreach( $this->tenderItems as $tenderItem ) {
  12. if ($tenderItem instanceof PercentOffCouponTenderItem && ( strtolower($tenderItem->couponCode) == "fuzzy2011"
  13. @@ -251,6 +252,9 @@
  14. elseif ($tenderItem instanceof CouponTenderItem && (substr(strtolower($tenderItem->couponCode), 0, 7) == "grjul30") ) {
  15. $isGroupon730 = true;
  16. }
  17. + elseif ($tenderItem instanceof GiftCertificateTenderItem) {
  18. + $isGiftCert = true;
  19. + }
  20. }
  21. }
  22.  
  23. @@ -427,6 +431,19 @@
  24. }
  25. }
  26. }
  27. + else if ( $isGiftCert ){
  28. + // mostly everything gets through! can't buy a gift cert with a gift cert though.
  29. + foreach($this->saleContexts as $context){
  30. + foreach ($context->items as $stockid => $item) {
  31. + if(!($context instanceof NonShipContext)){
  32. + if (in_array($item->id, $eligableStockIds)) {
  33. + // am i in the list of eligable ids?
  34. + $subTotal += ($item->price * $item->quantity);
  35. + }
  36. + }
  37. + }
  38. + }
  39. + }
  40. else{
  41. // DEFAULT promo rules, everything except the following items are eligible: gift certificate, clearance, dtg, muppets, unicef
  42. foreach($this->saleContexts as $context){
Add Comment
Please, Sign In to add comment