ssafronova (ssafronova) wrote in changelog,
ssafronova
ssafronova
changelog

[ljcom] r9730: LJSUP-7379: We need display the note in ...

Committer: ssafronova
LJSUP-7379: We need display the note in the cart when the user gives a paid account
U   trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm
U   trunk/htdocs/pay/modify.bml.text.local
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm	2010-11-18 03:45:48 UTC (rev 9729)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/PaidAccount.pm	2010-11-18 05:14:08 UTC (rev 9730)
@@ -14,7 +14,7 @@
 sub disallowed_account_levels { return ('sponsored', 'perm'); }
 
 sub can_belong_to_special_cases {
-    my ($item, $cart) = @_;
+    my ($item, $cart, $errs_ref, $warns_ref, $action) = @_;
     
     my $u = LJ::want_user($item->{'rcptid'});
     
@@ -33,6 +33,14 @@
         return 0 unless $pricing->{'amount'};
     }
 
+    my $now = time;
+    if ($item->{'qty'} == 12 and $item->{'rcptid'} != $cart->get_userid and
+        $now >= $LJ::PAID_ACCOUNT_PROMO_TOKENS_START and $now < $LJ::PAID_ACCOUNT_PROMO_TOKENS_END) {
+        push @$warns_ref, LJ::Lang::ml('/pay/modify.bml.warning.give_more_2010', 
+                                          { touser => LJ::ljuser($u), 
+                                            count => $LJ::PAID_ACCOUNT_PROMO_TOKENS_AMOUNT } );
+    }
+
     return 1;
 }
 

Modified: trunk/htdocs/pay/modify.bml.text.local
===================================================================
--- trunk/htdocs/pay/modify.bml.text.local	2010-11-18 03:45:48 UTC (rev 9729)
+++ trunk/htdocs/pay/modify.bml.text.local	2010-11-18 05:14:08 UTC (rev 9730)
@@ -277,6 +277,8 @@
 .warning.delivery.date.deleted|staleness=1
 .warning.delivery.date.deleted=Specified delivery date is ignored, since it is determined by dates of paid account
 
+.warning.give_more_2010=Give more! Your gift of 12 months of Paid account time to [[touser]] comes with [[count]] LJ Tokens. [[touser]] will receive [[count]] LJ Tokens in their account.
+
 .warning.paid.time.will.expire.dated|staleness=1
 .warning.paid.time.will.expire.dated=Your paid account will expire on [[date]], before [[item]] will do. So part of the add-on may not be used unless you'll extend your paid account. Unused add-on time will be frozen and can be reused later.
 

Tags: ljcom, local, pm, ssafronova
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments