From 607499e848e28ae3cac2d8f4a031a325c379c6f4 Mon Sep 17 00:00:00 2001 From: Ben Kuhl Date: Fri, 5 Feb 2016 19:33:42 -0500 Subject: [PATCH 1/2] Changed cart table name to plural --- src/Config/config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Config/config.php b/src/Config/config.php index ba5cf0c..653be5a 100644 --- a/src/Config/config.php +++ b/src/Config/config.php @@ -40,7 +40,7 @@ | This is the table used by LaravelShop to save cart data to the database. | */ - 'cart_table' => 'cart', + 'cart_table' => 'carts', /* |-------------------------------------------------------------------------- @@ -280,4 +280,4 @@ */ 'callback_redirect_route' => '/', -]; \ No newline at end of file +]; From 7de4452fb51d0011e46f14a5dfeb776fbd6323b0 Mon Sep 17 00:00:00 2001 From: Ben Kuhl Date: Fri, 5 Feb 2016 19:37:09 -0500 Subject: [PATCH 2/2] Use singular version of table name for relation --- src/Traits/ShopCalculationsTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Traits/ShopCalculationsTrait.php b/src/Traits/ShopCalculationsTrait.php index 91c88e5..5c145b8 100644 --- a/src/Traits/ShopCalculationsTrait.php +++ b/src/Traits/ShopCalculationsTrait.php @@ -167,7 +167,7 @@ private function runCalculations() ]) ->join( Config::get('shop.item_table'), - Config::get('shop.item_table') . '.' . ($this->table == Config::get('shop.order_table') ? 'order_id' : $this->table . '_id'), + Config::get('shop.item_table') . '.' . ($this->table == Config::get('shop.order_table') ? 'order_id' : str_singular($this->table) . '_id'), '=', $this->table . '.id' ) @@ -194,4 +194,4 @@ private function resetCalculations () } } -} \ No newline at end of file +}