Skip to content

Commit

Permalink
add in store checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ljb0904 committed Jan 19, 2022
1 parent 70a306a commit 43fd84d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 13 deletions.
4 changes: 3 additions & 1 deletion controllers/categories/_list_toolbar.htm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

<a
href="<?= Backend::url('lbaig/catalog/categories/reorder') ?>"
class="btn btn-default oc-icon-sitemap">
class="btn btn-default oc-icon-sitemap">
<?= e(trans('lbaig.catalog::lang.categories.reorder')) ?>
</a>

<?= $this->fireViewEvent('lbaig.catalog.extendCategoriesToolbar') ?>
</div>
2 changes: 2 additions & 0 deletions controllers/products/_list_toolbar.htm
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@
class="btn btn-default oc-icon-bars">
Reorder Products
</a>

<?= $this->fireViewEvent('lbaig.catalog.extendProductsToolbar') ?>
</div>
29 changes: 17 additions & 12 deletions models/product/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,35 @@ fields:
span: right
tabs:
fields:
price:
label: Base price
type: number
span: left
tab: Meta
default: 0
sell_online:
label: Sell Online
type: switch
span: left
tab: Meta
default: true
web_exclusive:
label: Web Exclusive
type: switch
span: right
tab: Meta
default: false
in_store:
label: Available In Store
type: switch
tab: Meta
default: true
price:
label: Base price
type: number
span: left
tab: Meta
default: 0
shipping_weight:
label: Base Shipping Weight
type: number
span: left
tab: Meta
default: 0
web_exclusive:
label: Web Exclusive
type: switch
span: right
tab: Meta
default: false
vendor_code:
label: Vendor Code
type: text
Expand Down
22 changes: 22 additions & 0 deletions updates/update_products_add_in_store.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php namespace Lbaig\Catalog\Updates;

use Schema;
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;

class UpdateProductsAddInStore extends Migration
{
public function up()
{
Schema::table('lbaig_catalog_products', function (Blueprint $table) {
$table->boolean('in_store')->default(true);
});
}

public function down()
{
Schema::table('lbaig_catalog_products', function (Blueprint $table) {
$table->dropColumn('in_store');
});
}
}
3 changes: 3 additions & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
1.0.6:
- Add web_exclusive checkbox
- update_products_add_web_exclusive.php
1.0.7:
- Add in_store checkbox
- update_products_add_in_store.php

0 comments on commit 43fd84d

Please sign in to comment.