Profile: Jon

Statistics
Avatar
  • 23
UPS Tracking

Sounds good. Thanks!

Thursday, October 3, 2019 2:00 PM
UPS Tracking

Thanks! Will this plugin track packages automatically and update the shipment status in Grandnode?

Wednesday, October 2, 2019 2:05 PM
UPS Tracking

I need to update shipping status from UPS tracking number. Looks like the UPS plugin on github is about three years old. Is there an already existing plugin that can help me automate this process?

Tuesday, October 1, 2019 3:53 PM

OH! You are right.

Apparently the number 1 is *higher* than the number 2.

Who knew!?!?

Thanks again for the quick and accurate response, Patryk.

Tuesday, September 24, 2019 3:18 PM

CustomerViewModelService is registered in Grand.Web.Infrastructure.DependencyRegistrar with Order of 2.

Tuesday, September 24, 2019 3:11 PM

Order is 1. I've also tried:

public int Order => int.MinValue;

Tuesday, September 24, 2019 2:58 PM

Maybe screenshots are better.





Monday, September 23, 2019 6:20 PM

Let's try this again.


    public class DependencyRegistrar : IDependencyRegistrar
    {
        public int Order => 1;
        public void Register(ContainerBuilder builder, ITypeFinder typeFinder, GrandConfig config)
        {
            builder.RegisterType<OverrideCustomerService>().As<ICustomerService>().InstancePerLifetimeScope();
            builder.RegisterType<OverrideCustomerViewModelService>().As<ICustomerViewModelService>().InstancePerLifetimeScope();
        }
    }



    // this works just fine
    public class OverrideCustomerService : CustomerService, ICustomerService
    {
        public OverrideCustomerService(ICacheManager cacheManager, IRepository<Customer> customerRepository, IRepository<CustomerRole> customerRoleRepository, IRepository<CustomerProduct> customerProductRepository, IRepository<CustomerProductPrice> customerProductPriceRepository, IRepository<CustomerHistoryPassword> customerHistoryPasswordProductRepository, IRepository<CustomerRoleProduct> customerRoleProductRepository, IRepository<CustomerNote> customerNoteRepository, IRepository<Order> orderRepository, IRepository<ForumPost> forumPostRepository, IRepository<ForumTopic> forumTopicRepository, IRepository<BlogComment> blogCommentRepository, IRepository<ProductReview> productReviewRepository, IGenericAttributeService genericAttributeService, IMediator mediator, IServiceProvider serviceProvider)
            : base(cacheManager, customerRepository, customerRoleRepository, customerProductRepository, customerProductPriceRepository, customerHistoryPasswordProductRepository, customerRoleProductRepository, customerNoteRepository, orderRepository, forumPostRepository, forumTopicRepository, blogCommentRepository, productReviewRepository, genericAttributeService, mediator, serviceProvider)
        {
            Console.WriteLine("CustomerService override success");
        }
    }


[code]
    // this does not work, break point is never hit
    public class OverrideCustomerViewModelService : CustomerViewModelService, ICustomerViewModelService
    {
        public OverrideCustomerViewModelService(IExternalAuthenticationService externalAuthenticationService, ICustomerAttributeParser customerAttributeParser, ICustomerAttributeService customerAttributeService, ILocalizationService localizationService, IDateTimeHelper dateTimeHelper, INewsLetterSubscriptionService newsLetterSubscriptionService, IWorkContext workContext, IStoreContext storeContext, ICountryService countryService, IStateProvinceService stateProvinceService, IGenericAttributeService genericAttributeService, IWorkflowMessageService workflowMessageService, IReturnRequestService returnRequestService, IStoreMappingService storeMappingService, IAddressViewModelService addressViewModelService, IOrderService orderService, IDownloadService downloadService, IPictureService pictureService, IProductService productService, IAuctionService auctionService, INewsletterCategoryService newsletterCategoryService, IServiceProvider serviceProvider, CustomerSettings customerSettings, DateTimeSettings dateTimeSettings, TaxSettings taxSettings, ForumSettings forumSettings, ExternalAuthenticationSettings externalAuthenticationSettings, SecuritySettings securitySettings, CaptchaSettings captchaSettings, RewardPointsSettings rewardPointsSettings, OrderSettings orderSettings, MediaSettings mediaSettings, VendorSettings vendorSettings) : base(externalAuthenticationService, customerAttributeParser, customerAttributeService, localizationService, dateTimeHelper, newsLetterSubscriptionService, workContext, storeContext, countryService, stateProvinceService, genericAttributeService, workflowMessageService, returnRequestService, storeMappingService, addressViewModelService, orderService, downloadService, pictureService, productService, auctionService, newsletterCategoryService, serviceProvider, customerSettings, dateTimeSettings, taxSettings, forumSettings, externalAut

Monday, September 23, 2019 6:16 PM

I'd like to override Grand.Web.Services.CustomerViewModelService and override one of the virtual methods. I see that you can do this with other services like CustomerService, and in fact it works well. But when I override CustomerViewModelService, my class is never instantiated.


    // this works just fine
    public class OverrideCustomerService : CustomerService, ICustomerService
    {
        public OverrideCustomerService(ICacheManager cacheManager, IRepository<Customer> customerRepository, IRepository<CustomerRole> customerRoleRepository, IRepository<CustomerProduct> customerProductRepository, IRepository<CustomerProductPrice> customerProductPriceRepository, IRepository<CustomerHistoryPassword> customerHistoryPasswordProductRepository, IRepository<CustomerRoleProduct> customerRoleProductRepository, IRepository<CustomerNote> customerNoteRepository, IRepository<Order> orderRepository, IRepository<ForumPost> forumPostRepository, IRepository<ForumTopic> forumTopicRepository, IRepository<BlogComment> blogCommentRepository, IRepository<ProductReview> productReviewRepository, IGenericAttributeService genericAttributeService, IMediator mediator, IServiceProvider serviceProvider)
            : base(cacheManager, customerRepository, customerRoleRepository, customerProductRepository, customerProductPriceRepository, customerHistoryPasswordProductRepository, customerRoleProductRepository, customerNoteRepository, orderRepository, forumPostRepository, forumTopicRepository, blogCommentRepository, productReviewRepository, genericAttributeService, mediator, serviceProvider)
        {
            Console.WriteLine("CustomerService override success");
        }
    }


[code]
    // this does not work, break point is never hit
    public class OverrideCustomerViewModelService : CustomerViewModelService, ICustomerViewModelService
    {
        public OverrideCustomerViewModelService(IExternalAuthenticationService externalAuthenticationService, ICustomerAttributeParser customerAttributeParser, ICustomerAttributeService customerAttributeService, ILocalizationService localizationService, IDateTimeHelper dateTimeHelper, INewsLetterSubscriptionService newsLetterSubscriptionService, IWorkContext workContext, IStoreContext storeContext, ICountryService countryService, IStateProvinceService stateProvinceService, IGenericAttributeService genericAttributeService, IWorkflowMessageService workflowMessageService, IReturnRequestService returnRequestService, IStoreMappingService storeMappingService, IAddressViewModelService addressViewModelService, IOrderService orderService, IDownloadService downloadService, IPictureService pictureService, IProductService productService, IAuctionService auctionService, INewsletterCategoryService newsletterCategoryService, IServiceProvider serviceProvider, CustomerSettings customerSettings, DateTimeSettings dateTimeSettings, TaxSettings taxSettings, ForumSettings forumSettings, ExternalAuthenticationSettings externalAuthenticationSettings, SecuritySettings securitySettings, CaptchaSettings captchaSettings, RewardPointsSettings rewardPointsSettings, OrderSettings orderSettings, MediaSettings mediaSettings, VendorSettings vendorSettings) : base(externalAuthenticationService, customerAttributeParser, customerAttributeService, localizationService, dateTimeHelper, newsLetterSubscriptionService, workContext, storeContext, countryService, stateProvinceService, genericAttributeService, workflowMessageService, returnRequestService, storeMappingService, addressViewModelService, orderService, downloadService, pictureService, productService, auctionService, newsletterCategoryService, serviceProvider, customerSettings, dateTimeSettings, taxSettings, forumSettings, externalAuthenticationSettings, securitySettings, captchaSettings, rewardPointsSettings, orderSettings, mediaSettings, vendorSettings)
        {
            Console.WriteLine("OverrideCustomerViewModelService success");
        }
  

Monday, September 23, 2019 6:15 PM

I'm very curious to see the correct way to fix this problem. I have a similar product autocomplete requirement in a plugin that I'm working on in-house and I've simply copied the entire ProductSearchAutoComplete() method into my controller as a quick and dirty workaround. It works but I don't like it.

Wednesday, September 11, 2019 2:38 PM