nopCommerce 3.4 - Pick Up in Store discount

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
Hi,

In addition to the regular shipping methods we're using, the client would like to give a discount (in % of the total order) for people who will pick up the order from the store.

Is that possible ? Could not find this option.
9 years ago
You can implement it as a new plugin (disocunt requirement rule). Just check whether "pick up in store" has been selected by a customer
9 years ago
Sorry,
Can you please give me more details where to start from ?

Is it a shipping method ?
Should I overrider the Promotions Discounts ?
Have no clue from where to begin.
9 years ago
Please have a look at some existing discount requirement plugins. For example, Nop.Plugin.DiscountRules.CustomerRoles or Nop.Plugin.DiscountRules.HadSpentAmount

Also have a look at the following tutorial - How to write a nopCommerce plugin
9 years ago
Hello,

I saw that the Pick Up option is set in the IGenericAttributeService .
How can I access this service from within the Plugin ?


Thanks
9 years ago
ran2010 wrote:
Hello,

I saw that the Pick Up option is set in the IGenericAttributeService .
How can I access this service from within the Plugin ?


Thanks

You can do it absolutely the same way as it's used in Nop.Web or other projects. Just add (inject) appropriate services and use them
9 years ago
Sure, but what service stores whether the customer selected the Pick Up option ?
9 years ago
This how it's implemented:
bool pickUpInStore = _shippingSettings.AllowPickUpInStore && _workContext.CurrentCustomer.GetAttribute<bool>(SystemCustomerAttributeNames.SelectedPickUpInStore, _storeContext.CurrentStore.Id);
6 years ago
a.m. wrote:
This how it's implemented:
bool pickUpInStore = _shippingSettings.AllowPickUpInStore && _workContext.CurrentCustomer.GetAttribute<bool>(SystemCustomerAttributeNames.SelectedPickUpInStore, _storeContext.CurrentStore.Id);


Is this still valid? SelectedPickUpInStore seems to be not valid for 3.9?
How can I know if the customer selected pickup point rather than shipping option?
6 years ago
Tokaichan wrote:
This how it's implemented:
bool pickUpInStore = _shippingSettings.AllowPickUpInStore && _workContext.CurrentCustomer.GetAttribute<bool>(SystemCustomerAttributeNames.SelectedPickUpInStore, _storeContext.CurrentStore.Id);


Is this still valid? SelectedPickUpInStore seems to be not valid for 3.9?
How can I know if the customer selected pickup point rather than shipping option?


Try===>Hope it will work for you. Please test it & let me know know.

                    bool pickUpInStore = _shippingSettings.AllowPickUpInStore && _workContext.CurrentCustomer.GetAttribute<PickupPoint>(SystemCustomerAttributeNames.SelectedPickupPoint, _storeContext.CurrentStore.Id)!=null;
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.