Revision 578

Date:
2016/06/15 12:23:53
Author:
ahitrov
Revision Log:
Additional check during coupon merging.
Payment info in order form

Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/plugins/webshop/comps/contenido/webshop/components/order_form.msn

     
    157 157
    158 158 <& /contenido/webshop/components/order_list.msn, order => $object, filter_params => $filter_params, context => $context &>
    159 159
    160 % if ( (grep { $_ eq 'payments' } split /\s+/, $state->plugins) && ($active_rights == 0 || $active_rights == 1) ) {
    161 <h2>Онлайн-оплата:</h2>
    162 <& /contenido/payments/components/order_actions.msn, order_id => $object->id &>
    163 % }
    160 164
    161
    162 165 </table>
    163 166 </td></tr></table>
    164 167
     
    210 213 <%INIT>
    211 214 return undef unless ref($object);
    212 215
    216 my $active_rights = $m->comp('/contenido/webshop/subs/user_rights.msn');
    213 217 my $action = $context eq 'facil' ? 'facility.html' : $context eq 'post' ? 'delivery.html' : 'take_care.html';
    214 218 my $toopi = $project->$proto();
    215 219 my $options = {};
  • utf8/plugins/webshop/lib/webshop/Keeper.pm

     
    446 446 session => $opts{session},
    447 447 source_id => 0,
    448 448 );
    449 my %merge_to = $keeper->get_links (
    449 my $merge_to = $keeper->get_links (
    450 450 class => 'webshop::OrderCouponLink',
    451 451 uid => $opts{uid},
    452 452 source_id => 0,
    453 return_mode => 'hash',
    454 hash_by => 'dest_id',
    453 return_mode => 'array_ref',
    455 454 );
    455 my %merge_to;
    456 foreach my $link ( @$merge_to ) {
    457 if ( exists $merge_to{$link->dest_id} ) {
    458 $link->delete;
    459 } else {
    460 $merge_to{$link->dest_id} = $link;
    461 }
    462 }
    456 463 foreach my $item ( @items ) {
    457 464 if ( exists $merge_to{$item->dest_id} ) {
    458 465 $item->delete;