Hide shipping method depending on payment method

  • Posts: 259
  • Thank you received: 10
8 years 2 months ago #249078

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- PHP version -- : 7.0.10

Hi there, i have a certain situation.

Payment methods:

wire transfer
Pickup at store (cash on delivery, with modified text)
paypal (currently disabled)

Shipping methods
Pickup (manual shipping) <== also currently shows free shipping
kiala (manual shipping)
bpost (manual shipping, until amount of parcels is large enough to use the plugin)

First a little bit of info. I've changed the order sequence to show payment method BEFORE shipping method.

Now here's the question, is it possible to hide the shipping methods "kiala" and "bpost" when the user selects the payment method "pickup at store"? Because when the user selects to pay at the store, there's obviously no shipping (thus those methods need to be hidden)

How do i remove the "free shipping" message from the shipping method? I know this can probably be done by a language override and remove the "free shipping" text, but that will probably also affect the cases where free shipping really would be offered

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 2 months ago #249092

Hi,

1. There is no option to do that. That would require custom javascript code to be added to handle that, but that's not easy.
A way simpler solution would be to do the opposite: The customer selects the shipping method he wants, and then the payment method is automatically selected for him based on that.
You can do that thanks to the "shipping methods" restriction setting of your payment methods.

2. Indeed, you can use a translation override. The "free shipping" is displayed instead of 0.00€. So you can edit the file "shipping" of the view "checkout" via the menu Display>Views and change that line:
$price_text = JText::_('FREE_SHIPPING');
with some custom code to display free shipping, or something else, based on the type of the shipping method.

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
8 years 2 months ago #249100

1. That'll work too as long as long the payment method 'pay in store' is shown when the user opts for store pickup and the others hidden, one way or another. Please advise on how I can do that.

2. A language override isn't really an option I think, as that would replace the text everywhere, even on places other than the shipping method. I think a template override will be the way to go. Just so we're on the same page, I'll add an image later of what exactly I'm talking about so I don't edit the wrong thing.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 2 months ago #249104

Hi,

1. I've already told you in my previous post:

You can do that thanks to the "shipping methods" restriction setting of your payment methods.

So I'm not sure what more you want me to tell you ?

2. That "free shipping" text is only used for shipping methods of course. So if you replace it, it will only affect the shipping method selection interface. You can search for tha translation string FREE_SHIPPING throughout the code of HikaShop, and you'll see that it's only present in the file "shipping" of the "checkout" view.

Last edit: 8 years 2 months ago by Jerome. Reason: typo
The following user(s) said Thank You: Ch3vr0n

Please Log in or Create an account to join the conversation.

  • Posts: 259
  • Thank you received: 10
8 years 2 months ago #249136

1. I must have overlooked that party, my bad. Think i've got it working. Went into shipping method and restricted "Collect in store" to show only "pay at store" and restricted both "kiala/bpost" to show only wiretransfer (as thats the only other method atm). and it seems to work. Selecting pickup only shows pay at store and selecting either of the other shipping methods shows wiretransfer thanks.

2. Great, now that that was clear it seems to have been as simple as a language override with

FREE_SHIPPING=""

Everything peachy. This can be marked as solved

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum