first commit
This commit is contained in:
45
plugins/stProductOptionsPlugin/config/config.php
Normal file
45
plugins/stProductOptionsPlugin/config/config.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stProductOptionsPlugin
|
||||
*
|
||||
* Ten plik należy do aplikacji stProductOptionsPlugin opartej na licencji (Open License SOTE) Otwarta Licencja SOTE.
|
||||
* Nie zmieniaj tego pliku, jeśli chcesz korzystać z automatycznych aktualizacji oprogramowania.
|
||||
* Jeśli chcesz wprowadzać swoje modyfikacje do programu, zapoznaj się z dokumentacją, jak zmieniać
|
||||
* oprogramowanie bez zmiany kodu bazowego http://www.sote.pl/modifications
|
||||
*
|
||||
* @package stProductOptionsPlugin
|
||||
* @subpackage configs
|
||||
* @copyright SOTE (www.sote.pl)
|
||||
* @license http://www.sote.pl/license/open (Open License SOTE) Otwarta Licencja SOTE
|
||||
* @version $Id: config.php 16306 2011-11-30 12:07:17Z piotr $
|
||||
* @author Daniel Mendalka <daniel.mendalka@sote.pl>
|
||||
*/
|
||||
|
||||
if (SF_APP == 'backend')
|
||||
{
|
||||
stPluginHelper::addEnableModule('stProductOptionsTemplateBackend');
|
||||
stPluginHelper::addEnableModule('stProductOptionsTreeBackend');
|
||||
stPluginHelper::addEnableModule('stProductOptionsBackend');
|
||||
stPluginHelper::addEnableModule('stProductOptionsStockBackend');
|
||||
stPluginHelper::addRouting('stProductOptionsBackend', '/product-options/:action/*', 'stProductOptionsBackend', 'list');
|
||||
|
||||
$dispatcher->connect('stAdminGenerator.generateStProduct', array('stProductOptionsPluginListener', 'generate'));
|
||||
$dispatcher->connect('autoStProductActions.postSave', array('stProductOptionsStockListener', 'postProductSave'));
|
||||
$dispatcher->connect('stProductActions.postExecuteDuplicate', array('stProductOptionsPluginListener', 'productPostExecuteDuplicate'));
|
||||
$dispatcher->connect('stProductActions.validateConfig', array('stProductOptionsStockListener', 'validateProductConfig'));
|
||||
}
|
||||
elseif (SF_APP == 'frontend')
|
||||
{
|
||||
stPluginHelper::addEnableModule('stProductOptionsStockFrontend', 'frontend');
|
||||
stPluginHelper::addEnableModule('stProductOptionsFrontend', 'frontend');
|
||||
stPluginHelper::addRouting('stProductOptionsFrontend', '/product_options/:action/*', 'stProductOptionsFrontend', null, 'frontend');
|
||||
stPluginHelper::addRouting('stProductOptionsStockFrontend', '/product_options_stock/:action/*', 'stProductOptionsStockFrontend', null, 'frontend');
|
||||
|
||||
$dispatcher->connect('stProductActions.preProductPagerInit', array('stNewProductOptions', 'listFilter'));
|
||||
$dispatcher->connect('stProductActions.postExecuteShow', array('stProductOptionsPluginListener', 'productPostExecuteShow'));
|
||||
$dispatcher->connect('stProductActions.postExecuteFilter', array('stProductOptionsPluginListener', 'postExecuteFilter'));
|
||||
$dispatcher->connect('stProductActions.postExecuteClearFilter', array('stProductOptionsPluginListener', 'postExecuteClearFilter'));
|
||||
}
|
||||
|
||||
$dispatcher->connect('Product.getHasOptions', array('stProductOptionsPluginListener', 'productGetHasOptions'));
|
||||
$dispatcher->connect('Product.preSave', array('stProductOptionsPluginListener', 'productPreSave'));
|
||||
@@ -0,0 +1,81 @@
|
||||
config:
|
||||
display:
|
||||
Opcje produktu: [disable_default_option_select, hide_options_with_empty_stock, hide_assigned_images_for_options_with_empty_stock, product_options_stock_computation, product_options_filters_enabled, filter_narrow, show_colors_on_list, show_color_names, nb_colors_on_list]
|
||||
fields:
|
||||
disable_default_option_select:
|
||||
name: "Wyłącz domyślne wybieranie opcji na karcie produktu"
|
||||
type: "checkbox"
|
||||
filter_narrow:
|
||||
help: "Opcja ta przyspieszy działanie sklepu"
|
||||
name: "Wyłącz zawężanie filtrów"
|
||||
type: "checkbox"
|
||||
hide_assigned_images_for_options_with_empty_stock:
|
||||
name: "Ukrywaj zdjęcia z galerii produktu przypisane do ukrytych opcji"
|
||||
type: "checkbox"
|
||||
hide_options_with_empty_stock:
|
||||
name: "Ukrywaj opcje których stan magazynowy jest równy 0"
|
||||
type: "checkbox"
|
||||
nb_colors_on_list:
|
||||
help: "Ograniczenie dotyczy listy pełnej, 0 - bez ograniczeń"
|
||||
i18n: "stProductOptionsBackend"
|
||||
name: "Ogranicz liczbę kolorów do"
|
||||
product_options_filters_enabled:
|
||||
help: "Pokazuje filtry opcji na liście produktów"
|
||||
i18n: "stProductOptionsBackend"
|
||||
name: "Włącz filtry"
|
||||
type: "checkbox"
|
||||
product_options_stock_computation:
|
||||
help: "product.options.stock.computation.help"
|
||||
i18n: "stProductOptionsBackend"
|
||||
name: "Wyświetl stan magazynowy jako"
|
||||
options:
|
||||
max:
|
||||
i18n: "stProductOptionsBackend"
|
||||
name: "Maksymalny"
|
||||
sum:
|
||||
i18n: "stProductOptionsBackend"
|
||||
name: "Łączną sumę"
|
||||
type: "select_tag"
|
||||
show_color_names:
|
||||
i18n: "stProductOptionsBackend"
|
||||
name: "Wyświetlaj nazwy kolorów na karcie produktu"
|
||||
type: "checkbox"
|
||||
show_colors_on_list:
|
||||
help: "Wyświetla dostępne kolory produktu na liście pełnej"
|
||||
i18n: "stProductOptionsBackend"
|
||||
name: "Wyświetlaj kolory na listach"
|
||||
type: "checkbox"
|
||||
depository_list:
|
||||
display: [~depository_stock_options]
|
||||
fields:
|
||||
depository_stock_options:
|
||||
module: "stProductOptionsBackend"
|
||||
name: "Stan magazynowy opcji"
|
||||
edit:
|
||||
menu:
|
||||
display: [options]
|
||||
fields:
|
||||
options:
|
||||
action: "@stProductOptionsBackend?action=manager&product_id=%%id%%"
|
||||
name: "Opcje produktu"
|
||||
export:
|
||||
fields:
|
||||
product_options:
|
||||
class: "stProductOptionsImportExport"
|
||||
md5hash: true
|
||||
name: "Opcje_produktu"
|
||||
import:
|
||||
fields:
|
||||
product_options:
|
||||
class: "stProductOptionsImportExport"
|
||||
md5hash: true
|
||||
list:
|
||||
menu:
|
||||
display: [options_templates, options_filters]
|
||||
fields:
|
||||
options_filters:
|
||||
action: "@stProductOptionsBackend?action=filterList"
|
||||
name: "Filtry opcji"
|
||||
options_templates:
|
||||
action: "@stProductOptionsBackend?action=templateList"
|
||||
name: "Szablony opcji"
|
||||
249
plugins/stProductOptionsPlugin/config/schema.yml
Normal file
249
plugins/stProductOptionsPlugin/config/schema.yml
Normal file
@@ -0,0 +1,249 @@
|
||||
propel:
|
||||
_attributes:
|
||||
defaultIdMethod: native
|
||||
package: plugins.stProductOptionsPlugin.lib.model
|
||||
|
||||
st_product_options_template:
|
||||
_attributes:
|
||||
phpName: ProductOptionsTemplate
|
||||
created_at:
|
||||
type: timestamp
|
||||
updated_at:
|
||||
type: timestamp
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
autoIncrement: true
|
||||
opt_name:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
|
||||
st_product_options_field:
|
||||
_attributes:
|
||||
phpName: ProductOptionsField
|
||||
created_at:
|
||||
type: timestamp
|
||||
updated_at:
|
||||
type: timestamp
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
autoIncrement: true
|
||||
product_options_template_id:
|
||||
type: INTEGER
|
||||
required: false
|
||||
foreignTable: st_product_options_template
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
product_options_filter_id:
|
||||
type: INTEGER
|
||||
required: false
|
||||
foreignTable: st_product_options_filter
|
||||
foreignReference: id
|
||||
onDelete: restrict
|
||||
is_active:
|
||||
type: BOOLEAN
|
||||
required: true
|
||||
default: true
|
||||
required:
|
||||
type: BOOLEAN
|
||||
opt_name:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
opt_default_value:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
opt_value_id:
|
||||
type: INTEGER
|
||||
field_order:
|
||||
type: INTEGER
|
||||
|
||||
st_product_options_default_value:
|
||||
_attributes:
|
||||
phpName: ProductOptionsDefaultValue
|
||||
created_at:
|
||||
type: timestamp
|
||||
updated_at:
|
||||
type: timestamp
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
autoIncrement: true
|
||||
product_options_template_id:
|
||||
type: INTEGER
|
||||
required: true
|
||||
foreignTable: st_product_options_template
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
product_options_default_value_id:
|
||||
type: INTEGER
|
||||
foreignTable: st_product_options_default_value
|
||||
foreignReference: id
|
||||
onDelete: restrict
|
||||
product_options_field_id:
|
||||
type: INTEGER
|
||||
foreignTable: st_product_options_field
|
||||
foreignReference: id
|
||||
onDelete: restrict
|
||||
price:
|
||||
type: VARCHAR
|
||||
size: 16
|
||||
weight:
|
||||
type: VARCHAR
|
||||
size: 10
|
||||
lft:
|
||||
type: INTEGER
|
||||
rgt:
|
||||
type: INTEGER
|
||||
opt_value:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
price_type:
|
||||
type: VARCHAR
|
||||
size: 6
|
||||
depth:
|
||||
type: INTEGER
|
||||
opt_version:
|
||||
type: INTEGER
|
||||
default: 0
|
||||
color:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
use_image_as_color:
|
||||
type: BOOLEAN
|
||||
default: 0
|
||||
old_price:
|
||||
type: DECIMAL
|
||||
size: 10
|
||||
scale: 2
|
||||
pum:
|
||||
type: DECIMAL
|
||||
size: 10
|
||||
scale: 2
|
||||
|
||||
st_product_options_value:
|
||||
_attributes:
|
||||
phpName: ProductOptionsValue
|
||||
created_at:
|
||||
type: timestamp
|
||||
updated_at:
|
||||
type: timestamp
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
autoIncrement: true
|
||||
sf_asset_id:
|
||||
type: INTEGER
|
||||
required: false
|
||||
foreignTable: sf_asset
|
||||
foreignReference: id
|
||||
onDelete: setnull
|
||||
product_id:
|
||||
type: INTEGER
|
||||
required: true
|
||||
foreignTable: st_product
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
product_options_template_id:
|
||||
type: INTEGER
|
||||
required: false
|
||||
foreignTable: st_product_options_template
|
||||
foreignReference: id
|
||||
onDelete: restrict
|
||||
product_options_value_id:
|
||||
type: INTEGER
|
||||
foreignTable: st_product_options_value
|
||||
foreignReference: id
|
||||
onDelete: restrict
|
||||
product_options_field_id:
|
||||
type: INTEGER
|
||||
foreignTable: st_product_options_field
|
||||
foreignReference: id
|
||||
onDelete: restrict
|
||||
is_active:
|
||||
type: BOOLEAN
|
||||
required: true
|
||||
default: true
|
||||
price:
|
||||
type: VARCHAR
|
||||
size: 16
|
||||
weight:
|
||||
type: VARCHAR
|
||||
size: 10
|
||||
lft:
|
||||
type: INTEGER
|
||||
rgt:
|
||||
type: INTEGER
|
||||
stock:
|
||||
type: DECIMAL
|
||||
size: 8
|
||||
scale: 2
|
||||
opt_value:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
price_type:
|
||||
type: VARCHAR
|
||||
size: 6
|
||||
depth:
|
||||
type: INTEGER
|
||||
opt_version:
|
||||
type: INTEGER
|
||||
default: 0
|
||||
color:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
use_image_as_color:
|
||||
type: BOOLEAN
|
||||
default: 0
|
||||
opt_filter_id:
|
||||
type: INTEGER
|
||||
use_product:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
old_price:
|
||||
type: DECIMAL
|
||||
size: 10
|
||||
scale: 2
|
||||
man_code:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
pum:
|
||||
type: DECIMAL
|
||||
size: 10
|
||||
scale: 2
|
||||
_indexes:
|
||||
product_options_value_color: [color]
|
||||
product_options_value_opt_value: [opt_value]
|
||||
product_options_value_filter_id: [opt_filter_id]
|
||||
|
||||
st_product_options_filter:
|
||||
_attributes:
|
||||
phpName: ProductOptionsFilter
|
||||
created_at:
|
||||
type: timestamp
|
||||
updated_at:
|
||||
type: timestamp
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
autoIncrement: true
|
||||
opt_name:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
filter_type:
|
||||
type: INTEGER
|
||||
rank:
|
||||
type: INTEGER
|
||||
price_from:
|
||||
type: DOUBLE
|
||||
price_to:
|
||||
type: DOUBLE
|
||||
is_visible:
|
||||
type: BOOLEAN
|
||||
default: true
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
propel:
|
||||
st_basket_product:
|
||||
_attributes: {phpName: BasketProduct}
|
||||
options:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
new_options:
|
||||
type: LONGVARCHAR
|
||||
phpType: array
|
||||
@@ -0,0 +1,6 @@
|
||||
propel:
|
||||
st_order_product:
|
||||
_attributes: {phpName: OrderProduct}
|
||||
options:
|
||||
type: VARCHAR
|
||||
size: 255
|
||||
@@ -0,0 +1,8 @@
|
||||
propel:
|
||||
st_product:
|
||||
_attributes: {phpName: Product}
|
||||
opt_has_options:
|
||||
type: INTEGER
|
||||
options_color:
|
||||
type: LONGVARCHAR
|
||||
phpType: array
|
||||
@@ -0,0 +1,113 @@
|
||||
propel:
|
||||
st_product_options_template:
|
||||
_attributes:
|
||||
phpName: ProductOptionsTemplate
|
||||
opt_name: {change_column: name}
|
||||
|
||||
st_product_options_field:
|
||||
_attributes:
|
||||
phpName: ProductOptionsField
|
||||
isI18N: true
|
||||
i18nTable: st_product_options_field_i18n
|
||||
opt_name: {change_column: name}
|
||||
opt_default_value: {change_column: default_value}
|
||||
|
||||
st_product_options_field_i18n:
|
||||
_attributes:
|
||||
phpName: ProductOptionsFieldI18n
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
foreignTable: st_product_options_field
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
culture:
|
||||
isCulture: true
|
||||
primaryKey: true
|
||||
type: VARCHAR
|
||||
size: 7
|
||||
name:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
default_value:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
|
||||
st_product_options_default_value:
|
||||
_attributes:
|
||||
phpName: ProductOptionsDefaultValue
|
||||
isI18N: true
|
||||
i18nTable: st_product_options_default_value_i18n
|
||||
opt_value: {change_column: value}
|
||||
|
||||
st_product_options_default_value_i18n:
|
||||
_attributes:
|
||||
phpName: ProductOptionsDefaultValueI18n
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
foreignTable: st_product_options_default_value
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
culture:
|
||||
isCulture: true
|
||||
primaryKey: true
|
||||
type: VARCHAR
|
||||
size: 7
|
||||
value:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
|
||||
st_product_options_value:
|
||||
_attributes:
|
||||
phpName: ProductOptionsValue
|
||||
isI18N: true
|
||||
i18nTable: st_product_options_value_i18n
|
||||
opt_value: {change_column: value}
|
||||
|
||||
st_product_options_value_i18n:
|
||||
_attributes:
|
||||
phpName: ProductOptionsValueI18n
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
foreignTable: st_product_options_value
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
culture:
|
||||
isCulture: true
|
||||
primaryKey: true
|
||||
type: VARCHAR
|
||||
size: 7
|
||||
value:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
|
||||
st_product_options_filter:
|
||||
_attributes:
|
||||
phpName: ProductOptionsFilter
|
||||
isI18N: true
|
||||
i18nTable: st_product_options_filter_i18n
|
||||
opt_name: {change_column: name}
|
||||
|
||||
st_product_options_filter_i18n:
|
||||
_attributes:
|
||||
phpName: ProductOptionsFilterI18n
|
||||
id:
|
||||
type: INTEGER
|
||||
primaryKey: true
|
||||
required: true
|
||||
foreignTable: st_product_options_filter
|
||||
foreignReference: id
|
||||
onDelete: cascade
|
||||
culture:
|
||||
isCulture: true
|
||||
primaryKey: true
|
||||
type: VARCHAR
|
||||
size: 7
|
||||
name:
|
||||
type: VARCHAR
|
||||
size: 128
|
||||
Reference in New Issue
Block a user