Skip to content

Commit

Permalink
Updating code from issues on Github
Browse files Browse the repository at this point in the history
  • Loading branch information
YodasMyDad committed Jul 12, 2019
1 parent 48c8c79 commit 6591429
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/Merchello.Mui.Client/src/jquery/mui/modules/labels/labels.js
Expand Up @@ -12,9 +12,20 @@ MUI.Labels = {
basketItemCount: function(evt, args) {
if (args.Success) {
var label = $('[data-muilabel="basketcount"]');
var $quickcheckout = $('[data-value="quickcheckout"]');
if (label.length > 0) {
$(label).html(args.ItemCount);
// If there's a quick checkout menu item show or hide it according to basket count.
if ($quickcheckout.length > 0) {
if (args.ItemCount != 0) {
$quickcheckout.removeClass('mui-quickcheckout');
}
else {
$quickcheckout.addClass('mui-quickcheckout');
}
}
}

}
}
}
Expand Down
15 changes: 11 additions & 4 deletions src/Merchello.Web/CustomerContext.cs
Expand Up @@ -111,12 +111,19 @@ protected override string GetMembershipProviderKey()
/// </param>
protected override void EnsureCustomerCreationAndConvertBasket(ICustomerBase customer)
{
if (!customer.IsAnonymous) return;
if (!customer.IsAnonymous)
{
return;
}

var memberId = Convert.ToInt32(this.MembershipProviderKey(customer.Key));
var member = _memberService.GetById(memberId);
var membershipProviderKey = this.MembershipProviderKey(customer.Key);
if (!int.TryParse(membershipProviderKey, NumberStyles.None, CultureInfo.InvariantCulture, out var memberId))
{
return;
}

if (MerchelloConfiguration.Current.CustomerMemberTypes.Any(x => x == member.ContentTypeAlias))
var member = _memberService.GetById(memberId);
if (member != null && MerchelloConfiguration.Current.CustomerMemberTypes.Any(x => x == member.ContentTypeAlias))
{
base.EnsureCustomerCreationAndConvertBasket(customer);
}
Expand Down

0 comments on commit 6591429

Please sign in to comment.