Prevent the Subscription from showing the redeem code label and URL unless there are codes
This commit is contained in:
parent
68db4f8e46
commit
8be5eeb5f6
4 changed files with 15 additions and 10 deletions
|
|
@ -25,6 +25,7 @@
|
|||
- fixed: Shop: Variants in dropdown and on page
|
||||
- fixed: OLD subscription table still hanging around?
|
||||
- fixed: Shelf
|
||||
- fixed: Subscriptions and redemption
|
||||
|
||||
7.5.12
|
||||
- skipping this release
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ sub redeemCode {
|
|||
my $self = shift;
|
||||
my $code = shift;
|
||||
my $session = $self->session;
|
||||
my $i18n = my $i18n = WebGUI::International->new($session, "Asset_Subscription");
|
||||
my $i18n = WebGUI::International->new($session, "Asset_Subscription");
|
||||
|
||||
my $properties = $self->getCode( $code );
|
||||
|
||||
|
|
@ -509,9 +509,13 @@ sub view {
|
|||
'<a href="'.$self->getUrl('func=listSubscriptionCodes') .'">'.$i18n->get('manage codes').'</a>',
|
||||
'<a href="'.$self->getUrl('func=listSubscriptionCodeBatches') .'">'.$i18n->get('manage batches').'</a>',
|
||||
)),
|
||||
redeemCodeLabel => $i18n->get('redeem code'),
|
||||
redeemCodeUrl => $self->getUrl('func=redeemSubscriptionCode'),
|
||||
);
|
||||
my $hasCodes = $self->session->db->quickScalar('select count(*) from Subscription_code as t1, Subscription_codeBatch as t2 where t1.batchId = t2.batchId and t2.subscriptionId=?', [$self->getId]);
|
||||
if ($hasCodes) {
|
||||
$var{redeemCodeLabel} = $i18n->get('redeem code');
|
||||
$var{redeemCodeUrl} = $self->getUrl('func=redeemSubscriptionCode');
|
||||
|
||||
}
|
||||
return $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -473,14 +473,14 @@ The form in which the user can enter his subscription code.<br />|,
|
|||
},
|
||||
|
||||
'redeemCodeLabel' => {
|
||||
message => q|An internationalized label for the link to redeem a subscription code.|,
|
||||
lastUpdated => 0,
|
||||
message => q|An internationalized label for the link to redeem a subscription code. If there are no subscription codes, this will be blank|,
|
||||
lastUpdated => 1213936319,
|
||||
context => q|template variable|
|
||||
},
|
||||
|
||||
'redeemCodeUrl' => {
|
||||
message => q|The URL to redeem a subscription code.|,
|
||||
lastUpdated => 0,
|
||||
message => q|The URL to redeem a subscription code. If there are no subscription codes, this will be blank.|,
|
||||
lastUpdated => 1213936341,
|
||||
context => q|template variable|
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -159,17 +159,17 @@ is($item->get("price"), 33, "set and get price");
|
|||
|
||||
$item->update({
|
||||
shippingTrackingNumber => 'adfs',
|
||||
shippingStatus => 'BackOrdered',
|
||||
orderStatus => 'BackOrdered',
|
||||
});
|
||||
|
||||
is($item->get("shippingTrackingNumber"), 'adfs', "update and get shipping tracking number");
|
||||
is($item->get("shippingStatus"), 'BackOrdered', "update and get shipping status");
|
||||
is($item->get("orderStatus"), 'BackOrdered', "update and get shipping status");
|
||||
|
||||
# make sure shipping date is updated when shipping status is changed
|
||||
like($item->get("shippingDate"), qr/\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/, "shipping date is set");
|
||||
my $dateNow = $item->get('shippingDate');
|
||||
sleep(1);
|
||||
$item->update({shippingStatus=>'Cancelled'});
|
||||
$item->update({orderStatus=>'Cancelled'});
|
||||
isnt($item->get('shippingDate'), $dateNow, 'shipping date is updated');
|
||||
|
||||
# make sure new() works
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue