holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[ljcom] r11411: LJSUP-11099: LJ Shop. Change LJ Tokens m...

Committer: akanashin
LJSUP-11099: LJ Shop. Change LJ Tokens mechanics
U   trunk/cgi-bin/LJ/Pay/Payment/PayItem/WalletTokens.pm
U   trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm
U   trunk/templates/Shop/Wallet.tmpl
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/WalletTokens.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem/WalletTokens.pm	2012-02-06 11:38:04 UTC (rev 11410)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/WalletTokens.pm	2012-02-06 12:00:35 UTC (rev 11411)
@@ -5,16 +5,6 @@
 
 use base qw(LJ::Pay::Payment::PayItem);
 
-use constant {
-    PACKAGES => {
-        500 => 5,
-        1000 => 9,
-        3000 => 25,
-    },
-
-    PACKAGES_ORDER => [ 3000, 1000, 500 ],
-};
-
 sub item { 'tokens' }
 
 sub get_product_name {
@@ -33,10 +23,7 @@
 
 sub calculate_price {
     my ($self) = @_;
-
-    $self->{'amt'} =
-        PACKAGES->{$self->get_qty} ||
-        ($self->get_qty / LJ::Pay::Wallet::EXCHANGE_RATE());
+    $self->{'amt'} = ($self->get_qty / LJ::Pay::Wallet::EXCHANGE_RATE());
     return $self->{'amt'};
 }
 

Modified: trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm	2012-02-06 11:38:04 UTC (rev 11410)
+++ trunk/cgi-bin/LJ/Widget/Shop/View/Wallet.pm	2012-02-06 12:00:35 UTC (rev 11411)
@@ -25,8 +25,6 @@
 
             my @items = $cart->get_items;
             my ($item) = @items;
-            my $tokens_code = LJ::Pay::Payment::PayItem::WalletTokens->item;
-            die unless $item && $item->get_item eq $tokens_code;
 
             my $rcptid = $items[0]->get_rcptid;
             my $rcpt_ljuser = LJ::load_userid($rcptid)->ljuser_display;
@@ -47,21 +45,6 @@
 
     my $balance = int eval { LJ::Pay::Wallet->get_user_balance($remote) };
 
-    my %packages = %{LJ::Pay::Payment::PayItem::WalletTokens::PACKAGES()};
-    my @order = @{LJ::Pay::Payment::PayItem::WalletTokens::PACKAGES_ORDER()};
-
-    my $buy_select_options = [
-        map { {
-            'value' => $_, 
-            'text'  => LJ::Lang::ml(
-                'wallet.bml.landing.package_description', {
-                    'qty' => $_,
-                    'amt' => sprintf ("%.2f", $packages{$_}),
-                }
-            )
-        } } @order,
-    ];
-
     my $amt_input = LJ::html_text({
         'name' => 'send_amt',
         'id' => 'send_amt',
@@ -135,7 +118,6 @@
         'tab_send_active' => $show_tab eq 'send',
         'tab_tokens_free' => $show_tab eq 'free',
 
-        'buy_select_options' => $buy_select_options,
         'proceed_buy_btn' => $proceed_buy_btn,
         'proceed_offerpal_btn' => $proceed_offerpal_btn,
         'amt_input' => $amt_input,
@@ -187,9 +169,6 @@
     if ($act eq 'buy') {
         my $qty = LJ::Request->post_param('buy_select');
 
-        $self->ml_error('error.invalidform')
-            unless $qty =~ /^(?:500|1000|3000)$/;
-
         my $it;
 
         eval {

Modified: trunk/templates/Shop/Wallet.tmpl
===================================================================
--- trunk/templates/Shop/Wallet.tmpl	2012-02-06 11:38:04 UTC (rev 11410)
+++ trunk/templates/Shop/Wallet.tmpl	2012-02-06 12:00:35 UTC (rev 11411)
@@ -45,11 +45,7 @@
 		<form action="<TMPL_VAR self_uri>" method="post">
 		<TMPL_VAR form_auth>
 		<input type="hidden" name="act" value="buy">
-		<ul class="b-wallet-tokens-select">
-			<TMPL_LOOP name="buy_select_options">
-				<li class="b-wallet-tokens-select-item b-wallet-tokens-select-<TMPL_VAR value><TMPL_IF __first__> current</TMPL_IF>"><label for="buy_select_<TMPL_VAR value>"><i></i><strong><TMPL_VAR text></strong><input type="radio" name="buy_select" id="buy_select_<TMPL_VAR value>" value="<TMPL_VAR value>"<TMPL_IF __first__> checked="checked"</TMPL_IF> /></label></li>
-			</TMPL_LOOP>
-		</ul>
+		<input type="text" name="buy_select">
 		<TMPL_VAR buy_select>
 		<p><TMPL_VAR proceed_buy_btn></p>
 		</form>

Tags: akanashin, holyandrew, ljcom, pm, tmpl
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