Recent Topics

Adding shipping options



  • Screenshot 2019-07-17 at 14.11.21.png
    I have added a new shipping method (as seen in above screenshot). PostNL is a dutch service which has multiple 'collecting package locations'.

    For now I would like to add a <select> which has multiple options (multiple cities where you can choose your package to be deliverd to).

    To do that I need to make changes to checkout/onepage/shipping.blade.php, but of course I don't want to edit in the package (because of future updates). I looked up how I could make this happen and saw that view_render_event() was the solution I was looking for, but I'm not quite getting it to work.

    I hardcode added $this->templates[] = 'bagisto.shop.checkout.shipping-method.after'; to ViewRenderEventManager to add a template to see if this template would render in the correct location. This did work, but of course I don't want to add it like this.

    How can I add 'manual code' to the shipping.blade.php from my own package? Or from Laravel?



  • Hi @KevLav

    You can override any view files. This is display using 'shipping.blade.php' file (path - Shop->Resources->view->checkout->shipping.blade.php) .

    So, for overriding you can create this view in default view of laravel. You can check 'resources' folder of laravel, inside it you will find a folder name 'vendor', In this vendor folder create this view (shipping.blade.php & path - shop->checkout-shipping.blade.php) followed by same view directory structure as shop package consist.

    Change this view according to your need.

    Thanks



  • Aaah I see. Thanks @rahul



  • @rahul said in Adding shipping options:

    shipping.blade.php

    Hi @rahul , please could you assist me ? I am trying to follow your logic and override any given blade. When you say to recreate the view under laravel default folder, does that mean then under /var/html/bagisto/resources/views/vendor would become /var/html /bagisto/resources/views/vendor/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php or just the bit after src/ ? Please would it be possible to point me to a full example where a blade is overriden ? I would be grateful and thanks in advance for your help, s


Log in to reply