diff --git a/README.md b/README.md index ad572e88..97dfdf9d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,35 @@ -MultiMerch Marketplace for OpenCart -========== - -[MultiMerch Digital Marketplace for OpenCart](http://multimerch.com/) is now available on GitHub! - -We'll be updating the readme and the docs shortly, meanwhile feel free to check it out and start fiddling with the code. +# MultiMerch Multivendor Marketplace + +MultiMerch Marketplace is an OpenCart extension for creating multivendor marketplaces. + +[Demo](http://demo.multimerch.com) | [Website](http://multimerch.com) | [Forum](http://community.multimerch.com) + +## Core Features + +MultiMerch Core is a free & open source version of MultiMerch providing basic multivendor functionality that can be further extended via addons if necessary. + +- Front office seller accounts - vendors have no access to OpenCart admin +- Support for custom OpenCart themes and extensions +- Flexible fee and commission system - signup, listing and sale fees +- Multiple languages and currencies if needed +- Seller groups, PayPal payouts, user-friendly interfaces and lots of other features +- Extensive configuration with dozens of settings + +## Addons + +It's also possible to extend MultiMerch Core with dozens of other MultiMerch addons (free or paid), including: +- Advanced Shipping system - different shipping rates per product, seller, carrier & zone +- Custom seller badges like top or premium sellers +- Private messaging with conversation support between buyers and sellers +- PayPal MassPay & PayPal Adaptive +- Seller & product comments and others + +## Documentation +The links below will take you to the latest versions of documentation available on MultiMerch website. +- [Installation](http://multimerch.com/docs/installation/) +- [Configuration](http://multimerch.com/docs/configuration/) +- [Custom Themes](http://multimerch.com/docs/custom-theme-compatibility/) +- [Seller Accounts](http://multimerch.com/docs/multimerch-seller-accounts/) +- [Transactions & Balance](http://multimerch.com/docs/transactions-seller-balance/) +- [Fees & Commissions](http://multimerch.com/docs/commissions/) +- [Seller Groups](http://multimerch.com/docs/seller-groups/) diff --git a/readme.odt b/readme.odt deleted file mode 100644 index 57aa251d..00000000 Binary files a/readme.odt and /dev/null differ diff --git a/readme.pdf b/readme.pdf deleted file mode 100644 index e21d56a3..00000000 Binary files a/readme.pdf and /dev/null differ diff --git a/readme.txt b/readme.txt new file mode 100644 index 00000000..864a561b --- /dev/null +++ b/readme.txt @@ -0,0 +1 @@ +Please see the MultiMerch documentation at http://multimerch.com/documentation/. \ No newline at end of file diff --git a/upload/admin/controller/module/multiseller.php b/upload/admin/controller/module/multiseller.php index 2760537d..2c02c0af 100644 --- a/upload/admin/controller/module/multiseller.php +++ b/upload/admin/controller/module/multiseller.php @@ -8,6 +8,8 @@ class ControllerModuleMultiseller extends ControllerMultisellerBase { "multiseller/payment", "multiseller/seller", "multiseller/transaction", + "multiseller/dashboard", + "multiseller/debug", "multiseller/seller-group" ); @@ -18,6 +20,7 @@ class ControllerModuleMultiseller extends ControllerMultisellerBase { "msconf_nickname_rules" => 0, // 0 - alnum, 1 - latin extended, 2 - utf "msconf_credit_order_statuses" => array(5), "msconf_debit_order_statuses" => array(8), + "msconf_display_order_statuses" => array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16), "msconf_minimum_withdrawal_amount" => "50", "msconf_allow_partial_withdrawal" => 1, @@ -44,8 +47,6 @@ class ControllerModuleMultiseller extends ControllerMultisellerBase { "msconf_provide_buyerinfo" => 0, // 0 - no, 1 - yes, 2 - shipping dependent "msconf_enable_quantities" => 0, // 0 - no, 1 - yes, 2 - shipping dependent "msconf_enable_categories" => 0, // 0 - no, 1 - yes - "msconf_physical_product_categories" => array(), - "msconf_digital_product_categories" => array(), "msconf_disable_product_after_quantity_depleted" => 0, "msconf_allow_relisting" => 0, @@ -64,14 +65,15 @@ class ControllerModuleMultiseller extends ControllerMultisellerBase { "msconf_allow_discounts" => 1, "msconf_withdrawal_waiting_period" => 0, "msconf_graphical_sellermenu" => 1, - + "msconf_enable_seller_banner" => 1, + "msconf_enable_rte" => 0, "msconf_rte_whitelist" => "", "msconf_seller_avatar_seller_profile_image_width" => 100, "msconf_seller_avatar_seller_profile_image_height" => 100, - "msconf_seller_avatar_seller_list_image_width" => 100, - "msconf_seller_avatar_seller_list_image_height" => 100, + "msconf_seller_avatar_seller_list_image_width" => 228, + "msconf_seller_avatar_seller_list_image_height" => 228, "msconf_seller_avatar_product_page_image_width" => 100, "msconf_seller_avatar_product_page_image_height" => 100, "msconf_seller_avatar_dashboard_image_width" => 100, @@ -86,7 +88,9 @@ class ControllerModuleMultiseller extends ControllerMultisellerBase { "msconf_product_seller_products_image_height" => 100, "msconf_product_seller_product_list_seller_area_image_width" => 40, "msconf_product_seller_product_list_seller_area_image_height" => 40, - + "msconf_product_seller_banner_width" => 750, + "msconf_product_seller_banner_height" => 100, + "msconf_min_uploaded_image_width" => 0, "msconf_min_uploaded_image_height" => 0, "msconf_max_uploaded_image_width" => 0, @@ -102,7 +106,7 @@ class ControllerModuleMultiseller extends ControllerMultisellerBase { "msconf_avatars_for_sellers" => 0, // 0 - Uploaded manually by seller, 1 - Both, uploaded by seller and pre-defined, 2 - Only pre-defined "msconf_change_seller_nickname" => 1, - "msconf_enable_private_messaging" => 1, // 0 - no, 2 - yes (email only) + "msconf_enable_private_messaging" => 2, // 0 - no, 2 - yes (email only) "msconf_enable_one_page_seller_registration" => 0 // 0 - no, 1 - yes ); @@ -113,10 +117,10 @@ public function __construct($registry) { private function _editSettings() { $this->load->model('setting/setting'); - $this->load->model('setting/extension'); + $this->load->model('extension/extension'); - $set = $this->model_setting_setting->getSetting('multiseller'); - $installed_extensions = $this->model_setting_extension->getInstalled('module'); + $set = $this->model_setting_setting->getSetting('msconf'); + $installed_extensions = $this->model_extension_extension->getInstalled('module'); $extensions_to_be_installed = array(); foreach ($this->settings as $name=>$value) { @@ -149,11 +153,11 @@ private function _editSettings() { $this->data[$s] = $this->settings[$s]; } } - - $this->model_setting_setting->editSetting('multiseller', $set); + + $this->model_setting_setting->editSetting('msconf', $set); foreach ($extensions_to_be_installed as $ext) { - $this->model_setting_extension->install('module',$ext); + $this->model_extension_extension->install('module',$ext); } } public function install() { @@ -163,7 +167,7 @@ public function install() { $this->model_multiseller_install->createSchema(); $this->model_multiseller_install->createData(); - $this->model_setting_setting->editSetting('multiseller', $this->settings); + $this->model_setting_setting->editSetting('msconf', $this->settings); $this->load->model('user/user_group'); @@ -194,12 +198,6 @@ public function install() { } } } - - // ckeditor - /*if (!copy(DIR_APPLICATION . 'view/javascript/ckeditor/', DIR_CATALOG . 'view/javascript/multimerch/')) { - $this->session->data['error'] .= sprintf($this->language->get('ms_error_ckeditor'), DIR_APPLICATION . 'view/javascript/ckeditor/', DIR_CATALOG . 'view/javascript/multimerch/'); - }*/ - $this->session->data['error'] .= sprintf($this->language->get('ms_notice_ckeditor'), DIR_APPLICATION . 'view/javascript/ckeditor/', DIR_CATALOG . 'view/javascript/multimerch/ckeditor/'); } public function uninstall() { @@ -220,10 +218,13 @@ public function saveSettings() { magic*/ if (!isset($this->request->post['msconf_credit_order_statuses'])) - $this->request->post['msconf_credit_order_statuses'] = array(); + $this->request->post['msconf_credit_order_statuses'] = array(-1); if (!isset($this->request->post['msconf_debit_order_statuses'])) - $this->request->post['msconf_debit_order_statuses'] = array(); + $this->request->post['msconf_debit_order_statuses'] = array(-1); + + if (!isset($this->request->post['msconf_display_order_statuses'])) + $this->request->post['msconf_display_order_statuses'] = array(-1); if (!isset($this->request->post['msconf_product_options'])) $this->request->post['msconf_product_options'] = array(); @@ -299,12 +300,14 @@ public function index() { ), array( 'text' => $this->language->get('ms_settings_breadcrumbs'), - 'href' => $this->url->link('multiseller/settings', '', 'SSL'), + 'href' => $this->url->link('module/multiseller', '', 'SSL'), ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('settings'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/settings.tpl', $this->data)); } public function upgradeDb() { @@ -316,7 +319,7 @@ public function upgradeDb() { $this->session->data['ms_db_latest'] = $this->language->get('ms_db_latest'); } - $this->redirect($this->url->link('module/multiseller', 'token=' . $this->session->data['token'], 'SSL')); + $this->response->redirect($this->url->link('module/multiseller', 'token=' . $this->session->data['token'], 'SSL')); } } ?> diff --git a/upload/admin/controller/multiseller/attribute.php b/upload/admin/controller/multiseller/attribute.php index 6b02371a..42c3a139 100644 --- a/upload/admin/controller/multiseller/attribute.php +++ b/upload/admin/controller/multiseller/attribute.php @@ -2,10 +2,10 @@ class ControllerMultisellerAttribute extends ControllerMultisellerBase { public function getTableData() { - $colMap = array( - 'id' => 'ma.attribute_id', - 'status' => '`ma.enabled`', - 'type' => 'attribute_type' + $colMap = array( + 'id' => 'ma.attribute_id', + 'status' => '`ma.enabled`', + 'type' => 'attribute_type' ); $sorts = array('name', 'type', 'sort_order', 'status'); @@ -31,8 +31,8 @@ public function getTableData() { foreach ($results as $result) { // actions $actions = ""; - $actions .= ""; - $actions .= ""; + $actions .= ""; + $actions .= ""; $columns[] = array_merge( $result, @@ -86,8 +86,10 @@ public function index() { ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('attribute'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/attribute.tpl', $this->data)); } public function create() { @@ -98,8 +100,8 @@ public function create() { $this->data['attribute'] = FALSE; $this->data['attribute_groups'] = $this->model_catalog_attribute_group->getAttributeGroups(); $this->data['languages'] = $this->model_localisation_language->getLanguages(); - $this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100); - + $this->data['no_image'] = $this->model_tool_image->resize('no_image.png', 100, 100); + $this->data['cancel'] = $this->url->link('multiseller/attribute', 'token=' . $this->session->data['token'], 'SSL'); $this->data['token'] = $this->session->data['token']; $this->data['heading'] = $this->language->get('ms_attribute_create'); @@ -113,11 +115,17 @@ public function create() { array( 'text' => $this->language->get('ms_attribute_breadcrumbs'), 'href' => $this->url->link('multiseller/attribute', '', 'SSL'), + ), + array( + 'text' => $this->language->get('ms_attribute_create'), + 'href' => $this->url->link('multiseller/seller/create', 'SSL'), ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('attribute-form'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/attribute-form.tpl', $this->data)); } public function update() { @@ -136,12 +144,12 @@ public function update() { foreach ($this->data['attribute']['attribute_values'] as &$value) { $value['attribute_value_description'] = $this->MsLoader->MsAttribute->getAttributeValueDescriptions($value['attribute_value_id']); - $value['thumb'] = (!empty($value['image']) ? $this->model_tool_image->resize($value['image'], 100, 100) : $this->model_tool_image->resize('no_image.jpg', 100, 100)); + $value['thumb'] = (!empty($value['image']) ? $this->model_tool_image->resize($value['image'], 100, 100) : $this->model_tool_image->resize('no_image.png', 100, 100)); } } $this->data['languages'] = $this->model_localisation_language->getLanguages(); - $this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100); + $this->data['no_image'] = $this->model_tool_image->resize('no_image.png', 100, 100); $this->data['cancel'] = $this->url->link('multiseller/attribute', 'token=' . $this->session->data['token'], 'SSL'); $this->data['token'] = $this->session->data['token']; @@ -156,11 +164,17 @@ public function update() { array( 'text' => $this->language->get('ms_attribute_breadcrumbs'), 'href' => $this->url->link('multiseller/attribute', '', 'SSL'), + ), + array( + 'text' => $this->language->get('ms_attribute_edit'), + 'href' => $this->url->link('multiseller/attribute/update', '&attribute_id=' . $attribute_id, 'SSL'), ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('attribute-form'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/attribute-form.tpl', $this->data)); } public function delete() { @@ -174,14 +188,14 @@ public function delete() { $this->session->data['success'] = $this->language->get('ms_success'); } - if (isset($this->request->get['attribute_id'])) $this->redirect($this->url->link('multiseller/attribute', 'token=' . $this->session->data['token'], 'SSL')); + if (isset($this->request->get['attribute_id'])) $this->response->redirect($this->url->link('multiseller/attribute', 'token=' . $this->session->data['token'], 'SSL')); } public function jxSubmitAttribute() { $json = array(); $data = $this->request->post; unset($data['attribute_value'][0]); - + foreach ($data['attribute_description'] as $language_id => $value) { if ((utf8_strlen($value['name']) < 1) || (utf8_strlen($value['name']) > 128)) { $json['errors']["attribute_description[$language_id][name]"] = $this->language->get('ms_error_attribute_name'); @@ -192,7 +206,9 @@ public function jxSubmitAttribute() { if (empty($data['attribute_value'])) { $json['errors']['attribute_type'] = $this->language->get('ms_error_attribute_type'); } - } else if (($data['attribute_type'] != MsAttribute::TYPE_TEXT && $data['attribute_type'] != MsAttribute::TYPE_TEXTAREA)) { + } else if (($data['attribute_type'] == MsAttribute::TYPE_TEXT || $data['attribute_type'] == MsAttribute::TYPE_TEXTAREA)) { + unset($data['attribute_value']); + } else { unset($data['text_type']); unset($data['attribute_value']); } diff --git a/upload/admin/controller/multiseller/base.php b/upload/admin/controller/multiseller/base.php index 74963138..03ab07d6 100644 --- a/upload/admin/controller/multiseller/base.php +++ b/upload/admin/controller/multiseller/base.php @@ -2,6 +2,7 @@ class ControllerMultisellerBase extends Controller { private $error = array(); + public $data = array(); public function __construct($registry) { parent::__construct($registry); @@ -9,13 +10,15 @@ public function __construct($registry) { $parts = explode('/', $this->request->request['route']); if (!isset($parts[2]) || !in_array($parts[2], array('install','uninstall'))) { } - + + //$data = array(); $this->data = array_merge($this->data, $this->load->language('multiseller/multiseller')); $this->data['token'] = $this->session->data['token']; $this->document->addStyle('view/stylesheet/multimerch/multiseller.css'); $this->document->addStyle('view/javascript/multimerch/datatables/css/jquery.dataTables.css'); $this->document->addScript('view/javascript/multimerch/datatables/js/jquery.dataTables.min.js'); $this->document->addScript('view/javascript/multimerch/common.js'); + //$this->document->addScript('//code.jquery.com/ui/1.11.2/jquery-ui.min.js'); } // @todo: validation diff --git a/upload/admin/controller/multiseller/dashboard.php b/upload/admin/controller/multiseller/dashboard.php new file mode 100644 index 00000000..107661cd --- /dev/null +++ b/upload/admin/controller/multiseller/dashboard.php @@ -0,0 +1,8 @@ +response->redirect($this->url->link('module/multiseller', 'token=' . $this->session->data['token'], 'SSL')); + } +} +?> diff --git a/upload/admin/controller/multiseller/debug.php b/upload/admin/controller/multiseller/debug.php new file mode 100644 index 00000000..6519ea6f --- /dev/null +++ b/upload/admin/controller/multiseller/debug.php @@ -0,0 +1,106 @@ + 0 && $lines >= 0) { + $seek = min(ftell($f), $buffer); + fseek($f, -$seek, SEEK_CUR); + $output = ($chunk = fread($f, $seek)) . $output; + fseek($f, -mb_strlen($chunk, '8bit'), SEEK_CUR); + $lines -= substr_count($chunk, "\n"); + } + + while ($lines++ < 0) $output = substr($output, strpos($output, "\n") + 1); + fclose($f); + + return trim($output); + } + + public function index() { + $this->validate(__FUNCTION__); + + $this->load->model('extension/extension'); + $this->load->model('extension/module'); + + // extensions + $this->data['extensions'] = array(); + $installed = $this->model_extension_extension->getInstalled('module'); + + $files = glob(DIR_APPLICATION . 'controller/module/*.php'); + if ($files) { + foreach ($files as $file) { + $extension = basename($file, '.php'); + $this->load->language('module/' . $extension); + + $version = ''; + if (strpos($extension, 'multimerch_') !== FALSE) { + $f = file($file); + foreach ($f as $line) { + if (strpos($line, 'version') !== false) { + if (preg_match("/['\"](.*?)['\"]/", $line, $matches)) $version = $matches[1]; + break; + } + } + } + + if (in_array($extension, $installed)) { + $this->data['installed_extensions'][] = array( + 'name' => $this->language->get('heading_title'), + 'version' => $version + ); + }else { + $this->data['other_extensions'][] = array( + 'name' => $this->language->get('heading_title'), + 'version' => $version + ); + } + } + } + + // error log + $file = DIR_LOGS . $this->config->get('config_error_filename'); + $this->data['error_log'] = ''; + if (file_exists($file)) { + $this->data['error_log'] = $this->_readLog($file); + } + + // vqmod log + $files = glob(DIR_APPLICATION . '../' . vQmod::$logFolder . '*.log'); + if ($files) { + usort($files, create_function('$a,$b', 'return filemtime($b) - filemtime($a);')); + $log = array_shift($files); + $this->data['vqmod_log'] = $this->_readLog($log, 150); + } + + $this->data['token'] = $this->session->data['token']; + $this->data['heading'] = $this->language->get('ms_debug_heading'); + $this->document->setTitle($this->language->get('ms_debug_heading')); + + $this->data['breadcrumbs'] = $this->MsLoader->MsHelper->admSetBreadcrumbs(array( + array( + 'text' => $this->language->get('ms_menu_multiseller'), + 'href' => $this->url->link('multiseller/dashboard', '', 'SSL'), + ), + array( + 'text' => $this->language->get('ms_debug_breadcrumbs'), + 'href' => $this->url->link('multiseller/debug', '', 'SSL'), + ) + )); + + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/debug.tpl', $this->data)); + } +} +?> diff --git a/upload/admin/controller/multiseller/payment.php b/upload/admin/controller/multiseller/payment.php index d67d70b9..30e2334e 100644 --- a/upload/admin/controller/multiseller/payment.php +++ b/upload/admin/controller/multiseller/payment.php @@ -84,7 +84,9 @@ public function getTableData() { public function index() { $this->validate(__FUNCTION__); - + + $this->document->addScript('//code.jquery.com/ui/1.11.2/jquery-ui.min.js'); + // paypal listing payment confirmation if (isset($this->request->post['payment_status']) && strtolower($this->request->post['payment_status']) == 'completed') { $this->data['success'] = $this->language->get('ms_payment_completed'); @@ -143,94 +145,98 @@ public function index() { )*/ )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('payment'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/payment.tpl', $this->data)); } - public function create() { - $results = $this->MsLoader->MsSeller->getSellers( - array(), - array( - 'order_by' => 'ms.nickname', - 'order_way' => 'ASC', - ) - ); - - foreach ($results as $r) { - $this->data['sellers'][] = array( - 'name' => "{$r['ms.nickname']} ({$r['c.name']})", - 'seller_id' => $r['seller_id'] - ); - } + public function create() { + $results = $this->MsLoader->MsSeller->getSellers( + array(), + array( + 'order_by' => 'ms.nickname', + 'order_way' => 'ASC', + ) + ); + + foreach ($results as $r) { + $this->data['sellers'][] = array( + 'name' => "{$r['ms.nickname']} ({$r['c.name']})", + 'seller_id' => $r['seller_id'] + ); + } - $msPayment = new ReflectionClass('MsPayment'); - foreach ($msPayment->getConstants() as $cname => $cval) { + $msPayment = new ReflectionClass('MsPayment'); + foreach ($msPayment->getConstants() as $cname => $cval) { if (strpos($cname, 'TYPE_') !== FALSE && !in_array($cname, array('TYPE_RECURRING', 'TYPE_SALE'))) { - $this->data['payment_types'][$cval] = $this->language->get('ms_payment_type_' . $cval); - } + $this->data['payment_types'][$cval] = $this->language->get('ms_payment_type_' . $cval); + } } - $this->data['token'] = $this->session->data['token']; - $this->data['heading'] = $this->language->get('ms_payment_new'); - $this->document->setTitle($this->language->get('ms_payment_new')); + $this->data['token'] = $this->session->data['token']; + $this->data['heading'] = $this->language->get('ms_payment_new'); + $this->document->setTitle($this->language->get('ms_payment_new')); $this->load->model('setting/setting'); $store_info = $this->model_setting_setting->getSetting('config', 0); $this->data['store_name'] = $store_info['config_name']; - - $this->data['breadcrumbs'] = $this->MsLoader->MsHelper->admSetBreadcrumbs(array( - array( - 'text' => $this->language->get('ms_menu_multiseller'), - 'href' => $this->url->link('multiseller/dashboard', '', 'SSL'), - ), - array( - 'text' => $this->language->get('ms_payment_breadcrumbs'), - 'href' => $this->url->link('multiseller/transaction', '', 'SSL'), - ), - array( - 'text' => $this->language->get('ms_payment_new'), - 'href' => $this->url->link('multiseller/transaction', '', 'SSL'), - ) - )); - - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('payment-form'); - $this->response->setOutput($this->render()); - } - - public function jxSave() { - $json = array(); + + $this->data['breadcrumbs'] = $this->MsLoader->MsHelper->admSetBreadcrumbs(array( + array( + 'text' => $this->language->get('ms_menu_multiseller'), + 'href' => $this->url->link('multiseller/dashboard', '', 'SSL'), + ), + array( + 'text' => $this->language->get('ms_payment_breadcrumbs'), + 'href' => $this->url->link('multiseller/payment', '', 'SSL'), + ), + array( + 'text' => $this->language->get('ms_payment_new'), + 'href' => $this->url->link('multiseller/payment/create', '', 'SSL'), + ) + )); + + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/payment-form.tpl', $this->data)); + } + + public function jxSave() { + $json = array(); $data = $this->request->post['payment']; - if ((!$data['from'] && !$data['to']) || ($data['from'] && $data['to'])) { - $json['errors']['payment[from]'] = $this->language->get('ms_error_payment_fromto'); - $json['errors']['payment[to]'] = $this->language->get('ms_error_payment_fromto'); - } + if ((!$data['from'] && !$data['to']) || ($data['from'] && $data['to'])) { + $json['errors']['payment[from]'] = $this->language->get('ms_error_payment_fromto'); + $json['errors']['payment[to]'] = $this->language->get('ms_error_payment_fromto'); + } - if (!$data['from'] && !in_array($data['type'], array(MsPayment::TYPE_PAYOUT, MsPayment::TYPE_PAYOUT_REQUEST))) { - $json['errors']['payment[type]'] = $this->language->get('ms_error_payment_fromstore'); - } else if ($data['from'] && in_array($data['type'], array(MsPayment::TYPE_PAYOUT, MsPayment::TYPE_PAYOUT_REQUEST))) { - $json['errors']['payment[type]'] = $this->language->get('ms_error_payment_tostore'); + if (!$data['from'] && !in_array($data['type'], array(MsPayment::TYPE_PAYOUT, MsPayment::TYPE_PAYOUT_REQUEST))) { + $json['errors']['payment[type]'] = $this->language->get('ms_error_payment_fromstore'); + } else if ($data['from'] && in_array($data['type'], array(MsPayment::TYPE_PAYOUT, MsPayment::TYPE_PAYOUT_REQUEST))) { + $json['errors']['payment[type]'] = $this->language->get('ms_error_payment_tostore'); + } + + if ((float)$data['amount'] <= 0) { + $json['errors']['payment[amount]'] = $this->language->get('ms_error_payment_amount'); } - - if ((float)$data['amount'] <= 0) { - $json['errors']['payment[amount]'] = $this->language->get('ms_error_payment_amount'); - } - + if (empty($json['errors'])) { - $payment_id = $this->MsLoader->MsPayment->createPayment(array( - 'seller_id' => ($data['from'] ? $data['from'] : $data['to']), - 'payment_type' => $data['type'], - 'payment_status' => (isset($data['paid']) && $data['paid'] ? 2 : 1), - 'payment_method' => $data['method'], - 'amount' => $data['amount'], - 'currency_id' => $this->currency->getId($this->config->get('config_currency')), - 'currency_code' => $this->currency->getCode($this->config->get('config_currency')), - 'description' => $data['description'] + $payment_id = $this->MsLoader->MsPayment->createPayment(array( + 'seller_id' => ($data['from'] ? $data['from'] : $data['to']), + 'payment_type' => $data['type'], + 'payment_status' => (isset($data['paid']) && $data['paid'] ? 2 : 1), + 'payment_method' => $data['method'], + 'amount' => $data['amount'], + 'currency_id' => $this->currency->getId($this->config->get('config_currency')), + 'currency_code' => $this->currency->getCode($this->config->get('config_currency')), + 'description' => $data['description'] )); if (isset($data['paid']) && $data['paid']) { - $this->MsLoader->MsPayment->updatePayment($payment_id, array( - 'date_paid' => date( 'Y-m-d H:i:s') + $this->MsLoader->MsPayment->updatePayment($payment_id, array( + 'date_paid' => date( 'Y-m-d H:i:s') )); } @@ -241,7 +247,7 @@ public function jxSave() { break; case MsPayment::TYPE_LISTING: - $balance_type = MsBalance::MS_BALANCE_TYPE_LISTING; + $balance_type = MsBalance::MS_BALANCE_TYPE_LISTING; break; case MsPayment::TYPE_PAYOUT: @@ -253,18 +259,18 @@ public function jxSave() { $balance_type = MsBalance::MS_BALANCE_TYPE_GENERIC; } - $this->MsLoader->MsBalance->addBalanceEntry($data['from'] ? $data['from'] : $data['to'], array( - 'balance_type' => $balance_type, - 'amount' => -$data['amount'], - 'description' => $data['description'] - )); + $this->MsLoader->MsBalance->addBalanceEntry($data['from'] ? $data['from'] : $data['to'], array( + 'balance_type' => $balance_type, + 'amount' => -$data['amount'], + 'description' => $data['description'] + )); } - $this->session->data['success'] = $this->language->get('ms_success_payment_created'); - } else { - } - - $this->response->setOutput(json_encode($json)); + $this->session->data['success'] = $this->language->get('ms_success_payment_created'); + } else { + } + + $this->response->setOutput(json_encode($json)); } // todo @@ -291,11 +297,11 @@ public function jxPay() { 'notify_url' => HTTP_CATALOG . 'index.php?route=payment/multimerch-paypal/payoutIPN', 'custom' => $payment_id ); - - list($this->template) = $this->MsLoader->MsHelper->admLoadTemplate('payment/multimerch-paypal'); - - $json['form'] = $this->render(); + + list($template, $children) = $this->MsLoader->MsHelper->admLoadTemplate('payment/multimerch-paypal'); + $json['form'] = $this->load->view($template, $this->data); $json['success'] = 1; + $this->response->setOutput(json_encode($json)); } diff --git a/upload/admin/controller/multiseller/product.php b/upload/admin/controller/multiseller/product.php index bab37fa6..e808cdd5 100644 --- a/upload/admin/controller/multiseller/product.php +++ b/upload/admin/controller/multiseller/product.php @@ -2,13 +2,13 @@ class ControllerMultisellerProduct extends ControllerMultisellerBase { public function getTableData() { - $colMap = array( - 'id' => 'product_id', - 'name' => 'pd.name', - 'status' => 'mp.product_status', - 'seller' => 'ms.nickname', - 'date_created' => 'p.date_created', - 'date_modified' => 'p.date_modified' + $colMap = array( + 'id' => 'product_id', + 'name' => 'pd.name', + 'status' => 'mp.product_status', + 'seller' => 'ms.nickname', + 'date_created' => 'p.date_created', + 'date_modified' => 'p.date_modified' ); $sorts = array('name', 'seller', 'date_created', 'date_modified', 'status'); @@ -46,18 +46,18 @@ public function getTableData() { if ($result['p.image'] && file_exists(DIR_IMAGE . $result['p.image'])) { $image = $this->MsLoader->MsFile->resizeImage($result['p.image'], 40, 40); } else { - $image = $this->MsLoader->MsFile->resizeImage('no_image.jpg', 40, 40); + $image = $this->MsLoader->MsFile->resizeImage('no_image.png', 40, 40); } // actions $actions = ""; - $actions .= ""; + $actions .= ""; $actions .= ""; // seller select $sellerselect = ""; $sellerselect .= " - "; foreach($sellers as $s) { @@ -65,8 +65,9 @@ public function getTableData() { } $sellerselect .= " + - + "; $columns[] = array_merge( @@ -92,6 +93,7 @@ public function getTableData() { } public function index() { + $this->document->addScript('//code.jquery.com/ui/1.11.2/jquery-ui.min.js'); $this->validate(__FUNCTION__); if (isset($this->session->data['error'])) { @@ -123,14 +125,16 @@ public function index() { ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('product'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/product.tpl', $this->data)); } public function jxProductStatus() { $this->validate(__FUNCTION__); $mails = array(); - + if (isset($this->request->post['selected'])) { foreach ($this->request->post['selected'] as $product_id) { $seller = $this->MsLoader->MsSeller->getSeller($this->MsLoader->MsProduct->getSellerId($product_id)); @@ -202,6 +206,7 @@ public function jxProductSeller() { $json['product_status'] = $this->language->get('ms_product_status_' . MsProduct::STATUS_INACTIVE); break; case MsSeller::STATUS_DISABLED: + case MsSeller::STATUS_INCOMPLETE: $this->MsLoader->MsProduct->changeStatus($product_id, MsProduct::STATUS_DISABLED); $this->MsLoader->MsProduct->disapprove($product_id); break; @@ -218,13 +223,15 @@ public function jxProductSeller() { $json['product_status'] = $this->language->get('ms_product_status_' . $product['mp.product_status']); break; } + + $this->response->addHeader('Content-Type: application/json'); $this->response->setOutput(json_encode($json)); } public function delete() { $product_id = isset($this->request->get['product_id']) ? $this->request->get['product_id'] : 0; $this->MsLoader->MsProduct->deleteProduct($product_id); - $this->redirect($this->url->link('multiseller/product', 'token=' . $this->session->data['token'], 'SSL')); + $this->response->redirect($this->url->link('multiseller/product', 'token=' . $this->session->data['token'], 'SSL')); } } ?> diff --git a/upload/admin/controller/multiseller/seller-group.php b/upload/admin/controller/multiseller/seller-group.php index 3aeb00df..917e48ec 100644 --- a/upload/admin/controller/multiseller/seller-group.php +++ b/upload/admin/controller/multiseller/seller-group.php @@ -3,13 +3,13 @@ class ControllerMultisellerSellerGroup extends ControllerMultisellerBase { private $error = array(); - public function __construct($registry) { - parent::__construct($registry); + public function __construct($registry) { + parent::__construct($registry); } public function getTableData() { - $colMap = array( - 'id' => 'msg.seller_group_id' + $colMap = array( + 'id' => 'msg.seller_group_id' ); $sorts = array('id', 'name', 'description'); @@ -35,8 +35,8 @@ public function getTableData() { foreach ($results as $result) { // actions $actions = ""; - $actions .= ""; - $actions .= ""; + $actions .= ""; + $actions .= ""; $rates = $this->MsLoader->MsCommission->calculateCommission(array('seller_group_id' => $result['seller_group_id'])); $actual_fees = ''; @@ -101,8 +101,10 @@ public function index() { $this->document->setTitle($this->language->get('ms_catalog_seller_groups_heading')); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('seller-group'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/seller-group.tpl', $this->data)); } // Insert a new seller group @@ -130,8 +132,10 @@ public function insert() { ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('seller-group-form'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/seller-group-form.tpl', $this->data)); } // Update a seller group @@ -174,8 +178,10 @@ public function update() { ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('seller-group-form'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/seller-group-form.tpl', $this->data)); } // Bulk delete of seller groups @@ -190,41 +196,7 @@ public function delete() { $this->session->data['success'] = $this->language->get('ms_success'); } - $this->redirect($this->url->link('multiseller/seller-group', 'token=' . $this->session->data['token'], 'SSL')); - } - - // Get form for adding/editing seller groups - private function getEditForm() { - $this->data['heading'] = $this->language->get('ms_catalog_insert_seller_group_heading'); - - if (!isset($this->request->get['seller_group_id'])) { - $this->data['action'] = $this->url->link('multiseller/seller-group/insert', 'token=' . $this->session->data['token'] . $url, 'SSL'); - } else { - $this->data['action'] = $this->url->link('multiseller/seller-group/update', 'token=' . $this->session->data['token'] . '&seller_group_id=' . $this->request->get['seller_group_id'] . $url, 'SSL'); - } - - $this->data['cancel'] = $this->url->link('multiseller/seller-group', 'token=' . $this->session->data['token'] . $url, 'SSL'); - - if (isset($this->request->get['seller_group_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) { - //$seller_group_info = $this->MsLoader->MsSellerGroup->getSellerGroup($this->request->get['seller_group_id']); - } - - //$this->MsLoader->MsSellerGroup->getSellerGroupDescriptions($this->request->get['seller_group_id']); - - - if (isset($this->request->post['seller_group_description'])) { - $this->data['seller_group_description'] = $this->request->post['seller_group_description']; - } elseif (isset($this->request->get['seller_group_id'])) { - $this->data['seller_group_description'] = 'a'; - } else { - $this->data['seller_group_description'] = array(); - } - - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('seller-group-form'); - $this->response->setOutput($this->render()); - } - - private function validateForm() { + $this->response->redirect($this->url->link('multiseller/seller-group', 'token=' . $this->session->data['token'], 'SSL')); } // Validate delete of the seller group @@ -255,7 +227,7 @@ public function jxSave() { foreach ($data['description'] as $language_id => $value) { if ((utf8_strlen($value['name']) < 3) || (utf8_strlen($value['name']) > 32)) { - $json['errors']['name_' . $language_id] = $this->language->get('ms_error_seller_group_name'); + $json['errors']['seller_group[description]['.$language_id.'][name]'] = $this->language->get('ms_error_seller_group_name'); } } diff --git a/upload/admin/controller/multiseller/seller.php b/upload/admin/controller/multiseller/seller.php index 02d53749..15f2824e 100644 --- a/upload/admin/controller/multiseller/seller.php +++ b/upload/admin/controller/multiseller/seller.php @@ -1,8 +1,8 @@ load->model('setting/store'); + + $actions .= "
+ +
"; + if ($this->currency->format($this->MsLoader->MsBalance->getSellerBalance($result['seller_id']) - $this->MsLoader->MsBalance->getReservedSellerFunds($result['seller_id']), $this->config->get('config_currency'), '', FALSE) > 0) { if (!empty($result['ms.paypal']) && filter_var($result['ms.paypal'], FILTER_VALIDATE_EMAIL)) { - $actions .= ""; + $actions .= " "; } else { - $actions .= ""; + $actions .= "
"; } } - $actions .= ""; - $actions .= ""; + + $actions .= " "; + + $actions .= " "; $available = $this->MsLoader->MsBalance->getSellerBalance($result['seller_id']) - $this->MsLoader->MsBalance->getReservedSellerFunds($result['seller_id']); @@ -61,7 +79,7 @@ public function getTableData() { $result, array( 'checkbox' => "", - 'seller' => "{$result['c.name']}({$result['ms.nickname']})", + 'seller' => "{$result['c.name']}({$result['ms.nickname']})", 'email' => $result['c.email'], 'total_earnings' => $this->currency->format($this->MsLoader->MsSeller->getTotalEarnings($result['seller_id']), $this->config->get('config_currency')), 'balance' => $this->currency->format($this->MsLoader->MsBalance->getSellerBalance($result['seller_id']), $this->config->get('config_currency')) . '/' . $this->currency->format($available > 0 ? $available : 0, $this->config->get('config_currency')), @@ -178,6 +196,8 @@ public function jxSaveSellerInfo() { 'customer_group_id' => $this->config->get('config_customer_group_id'), 'newsletter' => 1, 'status' => 1, + 'approved' => 1, + 'safe' => 1, ) ) ); @@ -214,6 +234,7 @@ public function jxSaveSellerInfo() { case MsSeller::STATUS_INACTIVE: case MsSeller::STATUS_DISABLED: case MsSeller::STATUS_DELETED: + case MsSeller::STATUS_INCOMPLETE: $products = $this->MsLoader->MsProduct->getProducts(array( 'seller_id' => $seller['seller_id'] )); @@ -302,17 +323,17 @@ public function jxPayBalance() { 'custom' => $payment_id ); - list($this->template) = $this->MsLoader->MsHelper->admLoadTemplate('payment/multimerch-paypal'); - - $json['form'] = $this->render(); + list($template, $children) = $this->MsLoader->MsHelper->admLoadTemplate('payment/multimerch-paypal'); + $json['form'] = $this->load->view($template, $this->data); $json['success'] = 1; + $this->response->setOutput(json_encode($json)); } public function delete() { $seller_id = isset($this->request->get['seller_id']) ? $this->request->get['seller_id'] : 0; $this->MsLoader->MsSeller->deleteSeller($seller_id); - $this->redirect($this->url->link('multiseller/seller', 'token=' . $this->session->data['token'], 'SSL')); + $this->response->redirect($this->url->link('multiseller/seller', 'token=' . $this->session->data['token'], 'SSL')); } public function index() { @@ -352,8 +373,10 @@ public function index() { ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('seller'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/seller.tpl', $this->data)); } public function create() { @@ -385,8 +408,10 @@ public function create() { ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('seller-form'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/seller-form.tpl', $this->data)); } public function update() { @@ -445,8 +470,10 @@ public function update() { ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('seller-form'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/seller-form.tpl', $this->data)); } } ?> diff --git a/upload/admin/controller/multiseller/transaction.php b/upload/admin/controller/multiseller/transaction.php index b9316056..00df5b50 100644 --- a/upload/admin/controller/multiseller/transaction.php +++ b/upload/admin/controller/multiseller/transaction.php @@ -35,8 +35,7 @@ public function getTableData() { array( 'id' => $result['balance_id'], 'seller' => $result['nickname'], - //'amount' => $this->currency->format($result['amount'], $this->config->get('config_currency')), - 'amount' => $this->currency->format($result['amount'], $result['currency_code']), + 'amount' => $this->currency->format($result['amount'], $this->config->get('config_currency')), 'description' => (mb_strlen($result['mb.description']) > 80 ? mb_substr($result['mb.description'], 0, 80) . '...' : $result['mb.description']), 'date_created' => date($this->language->get('date_format_short'), strtotime($result['mb.date_created'])), ) @@ -82,12 +81,13 @@ public function index() { ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('transaction'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/transaction.tpl', $this->data)); } public function create() { - $results = $this->MsLoader->MsSeller->getSellers( array(), array( @@ -118,12 +118,14 @@ public function create() { ), array( 'text' => $this->language->get('ms_transactions_new'), - 'href' => $this->url->link('multiseller/transaction', '', 'SSL'), + 'href' => $this->url->link('multiseller/transaction/create', '', 'SSL'), ) )); - list($this->template, $this->children) = $this->MsLoader->MsHelper->admLoadTemplate('transaction-form'); - $this->response->setOutput($this->render()); + $this->data['column_left'] = $this->load->controller('common/column_left'); + $this->data['footer'] = $this->load->controller('common/footer'); + $this->data['header'] = $this->load->controller('common/header'); + $this->response->setOutput($this->load->view('multiseller/transaction-form.tpl', $this->data)); } public function jxSave() { diff --git a/upload/admin/language/english/multiseller/multiseller.php b/upload/admin/language/english/multiseller/multiseller.php index 6a37dddd..83ee530d 100644 --- a/upload/admin/language/english/multiseller/multiseller.php +++ b/upload/admin/language/english/multiseller/multiseller.php @@ -24,8 +24,6 @@ $_['ms_error_directory'] = "Warning: Could not create directory: %s. Please create it manually and make it server-writable before proceeding.
"; $_['ms_error_directory_notwritable'] = "Warning: Directory already exists and is not writable: %s. Please make sure it's empty and make it server-writable before proceeding.
"; $_['ms_error_directory_exists'] = "Warning: Directory already exists: %s. Please make sure it's empty before proceeding.
"; -$_['ms_error_ckeditor'] = "Warning: Failed to copy CKEditor files from %s to %s. Please do it manually if you intend to use it for seller profile and product forms
"; -$_['ms_notice_ckeditor'] = "Notice: If you intend to use RTE (Rich Text Editor) for the seller profile and product forms, please manually copy CKEditor files from %s to %s.
"; $_['ms_error_product_publish'] = 'Failed to publish some products: seller account not active.'; $_['ms_success_installed'] = 'Extension successfully installed'; $_['ms_success_product_status'] = 'Successfully changed product status.'; @@ -79,6 +77,8 @@ $_['ms_sort_order'] = 'Sort order'; $_['ms_name'] = 'Name'; +$_['ms_config_width'] = 'Width'; +$_['ms_config_height'] = 'Height'; $_['ms_description'] = 'Description'; $_['ms_enable'] = 'Enable'; @@ -95,7 +95,9 @@ $_['ms_menu_attributes'] = 'Attributes'; $_['ms_menu_products'] = 'Products'; $_['ms_menu_transactions'] = 'Transactions'; +$_['ms_menu_debug'] = 'Debug'; $_['ms_menu_payment'] = 'Payments'; +$_['ms_menu_addons'] = 'Addons'; $_['ms_menu_settings'] = 'Settings'; // Settings @@ -121,6 +123,9 @@ $_['ms_config_allow_relisting'] = 'Allow re-listing disabled products'; $_['ms_config_allow_relisting_note'] = 'Sellers will be able to re-list the products, which have been disabled (useful if you use product limitation by period or quantity in combination with listing fees)'; +$_['ms_config_enable_banner'] = 'Enable seller banners'; +$_['ms_config_enable_banner_note'] = 'Allow sellers to upload a banner that will be displayed on their profile page'; + $_['ms_config_enable_one_page_seller_registration'] = 'One-page registration'; $_['ms_config_enable_one_page_seller_registration_note'] = 'Enable seller one-page registration'; @@ -147,6 +152,9 @@ $_['ms_config_debit_order_statuses'] = 'Charge statuses'; $_['ms_config_debit_order_statuses_note'] = 'Seller balance will be charged for orders with charge statuses'; +$_['ms_config_display_order_statuses'] = 'Display order statuses'; +$_['ms_config_display_order_statuses_note'] = 'Order statuses that aren\'t selected here will not be visible to sellers'; + $_['ms_config_minimum_withdrawal'] = 'Minimum payout amount'; $_['ms_config_minimum_withdrawal_note'] = 'Minimum balance amount required to request payout'; @@ -183,10 +191,10 @@ $_['ms_config_product_included_fields_note'] = 'Fields to be added in the product form'; $_['ms_config_provide_buyerinfo'] = 'Mail buyer information'; -$_['ms_config_provide_buyerinfo_note'] = 'Include buyer address in the "Product purchased" email'; +$_['ms_config_provide_buyerinfo_note'] = 'Include buyer address in the Product purchased email'; -$_['ms_config_enable_shipping'] = 'Enable shipping'; -$_['ms_config_enable_shipping_note'] = 'New products will be created to require shipping'; +$_['ms_config_enable_shipping'] = 'Enable OpenCart\'s "Shippable" option'; +$_['ms_config_enable_shipping_note'] = 'New products will be created with OpenCart\'s \'Shippable\' field enabled. With MultiMerch Shipping Addon installed, this will enable shipping functionality.'; $_['ms_config_enable_quantities'] = 'Enable quantities'; $_['ms_config_enable_quantities_note'] = 'Allow sellers to specify quantities for products'; @@ -224,31 +232,33 @@ $_['ms_config_sort_order'] = 'Sort Order:'; $_['ms_config_enable_rte'] = 'Enable Rich Text Editor for descriptions'; -$_['ms_config_enable_rte_note'] = 'Enable Rich Text Editor for product and seller description fields. To use this function, you need to copy the ckeditor javascript library folder from the admin (admin/view/javascript) to the catalog (catalog/view/javascript/multimerch)'; +$_['ms_config_enable_rte_note'] = 'Enable Summernote Rich Text Editor for product and seller description fields.'; $_['ms_config_rte_whitelist'] = 'Tag whitelist'; $_['ms_config_rte_whitelist_note'] = 'Permitted tags in RTE (empty = all tags permitted)'; $_['ms_config_image_sizes'] = 'Image sizes'; -$_['ms_config_seller_avatar_image_size'] = 'Seller avatar image size'; +$_['ms_config_seller_avatar_image_size'] = 'Avatar image size'; $_['ms_config_seller_avatar_image_size_seller_profile'] = 'Seller profile'; $_['ms_config_seller_avatar_image_size_seller_list'] = 'Seller list'; $_['ms_config_seller_avatar_image_size_product_page'] = 'Product page'; $_['ms_config_seller_avatar_image_size_seller_dashboard'] = 'Seller dashboard'; +$_['ms_config_seller_banner_size'] = 'Seller banner size'; -$_['ms_config_image_preview_size'] = 'Uploaded preview image size'; +$_['ms_config_image_preview_size'] = 'Image preview size'; $_['ms_config_image_preview_size_seller_avatar'] = 'Seller avatar'; $_['ms_config_image_preview_size_product_image'] = 'Product image'; $_['ms_config_product_image_size'] = 'Product image size'; $_['ms_config_product_image_size_seller_profile'] = 'Seller profile'; -$_['ms_config_product_image_size_seller_products_list'] = 'Seller products list in catalog'; -$_['ms_config_product_image_size_seller_products_list_account'] = 'Seller products list in seller account area'; +$_['ms_config_product_image_size_seller_products_list'] = 'Catalog products'; +$_['ms_config_product_image_size_seller_products_list_account'] = 'Account products'; -$_['ms_config_minimum_uploaded_image_size'] = 'Minimum uploaded image size (Width x Height)'; -$_['ms_config_minimum_uploaded_image_size_note'] = 'Define minimum image dimensions allowed for uploaded images. Set 0 for no limits.'; -$_['ms_config_maximum_uploaded_image_size'] = 'Maximum uploaded image size (Width x Height)'; -$_['ms_config_maximum_uploaded_image_size_note'] = 'Define maximum image dimensions allowed for uploaded images. Set 0 for no limits.'; + +$_['ms_config_uploaded_image_size'] = 'Image size limits'; +$_['ms_config_uploaded_image_size_note'] = 'Define uploaded image dimension limits (W x H). Set 0 for no limits.'; +$_['ms_config_max'] = 'Max.'; +$_['ms_config_min'] = 'Min.'; $_['ms_config_seo'] = 'SEO'; $_['ms_config_enable_seo_urls_seller'] = 'Generate SEO URLs for new sellers'; @@ -318,9 +328,11 @@ $_['ms_catalog_sellers_date_created'] = 'Date created'; $_['ms_catalog_sellers_balance_paypal'] = 'Balance payout via PayPal'; +$_['ms_seller_change'] = 'Change seller'; $_['ms_seller_status_' . MsSeller::STATUS_ACTIVE] = 'Active'; $_['ms_seller_status_' . MsSeller::STATUS_INACTIVE] = 'Inactive'; $_['ms_seller_status_' . MsSeller::STATUS_DISABLED] = 'Disabled'; +$_['ms_seller_status_' . MsSeller::STATUS_INCOMPLETE] = 'Incomplete'; $_['ms_seller_status_' . MsSeller::STATUS_DELETED] = 'Deleted'; $_['ms_seller_status_' . MsSeller::STATUS_UNPAID] = 'Unpaid signup fee'; @@ -444,6 +456,11 @@ $_['ms_error_payment_norequests'] = 'Error: no valid payouts to process. Please make sure the sellers have enough funds and valid PayPal addresses specified'; $_['ms_success_payment_created'] = 'Payment successfully created'; +// Debug +$_['ms_debug_heading'] = 'Debug'; +$_['ms_debug_breadcrumbs'] = 'Debug'; +$_['ms_debug_info'] = 'MultiMerch debug information'; + // Finances - Transactions $_['ms_transactions_heading'] = 'Transactions'; $_['ms_transactions_breadcrumbs'] = 'Transactions'; @@ -539,6 +556,7 @@ $_['ms_mail_product_purchased_comment'] = 'Comment: %s'; // Sales - Mail +$_['ms_transaction_order_created'] = 'Order created'; $_['ms_transaction_order'] = 'Sale: Order Id #%s'; $_['ms_transaction_sale'] = 'Sale: %s (-%s commission)'; $_['ms_transaction_refund'] = 'Refund: %s'; diff --git a/upload/admin/model/multiseller/install.php b/upload/admin/model/multiseller/install.php index b193cd97..db2f4dfb 100644 --- a/upload/admin/model/multiseller/install.php +++ b/upload/admin/model/multiseller/install.php @@ -68,6 +68,7 @@ public function createSchema() { `country_id` INT(11) NOT NULL DEFAULT '0', `zone_id` INT(11) NOT NULL DEFAULT '0', `avatar` VARCHAR(255) DEFAULT NULL, + `banner` VARCHAR(255) DEFAULT NULL, `paypal` VARCHAR(255) DEFAULT NULL, `date_created` DATETIME NOT NULL, `seller_status` TINYINT NOT NULL, @@ -235,6 +236,16 @@ public function createSchema() { `order_status_id` int(11) NOT NULL, PRIMARY KEY (`suborder_id`) ) DEFAULT CHARSET=utf8"); + + $this->db->query(" + CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "ms_suborder_history` ( + `suborder_history_id` int(5) NOT NULL AUTO_INCREMENT, + `suborder_id` int(5) NOT NULL, + `order_status_id` int(5) NOT NULL, + `comment` text NOT NULL DEFAULT '', + `date_added` datetime NOT NULL, + PRIMARY KEY (`suborder_history_id`) + ) DEFAULT CHARSET=utf8"); } public function createData() { @@ -261,16 +272,16 @@ public function createData() { } // multimerch routes - $this->db->query("INSERT INTO " . DB_PREFIX . "layout SET name = 'MultiMerch Seller Account'"); + $this->db->query("INSERT INTO " . DB_PREFIX . "layout SET name = '[MultiMerch] Seller Account Pages'"); $layout_id = $this->db->getLastId(); - $this->db->query("INSERT INTO " . DB_PREFIX . "layout_route SET layout_id = '" . (int)$layout_id . "', route = 'seller/account'"); - $this->db->query("INSERT INTO " . DB_PREFIX . "layout SET name = 'MultiMerch Seller List'"); + $this->db->query("INSERT INTO " . DB_PREFIX . "layout_route SET layout_id = '" . (int)$layout_id . "', route = 'seller/account-%'"); + $this->db->query("INSERT INTO " . DB_PREFIX . "layout SET name = '[MultiMerch] Sellers List'"); $layout_id = $this->db->getLastId(); $this->db->query("INSERT INTO " . DB_PREFIX . "layout_route SET layout_id = '" . (int)$layout_id . "', route = 'seller/catalog-seller'"); - $this->db->query("INSERT INTO " . DB_PREFIX . "layout SET name = 'MultiMerch Seller Profile'"); + $this->db->query("INSERT INTO " . DB_PREFIX . "layout SET name = '[MultiMerch] Seller Profile Page'"); $layout_id = $this->db->getLastId(); $this->db->query("INSERT INTO " . DB_PREFIX . "layout_route SET layout_id = '" . (int)$layout_id . "', route = 'seller/catalog-seller/profile'"); - $this->db->query("INSERT INTO " . DB_PREFIX . "layout SET name = 'MultiMerch Seller Products'"); + $this->db->query("INSERT INTO " . DB_PREFIX . "layout SET name = '[MultiMerch] Seller Products List'"); $layout_id = $this->db->getLastId(); $this->db->query("INSERT INTO " . DB_PREFIX . "layout_route SET layout_id = '" . (int)$layout_id . "', route = 'seller/catalog-seller/products'"); } @@ -307,7 +318,7 @@ public function deleteData() { // remove MultiMerch routes $this->db->query("DELETE FROM " . DB_PREFIX . "layout WHERE name = 'MultiMerch Seller Account'"); - $this->db->query("DELETE FROM " . DB_PREFIX . "layout_route WHERE route = 'seller/account'"); + $this->db->query("DELETE FROM " . DB_PREFIX . "layout_route WHERE route = 'seller/account-%'"); $this->db->query("DELETE FROM " . DB_PREFIX . "layout WHERE name = 'MultiMerch Seller List'"); $this->db->query("DELETE FROM " . DB_PREFIX . "layout_route WHERE route = 'seller/catalog-seller'"); diff --git a/upload/admin/model/multiseller/upgrade.php b/upload/admin/model/multiseller/upgrade.php index 254a687a..48ea0992 100644 --- a/upload/admin/model/multiseller/upgrade.php +++ b/upload/admin/model/multiseller/upgrade.php @@ -30,7 +30,7 @@ private function _createSchemaEntry($version) { public function upgradeDb() { $version = $this->getDbVersion(); - + if (version_compare($version, '1.0.0.0') < 0) { $this->db->query(" CREATE TABLE `" . DB_PREFIX . "ms_db_schema` ( @@ -51,16 +51,41 @@ public function upgradeDb() { PRIMARY KEY (`suborder_id`) ) DEFAULT CHARSET=utf8"); - /*$sql = " - CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "ms_seller_tax_class` ( - `seller_id` int(11) NOT NULL, - `tax_class_id` int(11) NOT NULL, - PRIMARY KEY (`seller_id`), - UNIQUE KEY `seller_id` (`seller_id`) - ) DEFAULT CHARSET=utf8"; - $this->db->query($sql);*/ - $this->_createSchemaEntry('1.0.0.0'); } + + if (version_compare($version, '1.0.1.0') < 0) { + $this->db->query(" + ALTER TABLE `" . DB_PREFIX . "ms_seller` ADD ( + `banner` VARCHAR(255) DEFAULT NULL)"); + + $this->load->model('user/user_group'); + $this->model_user_user_group->addPermission($this->user->getId(), 'access', 'multiseller/addon'); + $this->model_user_user_group->addPermission($this->user->getId(), 'modify', 'multiseller/addon'); + + $this->_createSchemaEntry('1.0.1.0'); + } + + if (version_compare($version, '1.0.2.0') < 0) { + $this->db->query(" + CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "ms_suborder_history` ( + `suborder_history_id` int(5) NOT NULL AUTO_INCREMENT, + `suborder_id` int(5) NOT NULL, + `order_status_id` int(5) NOT NULL, + `comment` text NOT NULL DEFAULT '', + `date_added` datetime NOT NULL, + PRIMARY KEY (`suborder_history_id`) + ) DEFAULT CHARSET=utf8"); + + $this->_createSchemaEntry('1.0.2.0'); + } + + if (version_compare($version, '1.0.2.1') < 0) { + $this->load->model('user/user_group'); + $this->model_user_user_group->addPermission($this->user->getId(), 'access', 'multiseller/debug'); + $this->model_user_user_group->addPermission($this->user->getId(), 'modify', 'multiseller/debug'); + + $this->_createSchemaEntry('1.0.2.1'); + } } } \ No newline at end of file diff --git a/upload/admin/view/javascript/multimerch/common.js b/upload/admin/view/javascript/multimerch/common.js index 56166e7e..0686609e 100644 --- a/upload/admin/view/javascript/multimerch/common.js +++ b/upload/admin/view/javascript/multimerch/common.js @@ -1,14 +1,14 @@ $(function() { $.fn.dataTableExt.sErrMode = 'throw'; - /*if (typeof msGlobals.config_language != 'undefined') { + if (typeof msGlobals.config_language != 'undefined') { $.extend($.fn.dataTable.defaults, { "oLanguage": { "sUrl": msGlobals.config_language } }); - }*/ - + } + $.extend($.fn.dataTable.defaults, { "bProcessing": true, "bSortCellsTop": true, diff --git a/upload/catalog/view/javascript/multimerch/datatables/lang/en.txt b/upload/admin/view/javascript/multimerch/datatables/lang/en.lng similarity index 91% rename from upload/catalog/view/javascript/multimerch/datatables/lang/en.txt rename to upload/admin/view/javascript/multimerch/datatables/lang/en.lng index 226346b1..671c629f 100644 --- a/upload/catalog/view/javascript/multimerch/datatables/lang/en.txt +++ b/upload/admin/view/javascript/multimerch/datatables/lang/en.lng @@ -7,7 +7,7 @@ "sInfoThousands": ",", "sLengthMenu": "Show _MENU_ entries", "sLoadingRecords": "Loading...", - "sProcessing": "Processing...", + "sProcessing": "", "sSearch": "Search:", "sZeroRecords": "No matching records found", "oPaginate": { diff --git a/upload/admin/view/javascript/multimerch/settings.js b/upload/admin/view/javascript/multimerch/settings.js index f02363a5..7da561ee 100644 --- a/upload/admin/view/javascript/multimerch/settings.js +++ b/upload/admin/view/javascript/multimerch/settings.js @@ -1,9 +1,9 @@ $(function() { - $('body').delegate("a.ffRemove", "click", function() { + $('body').delegate(".ffRemove", "click", function() { $(this).parents('tr').remove(); }); - $('body').delegate("a.ffClone", "click", function() { + $('body').delegate(".ffClone", "click", function() { var lastRow = $(this).parents('table').find('tbody tr:last input:last').attr('name'); if (typeof lastRow == "undefined") { var newRowNum = 1; diff --git a/upload/admin/view/stylesheet/multimerch/multiseller.css b/upload/admin/view/stylesheet/multimerch/multiseller.css index a967294a..3eb9e7cb 100644 --- a/upload/admin/view/stylesheet/multimerch/multiseller.css +++ b/upload/admin/view/stylesheet/multimerch/multiseller.css @@ -1,3 +1,22 @@ +.table-responsive { + overflow-x: initial; +} + +.control-inline input, .control-inline select, .input-auto { + width: auto; + display: inline; +} + +.control-inline .col-sm-2 { + height:35px; + line-height: 35px; +} + +.control-inline .col-sm-3 { + text-align: center; + margin:5px 0; +} + .ms-settings .content form table tr h2 { border-bottom: none; text-transform: none; @@ -126,6 +145,21 @@ h1 img { /* datatables */ +.dataTables_wrapper .dataTables_processing { + width: 100%; + height: 100%; + left: 0; + top: 0; + margin:0; + background: rgba(255,255,255,.90); + border: 1px solid #efefef; +} + +.dataTables_wrapper .dataTables_processing i { + margin-top: 15px; +} + + .dataTables_length, .dataTables_filter { display: inline-block; margin-bottom: 5px; @@ -211,4 +245,9 @@ table.list thead td.right { .v-top { vertical-align: top; +} + +.msBlack .ui-widget-header { + background: url("view/image/ui-bg_gloss-wave_35_000000_500x100.png") repeat-x scroll 50% 50% #F6A828; + border: 1px solid #000000; } \ No newline at end of file diff --git a/upload/admin/view/template/multiseller/attribute-form.tpl b/upload/admin/view/template/multiseller/attribute-form.tpl index e59e54da..9c122273 100755 --- a/upload/admin/view/template/multiseller/attribute-form.tpl +++ b/upload/admin/view/template/multiseller/attribute-form.tpl @@ -1,237 +1,203 @@ - +
- - -
-
-

-
- - -
-
-
-
- - - - - - - - - - - + +
+ -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* - - - - - -
- - -
- - -
- -
- -
-
- checked="checked" /> - checked="checked" /> - -
-
- checked="checked" /> - checked="checked" /> -
- checked="checked" /> -
-
- -
-
- checked="checked" /> -
-
- - - - - - - - - - +
+
+

+
+
+ + -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*
- - -
-
- -
-
- -
- -   |   - -
-
- -
-
- -
- - - -
-
- -
-
- - -
- -   |   - -
-
- -
-
- -
- -
-
-
-
+
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + +
+
+ +
+ +
+ + +
+
+ +
+ +
+ checked="checked" /> +
+
+ +
+ +
+ +
+
+ +
+ +
+ checked="checked" /> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
*
+ +
+ +
+ +
+ + + + + +
+ + + +
+ +
+
+ +
+ + + + +
+
+
+ +
+ + \ No newline at end of file diff --git a/upload/admin/view/template/multiseller/debug.tpl b/upload/admin/view/template/multiseller/debug.tpl new file mode 100644 index 00000000..87b2dc16 --- /dev/null +++ b/upload/admin/view/template/multiseller/debug.tpl @@ -0,0 +1,59 @@ + +
+ +
+
+
+

+
+
+ +
+
+
+
+ \ No newline at end of file diff --git a/upload/admin/view/template/multiseller/payment-form.tpl b/upload/admin/view/template/multiseller/payment-form.tpl index ece4e20e..2c6dd316 100644 --- a/upload/admin/view/template/multiseller/payment-form.tpl +++ b/upload/admin/view/template/multiseller/payment-form.tpl @@ -1,110 +1,117 @@ - +
- - - - -
-
-

-
- - -
-
-
-
- - - - - + + - - - - + + - - - - - - - - - + + + +
+ +
+ currency->getSymbolLeft(); ?> + + currency->getSymbolRight(); ?> +
+
- - - - - - - - - + + + +
+ +
+ +
+
+ +
+ +
+ +
+
- - - - - - - - - -
- - + -
- - + -
- $name) { ?> -
- currency->getSymbolLeft(); ?> - - currency->getSymbolRight(); ?> -
- -
- -
- -
-
-
+
+ +
+ +
+
+ +
+ \ No newline at end of file diff --git a/upload/admin/view/template/multiseller/seller-form.tpl b/upload/admin/view/template/multiseller/seller-form.tpl index c4b878be..df85a4f6 100644 --- a/upload/admin/view/template/multiseller/seller-form.tpl +++ b/upload/admin/view/template/multiseller/seller-form.tpl @@ -1,287 +1,300 @@ - +
- -
-
-

-
-
-
-
- -
- - -
-
- - - - - - + +
+ -
- - - +
+
+

+
+
+ + + +
+
-
- - - +
+ +
+ -
- - - +
+ + + + + +
+ - - - - +
+ +
+ +
+
- - - - +
+ +
+ +
+
- - - - - - - - - - +
+ +
+ +
+
- - - - +
+ +
+ +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ +
+ +
+
+ - - - - - - - - - - -

* - - - - - -
- -
- -
- -
- -
- -

- - * - -
- -
-
- - - - -
- -
- -
-
- -

-
- -
-
- - - - -
-
- -
- - - - - - -
- - - - -
-
- -
- - - - - - - - - - - - - +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ +

+
+
+ +
+ +
+ +
+
-
- - - -
language->get('ms_commission_' . MsCommission::RATE_SALE); ?> - - - currency->getSymbolLeft(); ?> - - currency->getSymbolRight(); ?> - +% -
language->get('ms_commission_' . MsCommission::RATE_LISTING); ?> - - - currency->getSymbolLeft(); ?> - - currency->getSymbolRight(); ?> - +% - -
-
- -
- -
-
+
+ +
+
+ + + + +
+
+
+ + +
+ +
+ +
+
+ +
+ +
+ + + + +
+
+ +
+ + +
+ +
+
+ + + + +
+ + + +
+ +
+
+ + +
+ +
+ + + currency->getSymbolLeft(); ?> + + currency->getSymbolRight(); ?> + +% +
+
+ +
+ +
+ + + currency->getSymbolLeft(); ?> + + currency->getSymbolRight(); ?> + +% + +
+
+
+
+ + + + + + + diff --git a/upload/admin/view/template/multiseller/seller.tpl b/upload/admin/view/template/multiseller/seller.tpl index 8d4af8e3..bad041fc 100644 --- a/upload/admin/view/template/multiseller/seller.tpl +++ b/upload/admin/view/template/multiseller/seller.tpl @@ -1,56 +1,67 @@ - +
-