2

In case of virtual products, we do not need a shipping step so customer directly goes for payment step during checkout.

I have a simple product and a custom field delivery_type in quote table. delivery_type field's value is updated on the cart page by selecting what is the delivery type (home/store).

If the value of delivery_type is store shipping step is not required and the customer should see only payment step similar to virtual products at checkout. Can anyone guide me on how I should go about customizing it?

I tried changing the value of field is_virtual to 1 in quote and quote_item table manually but it does not make any difference. I have logged window.checkoutConfig.quoteData.is_virtual which still shows 0.

  • 1
    vendor\magento\module-checkout\view\frontend\web\js\model\quote.js have method name isVirtual: function () { return !!Number(quoteData['is_virtual']);} need to be extend this function hopefully its will be work for you – Arshad Muhammad Aug 10 '18 at 7:34
  • Just to test I changed return value of isVirtual function to true. Is shows message No Payment method available. – amitshree Aug 10 '18 at 7:47
1
+50

Please have a look at this class

Magento\Quote\Model\Quote

in this class you have this method isVirtual() [image attached]

if the return result is true, Magento will skip the Shipping Step.

You can override this method or create a "after plugin" (recommended) to change the return value as you want

https://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.