Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 46f3d367

Von Sven Schöling vor etwa 2 Jahren hinzugefügt

  • ID 46f3d3679867378aa4895ffef8cafc6e7ced7da8
  • Vorgänger 9b3a3d6c
  • Nachfolger d25efb1a

PriceRule: Unterstützung für ShipTo CVars und Absicherung gegen unbekannte CVar Module

Die Existenz von RequirementSpecs CVars macht jetzt nicht mehr die
Preisregeln kaputt

Unterschiede anzeigen:

SL/DB/Manager/PriceRuleItem.pm
# we only generate cvar types for cvar price_rules that are actually used to keep the query smaller
# these are cached per request
sub generate_cvar_types {
my $cvar_configs = SL::DB::Manager::CustomVariableConfig->get_all;
my @supported_cvar_modules = qw(CT Contacts IC Projects ShipTo);
my $cvar_configs = SL::DB::Manager::CustomVariableConfig->get_all(query => [ module => \@supported_cvar_modules ]);
my @types;
......
$_[0]->contact ? $_[0]->contact->cvar_by_name($config->name)->value : undef
);
},
ShipTo => sub {
raw_value(
$_[0]->custom_shipto ? $_[0]->custom_shipto->cvar_by_name($config->name)->value :
$_[0]->shipto ? $_[0]->shipto->cvar_by_name($config->name)->value : undef
);
},
);
my $data_type;

Auch abrufbar als: Unified diff