logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
judy at Web2Market  
#1 Posted : Wednesday, October 26, 2022 10:06:34 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
On the product page, the customer can click the Notify when this is available button with a blank email and there is no error message displayed to customer. Just another error for the merchant to have to troubleshoot in the error log.

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

nadeem  
#2 Posted : Wednesday, October 26, 2022 12:28:18 PM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 110

Thanks: 19 times
Was thanked: 18 time(s) in 18 post(s)
I am able to reproduce the issue. The NotifyEmailAddress property is missing the Required attribute.

To fix this, locate the following line of code inside /Website/Models/ProductModels.cs RestockNotificationSignup model class

Code:

[EmailAddress(ErrorMessage = "Email address should be in the format of name@domain.tld.")]
public string NotifyEmailAddress { get; set; }


and replace with


Code:

[RequiredIf("ShowRestockNotifications", ErrorMessage = "Notify email address is required.")]
[RegularExpression(@"^ *[A-Za-z0-9._%+-]+@([A-Za-z0-9-]+\.)+[A-Za-z]{2,63} *$", ErrorMessage = "Email address should be in the format of name@domain.tld.")]
public string NotifyEmailAddress { get; set; }

public bool ShowRestockNotifications { get; set; }

Edited by user Monday, January 9, 2023 5:13:55 AM(UTC)  | Reason: Not specified

nadeem  
#3 Posted : Wednesday, October 26, 2022 12:38:54 PM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 110

Thanks: 19 times
Was thanked: 18 time(s) in 18 post(s)
I have reported the issue to be fixed in a future version.
judy at Web2Market  
#4 Posted : Monday, October 31, 2022 10:07:50 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Thanks for the quick fix!
judy at Web2Market  
#5 Posted : Monday, October 31, 2022 10:32:48 AM(UTC)
judy at Web2Market

Rank: Advanced Member

Groups: Developers
Joined: 11/7/2018(UTC)
Posts: 303

Thanks: 21 times
Was thanked: 5 time(s) in 5 post(s)
Well... this didn't work out on products that have kits.
I tested this on your build a new pet care package. When you change a selection in the kit options, like Dogs- change to Tennis Ball Red/Yellow. The error message Notify email address is required shows.
2022-10-31_11-32-14.png (41kb) downloaded 1 time(s).
nadeem  
#6 Posted : Tuesday, January 3, 2023 10:04:06 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 110

Thanks: 19 times
Was thanked: 18 time(s) in 18 post(s)
Judy,

Sorry for getting back too late on this. I somehow missed the notification. Any ways, you can fix the Kit issue by updating the code in BuyProductDialog post action method:

Locate the following line of code inside

Code:
int totalReviews = _reviewRepo.SearchCount(product.Id, BitFieldState.True);


and replace with

Code:
else
{
    ModelState.Remove("NotifyEmailAddress");
}

int totalReviews = _reviewRepo.SearchCount(product.Id, BitFieldState.True);
Users browsing this topic
Guest (6)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.