tastyigniter / TastyIgniter

:fire: Powerful, yet easy to use, open-source online ordering, table reservation and management system for restaurants
https://tastyigniter.com
MIT License
3.03k stars 988 forks source link

[Bug]: Errors occur when multi step checkout is enabled #905

Closed SupperDog closed 2 years ago

SupperDog commented 2 years ago

What happened?

"Geocode query cannot be empty" error occurs when multi step checkout is enabled. When placing a delivery order with multi step checkout is enabled, it looks the page won't pass any details to the geocode api. Version 3.2.1

What did you expect to happen?

Order can be placed successfully when multi step checkout is enabled.

Version

Other (please detail)

What browser are you seeing the problem on?

No response

Relevant log output

No response

ryanmitchell commented 2 years ago

A full error trace would be useful to identify the problem

SupperDog commented 2 years ago
InvalidArgumentException: Geocode query cannot be empty
in /path/to/vendor/tastyigniter/flame/src/Geolite/GeoQuery.php:53
Stack trace:
#0 /path/to/vendor/tastyigniter/flame/src/Geolite/GeoQuery.php(64): Igniter\Flame\Geolite\GeoQuery->__construct('')
#1 /path/to/vendor/tastyigniter/flame/src/Geolite/Geocoder.php(47): Igniter\Flame\Geolite\GeoQuery::create('')
#2 /path/to/extensions/igniter/cart/classes/OrderManager.php(143): Igniter\Flame\Geolite\Geocoder->geocode('')
#3 /path/to/extensions/igniter/cart/components/Checkout.php(332): Igniter\Cart\Classes\OrderManager->validateDeliveryAddress(Array)
#4 /path/to/extensions/igniter/cart/components/Checkout.php(291): Igniter\Cart\Components\Checkout->validateCheckout(Array, Object(Igniter\Cart\Models\Orders_model))
#5 /path/to/app/system/classes/BaseComponent.php(135): Igniter\Cart\Components\Checkout->onValidate()
#6 /path/to/app/main/classes/MainController.php(419): System\Classes\BaseComponent->runEventHandler('onValidate')
#7 /path/to/app/main/classes/MainController.php(372): Main\Classes\MainController->runHandler('checkout::onVal...')
#8 /path/to/app/main/classes/MainController.php(260): Main\Classes\MainController->processHandlers()
#9 /path/to/app/main/classes/MainController.php(201): Main\Classes\MainController->runPage(Object(Main\Template\Page))
#10 /path/to/app/system/classes/Controller.php(97): Main\Classes\MainController->remap('checkout')
#11 /path/to/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): System\Classes\Controller->run('checkout')
#12 /path/to/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('run', Array)
#13 /path/to/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(System\Classes\Controller), 'run')
#14 /path/to/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
#15 /path/to/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\Routing\Route->run()
#16 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#17 /path/to/extensions/igniter/user/middleware/ThrottleRequests.php(20): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#18 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Igniter\User\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 /path/to/vendor/tastyigniter/flame/src/Translation/Middleware/Localization.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#20 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Igniter\Flame\Translation\Middleware\Localization->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 /path/to/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#22 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 /path/to/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 /path/to/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /path/to/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest(Object(Illuminate\Http\Request), Object(Illuminate\Session\Store), Object(Closure))
#27 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#28 /path/to/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#29 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#30 /path/to/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#31 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#32 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#33 /path/to/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#34 /path/to/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#35 /path/to/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#36 /path/to/vendor/tastyigniter/flame/src/Router/CoreRouter.php(22): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#37 /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Igniter\Flame\Router\CoreRouter->dispatch(Object(Illuminate\Http\Request))
#38 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#39 /path/to/vendor/tastyigniter/flame/src/Setting/Middleware/SaveSetting.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Igniter\Flame\Setting\Middleware\SaveSetting->handle(Object(Illuminate\Http\Request), Object(Closure))
#41 /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#42 /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#43 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#46 /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#47 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /path/to/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#49 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure))
#50 /path/to/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#51 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#52 /path/to/extensions/igniter/api/vendor/dingo/api/src/Http/Middleware/Request.php(111): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#53 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Dingo\Api\Http\Middleware\Request->handle(Object(Illuminate\Http\Request), Object(Closure))
#54 /path/to/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#55 /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#56 /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#57 /path/to/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#58 {main}
ryanmitchell commented 2 years ago

Thanks. Going forward can you wrap error traces in a code block on GitHub so it formats properly and doesn't tag other issues.

SupperDog commented 2 years ago

Thanks. Going forward can you wrap error traces in a code block on GitHub so it formats properly and doesn't tag other issues.

Done

ryanmitchell commented 2 years ago

I'm struggling to recreate, but looking through the code maybe change:

https://github.com/tastyigniter/ti-ext-cart/blob/bd2d528048653f7740110247c555466276eafc11/components/Checkout.php#L331

to be

if (Location::orderTypeIsDelivery()) {

let me know if that helps/works?

ryanmitchell commented 2 years ago

@SupperDog can I get an update if my comment helped or not?

sampoyigi commented 2 years ago

Fixed tastyigniter/ti-ext-cart@972acc37