Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
onestartup-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Angel Martin
onestartup-shop
Commits
e540e943
Commit
e540e943
authored
Oct 26, 2018
by
Francisco Salazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validar envio a casa
parent
70a8968d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
10 deletions
+48
-10
shop.php
src/config/shop.php
+1
-1
AdminProductController.php
src/controllers/AdminProductController.php
+1
-1
CartController.php
src/controllers/CartController.php
+1
-0
SubCategoryController.php
src/controllers/SubCategoryController.php
+1
-4
2018_10_26_161614_drop_table_related_products_table.php
...s/2018_10_26_161614_drop_table_related_products_table.php
+44
-0
fields.blade.php
src/views/subcategory/fields.blade.php
+0
-4
No files found.
src/config/shop.php
View file @
e540e943
...
...
@@ -5,7 +5,7 @@ return [
"slug-shop-category"
=>
"categoria"
,
"tags-enable"
=>
false
,
"subcategory-enable"
=>
false
,
"version-minima-enable"
=>
tru
e
,
"version-minima-enable"
=>
fals
e
,
"product-index"
=>
[
"pagination"
=>
15
,
"otros"
=>
3
...
...
src/controllers/AdminProductController.php
View file @
e540e943
...
...
@@ -321,7 +321,7 @@ class AdminProductController extends Controller
}
$client
=
$sale
->
client
;
$orden
=
$sale
->
items
;
if
(
$
client
->
shipping
!=
null
)
{
if
(
$
sale
->
home_delivery
!=
null
)
{
$shipping
=
$client
->
shipping
;
$shipping_price
=
$shipping
->
shipping_price
;
}
...
...
src/controllers/CartController.php
View file @
e540e943
...
...
@@ -251,6 +251,7 @@ public function shipping()
}
else
{
$sale
=
Sale
::
find
(
\Session
::
get
(
'sale'
)
->
id
);
$sale
->
total
=
(
$this
->
total
()
+
$costoEnvio
);
$sale
->
home_delivery
=
$request
->
home_delivery
;
$sale
->
facturacion
=
$request
->
facturacion
;
$sale
->
save
();
}
...
...
src/controllers/SubCategoryController.php
View file @
e540e943
...
...
@@ -20,9 +20,8 @@ class SubCategoryController extends Controller{
return
$subcategories
=
$category
->
subcategories
()
->
get
();
}
$subcategories
=
$category
->
subcategories
()
->
paginate
(
30
);
$products
=
Product
::
pluck
(
'name'
,
'id'
);
return
view
(
"shop::subcategory.index"
)
->
with
(
"products"
,
$products
)
->
with
(
"subcategories"
,
$subcategories
)
->
with
(
"category"
,
$category
);
}
...
...
@@ -30,10 +29,8 @@ class SubCategoryController extends Controller{
public
function
edit
(
$category_id
,
$id
){
$category
=
Category
::
find
(
$category_id
);
$subcategory
=
SubCategory
::
where
(
"category_id"
,
$category_id
)
->
find
(
$id
);
$products
=
Product
::
pluck
(
'name'
,
'id'
);
return
view
(
"shop::subcategory.edit"
)
->
with
(
'products'
,
$products
)
->
with
(
"subcategory"
,
$subcategory
)
->
with
(
"category"
,
$category
);
}
...
...
src/migrations/2018_10_26_161614_drop_table_related_products_table.php
0 → 100644
View file @
e540e943
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
DropTableRelatedProductsTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
dropIfExists
(
'related_products'
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
create
(
'related_products'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
integer
(
'product_id'
)
->
unsigned
();
$table
->
foreign
(
'product_id'
)
->
references
(
'id'
)
->
on
(
'products_shop'
)
->
onDelete
(
'cascade'
);
$table
->
integer
(
'subcategory_id'
)
->
unsigned
();
$table
->
foreign
(
'subcategory_id'
)
->
references
(
'id'
)
->
on
(
'product_subcategories_shop'
)
->
onDelete
(
'cascade'
);
$table
->
timestamps
();
});
}
}
src/views/subcategory/fields.blade.php
View file @
e540e943
...
...
@@ -19,10 +19,6 @@
{!! Form::select('active', [true=>'Activo', false=>'Inactivo'], null, ["class"=>"form-control", "required"=>"required"]) !!}
</div>
<div
class=
"form-group"
>
{!! Form::label('related_products', 'Productos relacionados') !!}
{!! Form::select('related_products[]', $products, null, ["class"=>"form-control", "required"=>"required", "multiple" => "multiple", "id" => "related_products", "style" => "width: 100%;"]) !!}
</div>
<div
class=
"form-group"
>
{!! Form::label('portada', 'Imagén de portada') !!}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment