Payment Director - Pay In Store available only for In-Store Pickup

Prior to nopCommerce 3.40,  "In-Store Pickup" was Shipping Method and the customer had to select or enter a shipping address just to be able to get to the Shipping Methods page (or tab in One-Page Checkout).   "In-Store Pickup" has now moved to the Shipping Address page.  You can enable this by checking the '"Pick Up in Store" enabled:' option on the Configuration > Settings > Shipping Settings page.

If you have several payment options including "Pay In Store", you may want to only show "Pay In Store" if the customer selected "In Store Pickup".  Payment Director can handle this:

Order

Type

Name

Expression

Fee Expression

20

Option

Payments.PayInStore

ShippingOptionName = "In-Store Pickup"

 

Be sure to activate all the Payment Methods you want to offer, and then you only need to enter the one conditional Option above.   Any Options not indicated in the Payment Director configuration page will always show unconditionaly.

If you have multiple languages, you can access the Locale Resource String for the In-Store Pickup Shipping Method Name.  (This is also the shipping name you see on the Order).  Use Payment Director's GetLocaleString method:

Order

Type

Name

Expression

Fee Expression

10

String

In-Store Pickup

GetLocaleString("Checkout.PickUpInStore.MethodName")

 

20

Option

Payments.PayInStore

ShippingOptionName = [In-Store Pickup]

 

Additionally, if you want to show a payment method, but have it disabled so that the customer can't select it, Payment Director includes replacements for the Checkout Views that allow you to do that.  They also will let you show replacement text for the Friendly Name.  For example, if you want to still show the "Pay In Store" option, but don't want to the customer to be able to select it, and also for the description, show "(Pay In Store available only for In-Store Pickup)" rather than just "Pay In Store", you can set up a localized resource string for the text, and set up a Condition in the Friendly Name Expression:










  

Order

Type

Name

Expression

Friendly Name Expression

10

String

In-Store Pickup

GetLocaleString("Checkout.PickUpInStore.MethodName")

 

20

String

In-Store Pickup Hint

GetLocaleString("Checkout.InStorePickupHint")

 

30

Boolean

In-Store Pickup Selected

ShippingOptionName = [In-Store Pickup]

 

20

Option

Payments.PayInStore

[In-Store Pickup Selected] ? Show : Disabled

[In-Store Pickup Selected] ? "" : [In-Store Pickup Hint]

You can download the above configuration that you can then import into Payment Director.  You will find the replacement Views in the \Views subfolder in the download .zip file.  (Read the Readme.txt file in the .zip file.)

Tags :  PD-Restrict
Comments
Leave your comment
:
sample@email.tst
Created on: 6/26/2023 5:32 PM
1