Force shipping for virtual / weightless items

  • Posts: 56
  • Thank you received: 1
1 year 3 months ago #347138

Have turned off the setting Force shipping for virtual / weightless items, but I faced following problems, for this item I did not set for the weight, the shipping method will not be displayed, but the shipping step still showing. Any way to turn off the shipping step when there is no shipping method?

Attachments:

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

  • Posts: 81379
  • Thank you received: 13037
  • MODERATOR
1 year 3 months ago #347144

Hi,

There is no mechanism to remove a step. That's because the system doesn't what is in each step unless it displays it, and it only displays the current step.
However, there is a mechanism to automatically skip empty steps.
It is implemented for the "login" view from example. If you're already logged in, and you login have the login view alone on a step, if you try to access that step, it will automatically redirect you to the next one.
However, that mechanism hasn't been implemented for the shipping view. To do that, add the code:

public function haveEmptyContent(&$controller, &$params) {
		$checkoutHelper = hikashopCheckoutHelper::get();
		if(!$checkoutHelper->isShipping())
			return true;
		return false;
	}
before the line:
public function validate(&$controller, &$params, $data = array()) {
in the file administrator/components/com_hikashop/helpers/checkout/shipping.php
Please let us know how it goes so that we can validate the changes for the next release of HikaShop.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum