Magento1.x模板claue在使用时Layered Navigation 报错

neasel 发表了文章 • 0 个评论 • 20 次浏览 • 2018-09-14 16:11 • 来自相关话题

替换 app\code\local 下的MGS目录,则可以在前台 frontend builder中正常添加。 app\code\local\MGS\Mpanel\Helper\data.php报错的错用以下内容替换 [code]< ...查看全部
替换 app\code\local 下的MGS目录,则可以在前台 frontend builder中正常添加。
app\code\local\MGS\Mpanel\Helper\data.php报错的错用以下内容替换
[code]<?php

class MGS_Mpanel_Helper_Data extends MGS_Mgscore_Helper_Data {

protected $_ids;

// Check to accept to use builder panel
public function acceptToUsePanel() {
if ($this->showButton() && (Mage::getSingleton('core/session')->getUsePanel() == 1)) {
return true;
}
return false;
}

public function showButton() {

if (Mage::getStoreConfig('mpanel/general/enabled')) {

$logedAccountId = Mage::getSingleton('customer/session')->getCustomer()->getEmail();

$acceptAccounts = Mage::getStoreConfig('mpanel/general/account');
if ($acceptAccounts == '') {
return false;
}
$acceptAccountIds = explode(',', $acceptAccounts);
$acceptAccountIds = array_filter($acceptAccountIds);

if ((count($acceptAccountIds) > 0) && (in_array($logedAccountId, $acceptAccountIds))) {
return true;
}
}

return false;
}

// Check cms page, if is cms page return true
public function isCmsPage() {
$module = Mage::app()->getRequest()->getModuleName();
if ($module == 'cms') {
return true;
}
return false;
}

// Check customer page, if is customer page return true
public function isCustomerPage() {
$module = Mage::app()->getRequest()->getModuleName();
$controller = Mage::app()->getRequest()->getControllerName();
$action = Mage::app()->getRequest()->getActionName();
$str = $module . '-' . $controller . '-' . $action;
if ($str == 'customer-account-index' || $str == 'customer-account-edit' || $str == 'customer-address-index' || $str == 'sales-order-history' || $str == 'sales-billing_agreement-index' || $str == 'sales-recurring_profile-index' || $str == 'review-customer-index' || $str == 'tag-customer-index' || $str == 'wishlist-index-index' || $str == 'oauth-customer_token-index' || $str == 'newsletter-manage-index' || $str == 'downloadable-customer-products' || $str == 'productquestions-index-index') {
return true;
}
return false;
}

// Check homepage, if is homepage return true
public function isHomepage() {
$module = Mage::app()->getRequest()->getModuleName();
$controller = Mage::app()->getRequest()->getControllerName();
$action = Mage::app()->getRequest()->getActionName();

if ((Mage::getSingleton('cms/page')->getIdentifier() == 'home' && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms') || Mage::getUrl() == Mage::getUrl('*/*/*', array('_current' => true, '_use_rewrite' => true)) || ($module == 'cms' && $controller == 'index' && $action == 'index')) {
return true;
}
return false;
}

// check category and product detail page
public function isCatalogPage() {
$module = Mage::app()->getRequest()->getModuleName();
if ($module == 'catalog') {
return true;
}
return false;
}

// check category page
public function isCategoryPage() {
$controller = Mage::app()->getRequest()->getControllerName();
if ($controller == 'category') {
return true;
}
return false;
}

// check catalog search page
public function isCatalogSearchPage() {
$controller = Mage::app()->getRequest()->getModuleName();
if ($controller == 'catalogsearch') {
return true;
}
return false;
}

// check product page
public function isProductPage() {
$controller = Mage::app()->getRequest()->getControllerName();
if ($controller == 'product') {
return true;
}
return false;
}

// Get all page layout of site (1 column, 2 columns left...), return dropdown html
public function getPageLayoutHtml($pageId) {
$page = Mage::getModel('cms/page')->load($pageId);

$storeIds = $page->getStoreId();
$html = '';

if (count($storeIds) > 0) {
foreach ($storeIds as $storeId) {
$html .= '<input type="hidden" name="stores[]" value="' . $storeId . '"/>';
}
}

$html .= '<select name="root_template" class="page-layout" onchange="this.form.submit();">';

foreach (Mage::getSingleton('page/config')->getPageLayouts() as $layout) {
$label = $layout->getLabel();
$value = $layout->getCode();
$html .= '<option value="' . $value . '"';
if ($page->getRootTemplate() == $value) {
$html .= ' selected="selected"';
}
$html .= '>' . $label . '</option>';
}

$html .= '</select>';

return $html;
}

// Get all page layout (1 column, 2 columns left...) for catalog page
public function getCatalogLayoutUpdate() {
if (Mage::registry('current_product')) {
$product = Mage::registry('current_product');
$currentLayout = $product->getPageLayout();
} else {
$category = Mage::registry('current_category');
$currentLayout = $category->getPageLayout();
}

$layout = Mage::getSingleton('page/source_layout')->toOptionArray();
array_unshift($layout, array('value' => '', 'label' => Mage::helper('catalog')->__('No layout updates')));

$html = '<select name="general[page_layout]" class="page-layout" onchange="this.form.submit();">';
foreach ($layout as $_layout) {
$html .= '<option value="' . $_layout['value'] . '"';
if ($currentLayout == $_layout['value']) {
$html .= ' selected="selected"';
}
$html .= '>' . $_layout['label'] . '</option>';
}
$html .= '</select>';

return $html;
}

public function getPageSettings() {
if (Mage::registry('current_product')) {
return $this->getLayout()->createBlock('core/template')->setTemplate('mgs/mpanel/panel/product-settings.phtml')->toHtml();
} else {
$category = Mage::registry('current_category');
return $this->getLayout()->createBlock('core/template')->setCategory($category)->setTemplate('mgs/mpanel/panel/category-settings.phtml')->toHtml();
}
}

// Check homepage has use builder panel or not
public function useHomepageBuilder() {
$storeId = Mage::app()->getStore()->getId();
$homeStore = Mage::getModel('mpanel/store')
->getCollection()
->addFieldToFilter('store_id', $storeId)
->addFieldToFilter('status', 1);
if (count($homeStore) > 0) {
return true;
}
return false;
}

// Return html of dropdown homepage config (Use CMS Page, Use Homepage Builder)
public function getHomepageConfigHtml() {
$html = '<input type="checkbox" data-toggle="toggle" data-height="20" data-width="110" data-on="Use Builder" data-off="Use CMS" data-onstyle="success" data-offstyle="warning" name="status" value="1" id="homesetting" onchange="checkBuilder()"';
if ($this->useHomepageBuilder()) {
$html .= ' checked="checked"';
}
$html .= '/> ';

return $html;
}

// Get all homepage layout from database
public function getHomeLayouts() {
$layouts = Mage::getModel('mpanel/home')
->getCollection();
return $layouts;
}

// Check a layout have active or not
public function isActiveLayout($layoutName) {
$storeId = Mage::app()->getStore()->getId();
$homeStore = Mage::getModel('mpanel/store')
->getCollection()
->addFieldToFilter('store_id', $storeId)
->addFieldToFilter('name', $layoutName);
if ($homeStore->getFirstItem()->getStatus()) {
return true;
}
return false;
}

// Get WYSIWYG Editor config
public function getConfig($data = array()) {
$config = new Varien_Object();

$config->setData(array(
'enabled' => true,
'hidden' => 1,
'use_container' => false,
'add_variables' => false,
'add_widgets' => true,
'no_display' => false,
'translator' => Mage::helper('cms'),
'encode_directives' => true,
'directives_url' => str_replace('https', 'http', Mage::getUrl('mpanel/wysiwyg/directive')),
'widget_window_url' => str_replace('https', 'http', Mage::getUrl('mpanel/adminhtml_widget/index')),
'popup_css' =>
Mage::getBaseUrl('js') . 'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css',
'content_css' =>
Mage::getBaseUrl('js') . 'mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css',
'width' => '100%',
'plugins' => array(
/* array(
'name'=>'magentovariable',
'src'=> Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js',
'options'=> array(
'title'=>'Insert Variable...',
'url'=> Mage::getUrl('mpanel/variable/wysiwygPlugin'),
'onclick'=> array(
'search'=> array(
'html_id'
),
'subject'=> "MagentovariablePlugin.loadChooser('".Mage::getUrl('mpanel/variable/wysiwygPlugin')."', '{{html_id}}');"
),
'class'=> 'add-variable plugin'
)
),

array(
'name'=>'magentowidget',
'src'=> Mage::getBaseUrl('js').'mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js',

) */
),
'directives_url_quoted' => str_replace('https', 'http', Mage::getUrl('mpanel/wysiwyg/directive'))
));

//$config->setData('directives_url_quoted', preg_quote($config->getData('directives_url')));

$config->addData(array(
'add_images' => true,
'files_browser_window_url' => str_replace('https', 'http', Mage::getUrl('mpanel/wysiwyg/index')),
'files_browser_window_width' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_width'),
'files_browser_window_height' => (int) Mage::getConfig()->getNode('adminhtml/cms/browser/window_height'),
'widget_plugin_src' => Mage::getBaseUrl('js') . 'mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js',
'widget_images_url' => Mage::getDesign()->getSkinUrl('images/widget', array('_area' => 'adminhtml')),
));


if (is_array($data)) {
$config->addData($data);
}

Mage::dispatchEvent('cms_wysiwyg_config_prepare', array('config' => $config));

return $config;
}

// Get edit panel of a block
public function getEditPanel($id) {
$html = '<div class="edit-panel parent-panel"><ul>';
$html .='<li class="up-link"><a title="' . $this->__('Move Up') . '" onclick="return false;" href="#" class="moveuplink"><em class="fa fa-arrow-up"> </em></a></li>';
$html .='<li class="down-link"><a title="' . $this->__('Move Down') . '" onclick="return false;" href="#" class="movedownlink"><em class="fa fa-arrow-down"> </em></a></li>';
$html .='<li><a href="' . Mage::getUrl('mpanel/edit/block', array('layout' => '1_column_full', 'id' => $id)) . '" class="popup-link" title="' . $this->__('Edit') . '"><em class="fa fa-gear"></em></a></li>';
$html .='<li><a href="#" title="' . $this->__('Delete') . '" onclick="if(confirm(\'' . $this->__('Are you sure you would like to remove this section?') . '\')) removeSection(' . $id . '); return false"><em class="fa fa-close"></em></a></li>';
$html .='</ul></div>';

return $html;
}

// Get edit panel of a header
public function getEditHeaderPanel() {
$isSecure = Mage::app()->getStore()->isCurrentlySecure();
if ($isSecure) {
$html = '<div class="edit-panel"><ul><li><a class="popup-link" href="' . Mage::getUrl('mpanel/edit/header', array('_secure' => true)) . '" title="' . $this->__('Edit Header') . '"><em class="fa fa-gear"></em></a></li></ul></div>';
} else {
$html = '<div class="edit-panel"><ul><li><a class="popup-link" href="' . Mage::getUrl('mpanel/edit/header') . '" title="' . $this->__('Edit Header') . '"><em class="fa fa-gear"></em></a></li></ul></div>';
}
return $html;
}

// Get edit panel of a footer
public function getEditFooterPanel() {
$isSecure = Mage::app()->getStore()->isCurrentlySecure();
if ($isSecure) {
$html = '<div class="edit-panel"><ul><li><a class="popup-link" href="' . Mage::getUrl('mpanel/edit/footer', array('_secure' => true)) . '" title="' . $this->__('Edit Footer') . '"><em class="fa fa-gear"></em></a></li></ul></div>';
} else {
$html = '<div class="edit-panel"><ul><li><a class="popup-link" href="' . Mage::getUrl('mpanel/edit/footer') . '" title="' . $this->__('Edit Footer') . '"><em class="fa fa-gear"></em></a></li></ul></div>';
}
return $html;
}

// Add edit panel for logo
public function getEditLogoPanel() {
$isSecure = Mage::app()->getStore()->isCurrentlySecure();

$html = '<div class="edit-panel logo-panel child-panel"><ul>';

if ($isSecure) {
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/logo', array('_secure' => true)) . '" class="popup-link" title="' . $this->__('Upload Logo') . '"><em class="fa fa-edit"> </em></a></li>';
} else {
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/logo') . '" class="popup-link" title="' . $this->__('Upload Logo') . '"><em class="fa fa-edit"> </em></a></li>';
}
$html .= '</ul></div>';

return $html;
}

// Show WishList Button
public function isShowWishList() {
if(!Mage::getStoreConfig('mpanel/catalog/wishlist_button')){
return true;
}
return false;
}

// Check if product is in wishlist
public function checkInWishilist($_product){
Mage::getSingleton('customer/session')->isLoggedIn();
$session = Mage::getSingleton('customer/session');
$cidData = $session->isLoggedIn();
$customer_id = $session->getId();

if($customer_id){
$wishlist = Mage::getModel('wishlist/item')->getCollection();
$wishlist->getSelect()
->join(array('t2' => 'wishlist'),
'main_table.wishlist_id = t2.wishlist_id',
array('wishlist_id','customer_id'))
->where('main_table.product_id = '.$_product->getId().' AND t2.customer_id='.$customer_id);
$count = $wishlist->count();
$wishlist = Mage::getModel('wishlist/item')->getCollection();
}
else {
$count="0";
}

if ($count) :
return true;
else:
return false;
endif;
}

// Show Compare Button
public function isShowCompare() {
if(!Mage::getStoreConfig('mpanel/catalog/compare_button')){
return true;
}
return false;
}

// Show Add to Cart Button
public function isShowAddtoCart() {
if(!Mage::getStoreConfig('mpanel/catalog/hide_add_to_cart_button')){
return true;
}
return false;
}

// Add edit panel for category image
public function getEditCategoryImage($id) {
$html = '<div class="edit-panel inline-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/categoryImage', array('id' => $id)) . '" class="popup-link" title="' . $this->__('Upload Image For This Category') . '"><em class="fa fa-edit"> </em></a></li>';
$html .= '</ul></div>';

return $html;
}

// Add edit panel for product tab
public function getDeleteProductTab($alias) {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteProductTab', array('alias' => $alias)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this tab?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';

return $html;
}

// Add edit panel for category description
public function getEditCategoryDescription($id) {
$html = '<div class="edit-panel inline-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/categoryDescription', array('id' => $id)) . '" class="popup-link" title="' . $this->__('Edit Description For This Category') . '"><em class="fa fa-edit"> </em></a></li>';
$html .= '</ul></div>';

return $html;
}

// Add edit panel for welcome text and copyright
public function getEditStoreConfig($tag, $text) {
$html = '<div class="edit-panel inline-panel ' . $tag . '-config"><ul>';
$html .= '<li><a href="#" onclick="toggleEl(\'' . $tag . '\'); return false" class="edit-inline" title="' . $this->__('Edit') . '"><em class="fa fa-edit"> </em></a><div class="input-inline" style="display:none" id="' . $tag . '">';

if ($tag == 'design-footer-copyright') {
$html .= '<textarea type="text" id="' . $tag . '-input" class="input-text edit-input">' . $text . '</textarea>';
} else {
$html .= '<input type="text" value="' . $text . '" id="' . $tag . '-input" class="input-text edit-input"/>';
}

$html .= '<button type="button" onclick="saveStoreConfig(\'' . $tag . '\',\'' . $this->__('Save') . '\',\'' . $this->__('Saving...') . '\')" class="btn btn-primary btn-save-config">' . $this->__('Save') . '</button></div></li>';
$html .= '</ul></div>';
return $html;
}

// Add edit panel for gmap
public function getEditMapPanel() {
$html = '<div class="edit-panel map-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/map') . '" class="popup-link" title="' . $this->__('Edit Map Information') . '"><em class="fa fa-edit"> </em></a></li>';
$html .= '</ul></div>';

return $html;
}

// Add edit panel for contact information
public function getEditContactInfoPanel() {
$html = '<div class="edit-panel contact-info-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/info') . '" class="popup-link" title="' . $this->__('Edit Contact Information') . '"><em class="fa fa-edit"> </em></a></li>';
$html .= '</ul></div>';

return $html;
}

// Get block content by layout and block_id
public function getBlockContent($layout, $id) {

}

//Return content of a homepage if homepage use builder panel
public function getLayoutConfig() {
$storeId = Mage::app()->getStore()->getId();

$config = Mage::getModel('mpanel/store')
->getCollection()
->addFieldToFilter('store_id', $storeId)
->addFieldToFilter('status', 1);

if ($this->acceptToUsePanel()) {
return $this->getLayout()->createBlock('mpanel/template')->setTemplate('mgs/mpanel/template/admin/' . $config->getFirstItem()->getName() . '.phtml')->toHtml();
} else {
return $this->getLayout()->createBlock('mpanel/template')->setTemplate('mgs/mpanel/template/' . $config->getFirstItem()->getName() . '.phtml')->toHtml();
}
}

//Return content of a category right if use builder panel
public function getLayoutConfigCategoryRight() {
if ($this->acceptToUsePanel()) {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('category_right')->setBlockName('block_category_right')->setTemplate('mgs/mpanel/template/admin/category_right.phtml')->toHtml();
} else {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('category_right')->setBlockName('block_category_right')->setTemplate('mgs/mpanel/template/category_right.phtml')->toHtml();
}
}

//Return content of a category left if use builder panel
public function getLayoutConfigCategoryLeft() {
if ($this->acceptToUsePanel()) {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('category_left')->setBlockName('block_category_left')->setTemplate('mgs/mpanel/template/admin/category_left.phtml')->toHtml();
} else {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('category_left')->setBlockName('block_category_left')->setTemplate('mgs/mpanel/template/category_left.phtml')->toHtml();
}
}

//Return content of a catalog search right if use builder panel
public function getLayoutConfigCatalogSearchRight() {
if ($this->acceptToUsePanel()) {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('catalog_search_right')->setBlockName('block_catalog_search_right')->setTemplate('mgs/mpanel/template/admin/catalog_search_right.phtml')->toHtml();
} else {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('catalog_search_right')->setBlockName('block_catalog_search_right')->setTemplate('mgs/mpanel/template/catalog_search_right.phtml')->toHtml();
}
}

//Return content of a catalog search left if use builder panel
public function getLayoutConfigCatalogSearchLeft() {
if ($this->acceptToUsePanel()) {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('catalog_search_left')->setBlockName('block_catalog_search_left')->setTemplate('mgs/mpanel/template/admin/catalog_search_left.phtml')->toHtml();
} else {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('catalog_search_left')->setBlockName('block_catalog_search_left')->setTemplate('mgs/mpanel/template/catalog_search_left.phtml')->toHtml();
}
}

//Return content of a cms right if use builder panel
public function getLayoutConfigCmsRight() {
if ($this->acceptToUsePanel()) {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('cms_right')->setBlockName('block_cms_right')->setTemplate('mgs/mpanel/template/admin/cms_right.phtml')->toHtml();
} else {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('cms_right')->setBlockName('block_cms_right')->setTemplate('mgs/mpanel/template/cms_right.phtml')->toHtml();
}
}

//Return content of a cms left if use builder panel
public function getLayoutConfigCmsLeft() {
if ($this->acceptToUsePanel()) {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('cms_left')->setBlockName('block_cms_left')->setTemplate('mgs/mpanel/template/admin/cms_left.phtml')->toHtml();
} else {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('cms_left')->setBlockName('block_cms_left')->setTemplate('mgs/mpanel/template/cms_left.phtml')->toHtml();
}
}

//Return content of a customer right if use builder panel
public function getLayoutConfigCustomerRight() {
if ($this->acceptToUsePanel()) {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('customer_right')->setBlockName('block_customer_right')->setTemplate('mgs/mpanel/template/admin/customer_right.phtml')->toHtml();
} else {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('customer_right')->setBlockName('block_customer_right')->setTemplate('mgs/mpanel/template/customer_right.phtml')->toHtml();
}
}

//Return content of a customer left if use builder panel
public function getLayoutConfigCustomerLeft() {
if ($this->acceptToUsePanel()) {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('customer_left')->setBlockName('block_customer_left')->setTemplate('mgs/mpanel/template/admin/customer_left.phtml')->toHtml();
} else {
return $this->getLayout()->createBlock('mpanel/template')->setTemplateLayout('customer_left')->setBlockName('block_customer_left')->setTemplate('mgs/mpanel/template/customer_left.phtml')->toHtml();
}
}

// Return new position for a child block
public function getNewPositionOfChild($storeId, $blockName, $templateLayout) {
$child = Mage::getModel('mpanel/childs')
->getCollection()
->addFieldToFilter('store_id', $storeId)
->addFieldToFilter('block_name', $blockName)
->addFieldToFilter('home_name', $templateLayout)
->setOrder('position', 'DESC')
->getFirstItem();

if ($child->getId()) {
$position = (int) $child->getPosition() + 1;
} else {
$position = 1;
}

return $position;
}

public function getEditChild($layout, $block, $child, $type) {
$html = '<div class="edit-panel child-panel"><ul>';

$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';

$html .= '<li><a href="' . Mage::getUrl('mpanel/index/form', array('template' => $layout, 'block' => $block, 'id' => $child, 'type' => $type)) . '" class="popup-link" title="' . $this->__('Edit') . '"><em class="fa fa-edit"> </em></a></li>';

$html .= '<li class="change-col"><a href="javascript:void(0)" title="' . $this->__('Change column setting') . '"><em class="fa fa-columns"> </em></a><ul>';

for ($i = 1; $i <= 12; $i++) {
$html .= '<li><a href="' . Mage::getUrl('mpanel/edit/col', array('id' => $child, 'col' => $i)) . '" onclick="changeBlockCol(this.href); return false"><span>' . $i . '/12</span></a></li>';
}

$html .= '</ul></li>';

$html .= '<li><a href="' . Mage::getUrl('mpanel/post/delete', array('id' => $child)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';

return $html;
}

public function getEditChildInCategory($layout, $block, $child, $type, $category_id, $product_id) {
if ($type == 'core') {
if ($product_id) {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCategory', array('template' => $layout, 'type' => $type, 'block' => $child, 'category_id' => $category_id, 'product_id' => $product_id)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
} else {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCategory', array('template' => $layout, 'type' => $type, 'block' => $child, 'category_id' => $category_id)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
}
} else {
if ($product_id) {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/index/formInCategory', array('template' => $layout, 'block' => $block, 'id' => $child, 'type' => $type, 'category_id' => $category_id, 'product_id' => $product_id)) . '" class="popup-link" title="' . $this->__('Edit') . '"><em class="fa fa-edit"> </em></a></li>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCategory', array('id' => $child, 'category_id' => $category_id, 'product_id' => $product_id)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
} else {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/index/formInCategory', array('template' => $layout, 'block' => $block, 'id' => $child, 'type' => $type, 'category_id' => $category_id)) . '" class="popup-link" title="' . $this->__('Edit') . '"><em class="fa fa-edit"> </em></a></li>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCategory', array('id' => $child, 'category_id' => $category_id)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
}
}

return $html;
}

public function getEditChildInCms($layout, $block, $child, $type, $page_id) {
if ($type == 'core') {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCms', array('template' => $layout, 'type' => $type, 'block' => $child, 'page_id' => $page_id)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
} else {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/index/formInCms', array('template' => $layout, 'block' => $block, 'id' => $child, 'type' => $type, 'page_id' => $page_id)) . '" class="popup-link" title="' . $this->__('Edit') . '"><em class="fa fa-edit"> </em></a></li>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCms', array('id' => $child, 'page_id' => $page_id)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
}

return $html;
}

public function getEditChildInCustomer($layout, $block, $child, $type) {
if ($type == 'core') {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCustomer', array('template' => $layout, 'type' => $type, 'block' => $child)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
} else {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/index/formInCustomer', array('template' => $layout, 'block' => $block, 'id' => $child, 'type' => $type)) . '" class="popup-link" title="' . $this->__('Edit') . '"><em class="fa fa-edit"> </em></a></li>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCustomer', array('id' => $child)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
}

return $html;
}

public function getEditChildInCatalogSearch($layout, $block, $child, $type) {
if ($type == 'core') {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCatalogSearch', array('template' => $layout, 'type' => $type, 'block' => $child)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
} else {
$html = '<div class="edit-panel child-panel"><ul>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/index/formInCatalogSearch', array('template' => $layout, 'block' => $block, 'id' => $child, 'type' => $type)) . '" class="popup-link" title="' . $this->__('Edit') . '"><em class="fa fa-edit"> </em></a></li>';
$html .= '<li class="sort-handle"><a href="#" onclick="return false;" title="' . $this->__('Move') . '"><em class="fa fa-arrows"> </em></a></li>';
$html .= '<li><a href="' . Mage::getUrl('mpanel/post/deleteInCatalogSearch', array('id' => $child)) . '" onclick="return confirm(\'' . $this->__('Are you sure you would like to remove this block?') . '\')" title="' . $this->__('Delete') . '"><em class="fa fa-trash"> </em></a></li>';
$html .= '</ul></div>';
}

return $html;
}

public function renderHtmlContent($templateLayout, $blockName, $currentCategoryId, $key, $value, $isAdmin, $currentProductId) {
$blocks = array(
'categoryNavigation' => array(
'block' => 'mpanel/navigation',
'template' => 'mgs/mpanel/template/category-navigation.phtml'
),
'subCategories' => array(
'block' => 'catalog/navigation',
'template' => 'catalog/navigation/left.phtml'
),
'layeredNavigation' => array(
'block' => 'catalog/layer_view',
'template' => 'catalog/layer/view.phtml'
),
'cartSidebar' => array(
'block' => 'checkout/cart_sidebar',
'template' => 'checkout/cart/sidebar.phtml'
),
'compareSidebar' => array(
'block' => 'catalog/product_compare_sidebar',
'template' => 'catalog/product/compare/sidebar.phtml'
),
'reorderSidebar' => array(
'block' => 'sales/reorder_sidebar',
'template' => 'sales/reorder/sidebar.phtml'
),
'poll' => array(
'block' => 'poll/activePoll',
'poll_template' => array(
'poll' => 'poll/active.phtml',
'results' => 'poll/result.phtml'
)
),
'productViewed' => array(
'block' => 'reports/product_viewed',
'template' => 'reports/product_viewed.phtml'
),
'wishlistSidebar' => array(
'block' => 'wishlist/customer_sidebar',
'template' => 'wishlist/sidebar.phtml'
),
'tagsPopular' => array(
'block' => 'tag/popular',
'template' => 'tag/popular.phtml'
),
'newsletter' => array(
'block' => 'newsletter/subscribe',
'template' => 'newsletter/subscribe.phtml'
),
'productRelated' => array(
'block' => 'catalog/product_list_related',
'template' => 'catalog/product/list/related.phtml'
),
'menu' => array(
'block' => 'megamenu/vertical',
'template' => 'megamenu/vertical.phtml'
),
'featuredProducts' => array(
'block' => 'mpanel/products',
'template' => 'mgs/mpanel/products/list/featured_products.phtml'
),
'bestsellerProducts' => array(
'block' => 'mpanel/products',
'template' => 'mgs/mpanel/products/list/hot_products.phtml'
),
'newProducts' => array(
'block' => 'mpanel/product_new',
'template' => 'mgs/mpanel/products/list/new_products.phtml'
),
'topRateProducts' => array(
'block' => 'mpanel/product_rate',
'template' => 'mgs/mpanel/products/list/rate_products.phtml'
),
'saleProducts' => array(
'block' => 'mpanel/product_sale',
'template' => 'mgs/mpanel/products/list/sale_products.phtml'
),
'facebookLikeBox' => array(
'block' => 'social/fblikebox',
'template' => 'mgs/social/facebook-like-box.phtml'
),
'twitterFeed' => array(
'block' => 'core/template',
'template' => 'mgs/mpanel/twitter_tweets.phtml'
)
);
foreach ($blocks as $block => $data) {
if ($block == $key) {
if ($key == 'subCategories') {
if ($this->isCategoryPage()) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else if ($key == 'layeredNavigation') {
if ($this->isCategoryPage()) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else if ($key == 'productRelated') {
if ($this->isProductPage()) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else if ($key == 'poll') {
$arr = explode('-', $value);
if (isset($arr[1])) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$poll = $this->getLayout()->createBlock($data['block'])
->setPollId($arr[1]);
foreach ($data['poll_template'] as $k => $v) {
$poll->setPollTemplate($v, $k);
}
$html .= $poll->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else if ($key == 'menu') {
$arr = explode('-', $value);
if (isset($arr[1])) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setMenuId($arr[1])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else if ($key == 'categoryNavigation') {
$arr = explode('-', $value);
if (isset($arr[1])) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setSelectedCategoryId($arr[1])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else if ($key == 'featuredProducts' || $key == 'bestsellerProducts' || $key == 'newProducts' || $key == 'topRateProducts' || $key == 'saleProducts') {
$arr = explode('=', $value);
if (isset($arr[1])) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setTitle($arr[0])
->setProductsCount($arr[1])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else if ($key == 'facebookLikeBox') {
$arr = explode('|', $value);
if (count($arr)) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setTitle($arr[0])
->setPageId($arr[1])
->setConnection($arr[2])
->setWidth($arr[3])
->setHeight($arr[4])
->setShowHeader($arr[5])
->setShowFace($arr[6])
->setShowStream($arr[7])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else if ($key == 'twitterFeed') {
$arr = explode('|', $value);
if (count($arr)) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setTitle($arr[0])
->setUser($arr[1])
->setCount($arr[2])
->setTruncate($arr[3])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else {
if (strpos($key, 'promoBanner') !== false) {
$id = str_replace('promoBanner', '', $key);
$promo = Mage::getModel('promobanners/promobanners')->load($id);
if ($id && $promo->getId()) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCategory($templateLayout, $blockName, $key, 'core', $currentCategoryId, $currentProductId);
} else {
$html .= '<div class="block block-banner">';
}
$html .= $this->getLayout()
->createBlock('promobanners/promobanners')
->setBannerId($id)
->setTemplate('mgs/promobanners/banner.phtml')
->toHtml();
$html .= '</div>';
echo $html;
}
break;
}
}
}
}

public function renderHtmlContentInCms($templateLayout, $blockName, $pageId, $key, $value, $isAdmin) {
$blocks = array(
'categoryNavigation' => array(
'block' => 'mpanel/navigation',
'template' => 'mgs/mpanel/template/category-navigation.phtml'
),
'cartSidebar' => array(
'block' => 'checkout/cart_sidebar',
'template' => 'checkout/cart/sidebar.phtml'
),
'compareSidebar' => array(
'block' => 'catalog/product_compare_sidebar',
'template' => 'catalog/product/compare/sidebar.phtml'
),
'reorderSidebar' => array(
'block' => 'sales/reorder_sidebar',
'template' => 'sales/reorder/sidebar.phtml'
),
'poll' => array(
'block' => 'poll/activePoll',
'poll_template' => array(
'poll' => 'poll/active.phtml',
'results' => 'poll/result.phtml'
)
),
'productViewed' => array(
'block' => 'reports/product_viewed',
'template' => 'reports/product_viewed.phtml'
),
'wishlistSidebar' => array(
'block' => 'wishlist/customer_sidebar',
'template' => 'wishlist/sidebar.phtml'
),
'tagsPopular' => array(
'block' => 'tag/popular',
'template' => 'tag/popular.phtml'
),
'newsletter' => array(
'block' => 'newsletter/subscribe',
'template' => 'newsletter/subscribe.phtml'
)
);
foreach ($blocks as $block => $data) {
if ($block == $key) {
if ($key == 'poll') {
$arr = explode('-', $value);
if (isset($arr[1])) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCms($templateLayout, $blockName, $key, 'core', $pageId);
}
$poll = $this->getLayout()->createBlock($data['block'])
->setPollId($arr[1]);
foreach ($data['poll_template'] as $k => $v) {
$poll->setPollTemplate($v, $k);
}
$html .= $poll->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else if ($key == 'categoryNavigation') {
$arr = explode('-', $value);
if (isset($arr[1])) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCms($templateLayout, $blockName, $key, 'core', $pageId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setSelectedCategoryId($arr[1])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCms($templateLayout, $blockName, $key, 'core', $pageId);
}
$html .= $this->getLayout()
->createBlock($data['block'])
->setTemplate($data['template'])
->toHtml();
if ($isAdmin) {
$html .= '</div>';
}
echo $html;
}
} else {
if (strpos($key, 'promoBanner') !== false) {
$id = str_replace('promoBanner', '', $key);
$promo = Mage::getModel('promobanners/promobanners')->load($id);
if ($id && $promo->getId()) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="' . $templateLayout . '_' . $blockName . '_' . $key . '">';
$html .= $this->getEditChildInCms($templateLayout, $blockName, $key, 'core', $pageId);
} else {
$html .= '<div class="block block-banner">';
}
$html .= $this->getLayout()
->createBlock('promobanners/promobanners')
->setBannerId($id)
->setTemplate('mgs/promobanners/banner.phtml')
->toHtml();
$html .= '</div>';
echo $html;
}
break;
}
}
}
}

public function renderHtmlContentInCustomer($templateLayout, $blockName, $key, $value, $isAdmin) {
$blocks = array(
'categoryNavigation' => array(
'block' => 'mpanel/navigation',
'template' => 'mgs/mpanel/template/category-navigation.phtml'
),
'cartSidebar' => array(
'block' => 'checkout/cart_sidebar',
'template' => 'checkout/cart/sidebar.phtml'
),
'compareSidebar' => array(
'block' => 'catalog/product_compare_sidebar',
'template' => 'catalog/product/compare/sidebar.phtml'
),
'reorderSidebar' => array(
'block' => 'sales/reorder_sidebar',
'template' => 'sales/reorder/sidebar.phtml'
),
'poll' => array(
'block' => 'poll/activePoll',
'poll_template' => array(
'poll' => 'poll/active.phtml',
'results' => 'poll/result.phtml'
)
),
'productViewed' => array(
'block' => 'reports/product_viewed',
'template' => 'reports/product_viewed.phtml'
),
'wishlistSidebar' => array(
'block' => 'wishlist/customer_sidebar',
'template' => 'wishlist/sidebar.phtml'
),
'tagsPopular' => array(
'block' => 'tag/popular',
'template' => 'tag/popular.phtml'
),
'newsletter' => array(
'block' => 'newsletter/subscribe',
'template' => 'newsletter/subscribe.phtml'
)
);
foreach ($blocks as $block => $data) {
if ($block == $key) {
if ($key == 'poll') { // Block poll
$arr = explode('-', $value);
if (isset($arr[1])) {
$html = '';
if ($isAdmin) {
$html .= '<div class="sort-item builder-container child-builder" id="

opencart出现Notice:undefined index:route 错误的解决方法

neasel 发表了文章 • 0 个评论 • 17 次浏览 • 2018-08-27 09:49 • 来自相关话题

2018-8-27 09:48| 发布者: lutish| 查看: 2| 评论: 0|编辑 |删除报错内容:notice:Undefined index:route in ***/catalog/controller/extension/captcha/bas ...查看全部
2018-8-27 09:48| 发布者: lutish| 查看: 2| 评论: 0|编辑 |删除报错内容:
notice:Undefined index:route in ***/catalog/controller/extension/captcha/basic.php on line 12

打开此文件看到12行的内容为:


$data['route'] = $this->request->get['route'];


修改为
$data['route'] = isset($this->request->get['route']) ? $this->request->get['route'] : '';

opencart pander主题开启SSL后TWITTER链接不显示出错。

neasel 发表了文章 • 0 个评论 • 16 次浏览 • 2018-07-23 08:25 • 来自相关话题

/catalog/view/theme/default/template/extension/module/octwitter.twig 替换此文件或是手动移除其中的全部 {{ base_url }}    


/catalog/view/theme/default/template/extension/module/octwitter.twig


替换此文件或是手动移除其中的全部 {{ base_url }}
 
 

简单火车头采集规则一条

neasel 发表了文章 • 0 个评论 • 21 次浏览 • 2018-07-21 07:40 • 来自相关话题

采集对象:demo.opencart.com
采集对象:demo.opencart.com

magestore Affiliate Plus扩展部分版本无Enable Substore feature后台设置项的解决方法

neasel 发表了文章 • 0 个评论 • 21 次浏览 • 2017-08-25 10:40 • 来自相关话题

此功能是4.3以后的就自带的,但是部分版本存在没有设置项的问题,请 修改 app/code/local/Magestore/Affiliateplus/etc/ 位置的system.xml文件 <gener ...查看全部

111.jpg

此功能是4.3以后的就自带的,但是部分版本存在没有设置项的问题,请
修改
app/code/local/Magestore/Affiliateplus/etc/
位置的system.xml文件
<general>
 <substore_config translate="label comment">
                            <label>Enable Substore feature</label>
                            <frontend_type>select</frontend_type>
                            <sort_order>80</sort_order>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                            <comment>Each affiliate users will have a their own substore on your Magento shop to refer more customers.</comment>
                        </substore_config>
</general>
 

完整system.xml代码为[code]<?xml version="1.0"?>
<config>
<tabs>
<magestore translate="label">
<label>Magestore Extension</label>
<sort_order>400</sort_order>
</magestore>
</tabs>

<sections>
<affiliateplus translate="label" module="affiliateplus">
<class>separator-top</class>
<label>Affiliate Plus</label>
<tab>magestore</tab>
<frontend_type>text</frontend_type>
<sort_order>300</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<!--Changed By Adam 11/09/2014: Add User Guide to configuration page-->
<document_help translate="label">
<label>Document and Help</label>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<!-- <affiliateplus_document_and_help translate="label">
<label>To find all userguides and useful documents of Affiliate Plus extension, please visit our Resources page.</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_resourcepage</frontend_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</affiliateplus_document_and_help>-->
<affiliateplus_installation_guide_separator translate="label">
<label>Affiliate Plus Installation</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>5</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</affiliateplus_installation_guide_separator>
<affiliateplus_installation_guide translate="label">
<label>Affiliate Plus Installation Guide</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_affiliateplusinstallation</frontend_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</affiliateplus_installation_guide>
<affiliateplus_plugin_installation_guide translate="label">
<label>Affiliate Plus Plugin Installation Guide</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_affiliateplusplugininstallation</frontend_model>
<sort_order>15</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</affiliateplus_plugin_installation_guide>
<affiliateplus_user_guide_separator translate="label">
<label>Affiliate Plus User Guide</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</affiliateplus_user_guide_separator>
<affiliateplus_standard_user_guide translate="label">
<label>Affiliate Plus Standard User Guide</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_standard</frontend_model>
<sort_order>45</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</affiliateplus_standard_user_guide>
</fields>
</document_help>
<general translate="label">
<label>General Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<!--Changed By Adam 28/07/2014-->
<enable translate="label">
<label>Enable Affiliate Plus Module</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</enable>
<show_affiliate_link_on_frontend translate="label">
<label>Show Affiliate link in frontend</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</show_affiliate_link_on_frontend>

<welcome_page translate="label comment">
<label>Welcome page using CMS</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_cms_page</source_model>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Select Welcome page of your Affiliate system</comment>
</welcome_page>

<material_enable translate="label">
<label>Show Material page</label>
<frontend_type>select</frontend_type>
<sort_order>30</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</material_enable>
<material_page translate="label comment">
<label>Material page using CMS</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_cms_page</source_model>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<depends>
<material_enable>1</material_enable>
</depends>
<comment>Create CMS page and manage there</comment>
</material_page>
<substore_config translate="label comment">
<label>Enable Substore feature</label>
<frontend_type>select</frontend_type>
<sort_order>80</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Each affiliate users will have a their own substore on your Magento shop to refer more customers.</comment>
</substore_config>
<expired_time translate="label comment">
<label>Cookie Expiration (Days)</label>
<frontend_type>text</frontend_type>
<sort_order>70</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>The number of days for admin to store cookies of this program. Affiliates and invited customers can receive commission and discount for purchases made through affiliate link within this time.</comment>
</expired_time>
</fields>
</general>
<account>
<label>Account Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>3</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<sign_up_separator translate="label">
<label>Affiliate Sign-up</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</sign_up_separator>
<!--
hainh update add terms and conditions field, auto create aff config
21-07-2014
-->
<terms_and_conditions translate="label">
<label>Terms and Conditions</label>
<frontend_type>textarea</frontend_type>
<sort_order>8</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Leave blank for not showing Terms and Conditions</comment>
</terms_and_conditions>
<auto_create_affiliate translate="label">
<label>Auto create Affiliate account when Customer registers</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>0</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</auto_create_affiliate>
<!-- hainh end editing -->
<register_description translate="label">
<label>Sign-up description</label>
<frontend_type>textarea</frontend_type>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</register_description>
<required_address translate="label">
<label>Require address to sign up</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>12</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</required_address>
<required_paypal translate="label">
<label>Require PayPal email address to sign up</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>13</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</required_paypal>
<need_approved translate="label">
<label>Need admin's approval</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>14</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</need_approved>
<notification_after_signing_up translate="label">
<label>Notification after signing up</label>
<frontend_type>textarea</frontend_type>
<sort_order>15</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</notification_after_signing_up>

<balance_separator translate="label">
<label>Account Balance</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</balance_separator>
<balance translate="label">
<label>Account Balance Scope</label>
<frontend_type>select</frontend_type>
<sort_order>30</sort_order>
<source_model>affiliateplus/system_config_source_scope</source_model>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment>Select website(s) on which affiliates can use commissions to purchase items.</comment>
</balance>
</fields>
</account>

<commission>
<label>Commission Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>4</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<calculate_separator translate="label">
<label>Pay per Sales/ Profit Commission</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</calculate_separator>
<affiliate_type translate="label">
<label>Pay commission</label>
<frontend_type>select</frontend_type>
<source_model>affiliateplus/system_config_source_type</source_model>
<sort_order>15</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</affiliate_type>
<commission_type translate="label">
<label>Commission Type</label>
<frontend_type>select</frontend_type>
<source_model>affiliateplus/system_config_source_fixedpercentage</source_model>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</commission_type>
<commission translate="label">
<label>Commission Value</label>
<frontend_type>text</frontend_type>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</commission>

<use_secondary translate="label comment">
<label>Use different commission from 2nd order of a Customer</label>
<frontend_type>select</frontend_type>
<sort_order>35</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Select "No" to apply the above commission to all orders</comment>
</use_secondary>
<secondary_type translate="label">
<label>Commission Type (from 2nd order)</label>
<frontend_type>select</frontend_type>
<source_model>affiliateplus/system_config_source_fixedpercentage</source_model>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<depends>
<use_secondary>1</use_secondary>
</depends>
<comment></comment>
</secondary_type>
<secondary_commission translate="label">
<label>Commission Value (from 2nd order)</label>
<frontend_type>text</frontend_type>
<sort_order>45</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<depends>
<use_secondary>1</use_secondary>
</depends>
<comment></comment>
</secondary_commission>

<process_separator translate="label">
<label>Process Commission</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>420</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>10px</comment>
</process_separator>

<!--Added By Adam (29/08/2016): allow affiliate to get commission from his purchase-->
<allow_affiliate_get_commission_from_his_purchase translate="label comment">
<label>Allow affiliate to get commission from his purchase</label>
<frontend_type>select</frontend_type>
<sort_order>425</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</allow_affiliate_get_commission_from_his_purchase>
<!--End code-->

<updatebalance_orderstatus translate="label">
<label>Add commission to affiliate account balance when order status is</label>
<frontend_type>select</frontend_type>
<sort_order>430</sort_order>
<source_model>affiliateplus/system_config_source_orderstatus</source_model> <!--Changed By Adam 22/08/2014-->
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>
If you select order's status as "processing", the commission just be calculate for the items that have been invoiced.
</comment>
</updatebalance_orderstatus>
<holding_period translate="label comment">
<label>Holding period</label>
<frontend_type>text</frontend_type>
<sort_order>435</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>(days). If empty or zero, affiliates' commission will not be hold back.</comment>
</holding_period>
<decrease_commission_creditmemo translate="label">
<label>Subtract commission from affiliate account balance when credit memo is created</label>
<frontend_type>select</frontend_type>
<sort_order>440</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</decrease_commission_creditmemo>
<cancel_transaction_orderstatus translate="label">
<label>Subtract commission from account balance when order status is</label>
<frontend_type>multiselect</frontend_type>
<sort_order>450</sort_order>
<source_model>adminhtml/system_config_source_order_status</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</cancel_transaction_orderstatus>

<lifetime_separator translate="label">
<label>Lifetime Sales Commission</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>400</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</lifetime_separator>
<life_time_sales translate="label comment">
<label>Lifetime Sales Commission</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>410</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>0</show_in_website>
<show_in_store>0</show_in_store>
<comment><![CDATA[Customer first buys through affiliate A's link, though later clicks affiliate B's link and buys, this transaction will still be counted for affiliate A.]]></comment>
</life_time_sales>
</fields>
</commission>

<discount>
<label>Discount Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>5</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<allow_discount translate="label">
<label>When there's shopping cart discount, apply</label>
<frontend_type>select</frontend_type>
<source_model>affiliateplus/system_config_source_discount</source_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</allow_discount>

<discount_type translate="label">
<label>Discount Type</label>
<frontend_type>select</frontend_type>
<source_model>affiliateplus/system_config_source_discounttype</source_model>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</discount_type>

<discount translate="label">
<label>Discount Value</label>
<frontend_type>text</frontend_type>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</discount>

<use_secondary translate="label comment">
<label>Use different discount from 2nd order of a Customer</label>
<frontend_type>select</frontend_type>
<sort_order>35</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Select "No" to apply above discount for all orders</comment>
</use_secondary>
<secondary_type translate="label">
<label>Discount Type (from 2nd order)</label>
<frontend_type>select</frontend_type>
<source_model>affiliateplus/system_config_source_discounttype</source_model>
<sort_order>37</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<depends>
<use_secondary>1</use_secondary>
</depends>
<comment></comment>
</secondary_type>
<secondary_discount translate="label">
<label>Discount Value (from 2nd order)</label>
<frontend_type>text</frontend_type>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<depends>
<use_secondary>1</use_secondary>
</depends>
<comment></comment>
</secondary_discount>

<type_discount translate="label">
<label>Discount displayed</label>
<frontend_type>select</frontend_type>
<source_model>affiliateplus/system_config_source_cartproduct</source_model>
<sort_order>50</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</type_discount>
</fields>
</discount>

<payment translate="label">
<label>Withdrawal Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<!--edit by blanka-->
<default_method translate="label">
<label>Default payment method</label>
<frontend_type>select</frontend_type>
<sort_order>112</sort_order>
<source_model>affiliateplus/system_config_source_payments</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment><![CDATA[Select default payment method when affiliates request payment]]></comment>
</default_method>
<!--end edit by blanka-->
<store_credit translate="label">
<label>Use commission as store credit</label>
<frontend_type>select</frontend_type>
<sort_order>112</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment><![CDATA[Allow affiliates to use commission to check out at your store]]></comment>
</store_credit>
<withdrawals translate="label">
<label>Allow withdrawal request</label>
<frontend_type>select</frontend_type>
<sort_order>117</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</withdrawals>

<payment_release translate="label">
<label>The minimum balance in affiliate account to request withdrawal</label>
<frontend_type>text</frontend_type>
<sort_order>120</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</payment_release>

<tax_class translate="label comment">
<label>Tax class for withdrawal</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_shipping_taxclass</source_model>
<sort_order>125</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</tax_class>

<!-- <tax_calc translate="label">
<label>Tax Calculation</label>
<frontend_type>select</frontend_type>
<sort_order>130</sort_order>
<source_model>affiliateplus/system_config_source_feetax</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>
<comment></comment>
</tax_calc> -->

<!-- <payment_method>
<label>Paypal Withdrawal method</label>
<frontend_type>select</frontend_type>
<source_model>affiliateplus/system_config_source_paymentmethod</source_model>
<sort_order>130</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</payment_method>-->

<who_pay_fees translate="label">
<label>Who pays transaction fee</label>
<frontend_type>select</frontend_type>
<source_model>affiliateplus/system_config_source_whopayfees</source_model>
<sort_order>140</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</who_pay_fees>

<cancel_days translate="label">
<label>Allow affiliates to cancel withdrawal request within</label>
<frontend_type>text</frontend_type>
<sort_order>150</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>days. 0 or empty is unlimited.</comment>
</cancel_days>

<reduce_balance translate="label">
<label>Subtract affiliate account balance immediately when a withdrawal request is created</label>
<frontend_type>select</frontend_type>
<sort_order>135</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</reduce_balance>

</fields>
</payment>

<email translate="label">
<label>Email Configuration</label>
<frontend_type>text</frontend_type>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<sender_contact_separator translate="label">
<label>System Email Sender</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</sender_contact_separator>
<name_sender translate="label">
<label>Sender Name</label>
<frontend_type>text</frontend_type>
<sort_order>2</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</name_sender>
<email_sender translate="label">
<label>Sender Email</label>
<frontend_type>text</frontend_type>
<validate>validate-email</validate>
<sort_order>3</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment><![CDATA[Used to send emails from system to affiliates. If blank, affiliate system will use general store email address.]]></comment>
</email_sender>
<sign_up_separator translate="label">
<label>Affiliate Sign-up Email</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>10</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment></comment>
</sign_up_separator>
<is_sent_email_new_account translate="label">
<label>Send email to new affiliate</label>
<frontend_type>select</frontend_type>
<sort_order>20</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</is_sent_email_new_account>
<new_account_email_template translate="label">
<label>Email template sent to newly registered affiliates</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</new_account_email_template>
<approved_account_email_template translate="label">
<label>Email template sent to newly approved affiliates</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</approved_account_email_template>
<is_sent_to_sales_new_account>
<label>Send email to admin when a new affiliate registers</label>
<frontend_type>select</frontend_type>
<sort_order>50</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</is_sent_to_sales_new_account>
<new_account_sales_email_template>
<label>Email template sent to admin when a new affiliate registers</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>60</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</new_account_sales_email_template>

<transactions_separator translate="label">
<label>Transaction Process Email</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>70</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>10px</comment>
</transactions_separator>
<is_sent_email_account_new_transaction translate="label">
<label>Send email to affiliate when a transaction is created</label>
<frontend_type>select</frontend_type>
<sort_order>80</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</is_sent_email_account_new_transaction>
<new_transaction_account_email_template translate="label">
<label>Email template sent to affiliate when a transaction is created</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>90</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</new_transaction_account_email_template>
<is_sent_email_sales_new_transaction translate="label">
<label>Send email to admin when a transaction is created</label>
<frontend_type>select</frontend_type>
<sort_order>100</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</is_sent_email_sales_new_transaction>
<new_transaction_sales_email_template translate="label">
<label>Email template sent to admin when a transaction is created</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>110</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</new_transaction_sales_email_template>
<is_sent_email_account_updated_transaction translate="label">
<label>Send email to affiliates when transaction status is changed</label>
<frontend_type>select</frontend_type>
<sort_order>120</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Used when transaction is canceled, completed or reduced commission</comment>
</is_sent_email_account_updated_transaction>
<updated_transaction_account_email_template translate="label">
<label>Email template sent to affiliates when transaction status is changed</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>130</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Applied when transaction is canceled or completed</comment>
</updated_transaction_account_email_template>
<reduce_commission_account_email_template translate="label">
<label>Email template sent to affiliates when commission of a transaction is reduced</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_email_template</source_model>
<sort_order>140</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</reduce_commission_account_email_template>
<!--add by viet email sent to affilate when transaction refund-->
<!-- <is_sent_email_refund translate="label">
<label>Send email to affiliate when a transaction refund</label>
<frontend_type>select</frontend_type>
<sort_order>146</sort_order>
<source_model>adminhtml/system_config_source_yesno</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</is_sent_email_refund>
<sent_mail_refund_email_template>
<label>Sent email to affiliate when a transaction refund</label>
<frontend_type>select</frontend_type>
<sort_order>148</sort_order>
<source_model>adminhtml/system_config_source_email_template</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</sent_mail_refund_email_template>-->
<!--end by viet-->
<payment_separator translate="label">
<label>Withdrawal Email</label>
<frontend_type>label</frontend_type>
<frontend_model>affiliateplus/adminhtml_field_separator</frontend_model>
<sort_order>150</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>10px</comment>
</payment_separator>
<is_sent_email_sales_request_payment translate="label">
<label>Send email to admin when an affiliate requests withdrawal</label>

Magento Intenso低版本评论提交后无反回

neasel 发表了文章 • 0 个评论 • 17 次浏览 • 2017-04-27 13:08 • 来自相关话题

只显示 sucuess msg ,消息 ,Thanks for your review! Your review has been accepted for moderation. 那么您需要app/code/local/Itactica/Exte ...查看全部
只显示 sucuess msg ,消息 ,Thanks for your review! Your review has been accepted for moderation.
那么您需要
app/code/local/Itactica/ExtendedReviews/controllers/ProductController.php
此文件修改大约
 public function postAction() {
$success = false;
if ($data = Mage::getSingleton('review/session')->getFormData(true)) {
$rating = array();
if (isset($data['ratings']) && is_array($data['ratings'])) {
$rating = $data['ratings'];
}
} else {
$data = $this->getRequest()->getPost();
$rating = $this->getRequest()->getParam('ratings', array());
}

if (($product = $this->_initProduct()) && !empty($data)) {
$session = Mage::getSingleton('core/session');
$review = Mage::getModel('review/review')->setData($data);

$validate = $review->validate();
if ($validate === true) {
try {
$review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))
->setEntityPkValue($product->getId())
->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)
->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
->setStoreId(Mage::app()->getStore()->getId())
->setStores(array(Mage::app()->getStore()->getId()))
->save();

foreach ($rating as $ratingId => $optionId) {
Mage::getModel('rating/rating')
->setRatingId($ratingId)
->setReviewId($review->getId())
->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
->addOptionVote($optionId, $product->getId());
}

$review->aggregate();
Mage::getResourceModel('itactica_extendedreviews/review')->syncReviews($review->getId());
$session->addSuccess($this->__('Thanks for your review! Your review has been accepted for moderation.'));
$success = true;

} catch (Exception $e) {
$session->setFormData($data);
$session->addError($this->__('Unable to post the review.'));
}
} else {
$session->setFormData($data);
if (is_array($validate)) {
foreach ($validate as $errorMessage) {
$session->addError($errorMessage);
}
} else {
$session->addError($this->__('Unable to post the review.'));
}
}
}
// echo json_encode(array('success' => $success, 'msg' => $this->getLayout()->getMessagesBlock()->getGroupedHtml()));


if ($redirectUrl = Mage::getSingleton('review/session')->getRedirectUrl(true)) {
$this->_redirectUrl($redirectUrl);
return;
}
$this->_redirectReferer();
}

Opencart2.x 简约响应式多合1主题Domino(含有2.2快速部署包) 2.3安装后台首页无内容

neasel 发表了文章 • 0 个评论 • 24 次浏览 • 2017-03-29 16:09 • 来自相关话题

ALTER TABLE `oc_user_group` CHANGE `permission` `permission` MEDIUMTEXT NOT NULL; INSERT INTO `oc_extension` (`type`, ...查看全部
ALTER TABLE `oc_user_group` CHANGE `permission` `permission` MEDIUMTEXT NOT NULL;

INSERT INTO `oc_extension` (`type`, `code`) VALUES
('dashboard', 'activity'),
('dashboard', 'sale'),
('dashboard', 'recent'),
('dashboard', 'order'),
('dashboard', 'online'),
('dashboard', 'map'),
('dashboard', 'customer'),
('dashboard', 'chart');

INSERT INTO `oc_setting` (`store_id`, `code`, `key`, `value`, `serialized`) VALUES
(0, 'dashboard_activity', 'dashboard_activity_status', '1', 0),
(0, 'dashboard_activity', 'dashboard_activity_sort_order', '7', 0),
(0, 'dashboard_sale', 'dashboard_sale_status', '1', 0),
(0, 'dashboard_sale', 'dashboard_sale_width', '3', 0),
(0, 'dashboard_chart', 'dashboard_chart_status', '1', 0),
(0, 'dashboard_chart', 'dashboard_chart_width', '6', 0),
(0, 'dashboard_customer', 'dashboard_customer_status', '1', 0),
(0, 'dashboard_customer', 'dashboard_customer_width', '3', 0),
(0, 'dashboard_map', 'dashboard_map_status', '1', 0),
(0, 'dashboard_map', 'dashboard_map_width', '6', 0),
(0, 'dashboard_online', 'dashboard_online_status', '1', 0),
(0, 'dashboard_online', 'dashboard_online_width', '3', 0),
(0, 'dashboard_order', 'dashboard_order_sort_order', '1', 0),
(0, 'dashboard_order', 'dashboard_order_status', '1', 0),
(0, 'dashboard_order', 'dashboard_order_width', '3', 0),
(0, 'dashboard_sale', 'dashboard_sale_sort_order', '2', 0),
(0, 'dashboard_customer', 'dashboard_customer_sort_order', '3', 0),
(0, 'dashboard_online', 'dashboard_online_sort_order', '4', 0),
(0, 'dashboard_map', 'dashboard_map_sort_order', '5', 0),
(0, 'dashboard_chart', 'dashboard_chart_sort_order', '6', 0),
(0, 'dashboard_recent', 'dashboard_recent_status', '1', 0),
(0, 'dashboard_recent', 'dashboard_recent_sort_order', '8', 0),
(0, 'dashboard_activity', 'dashboard_activity_width', '4', 0),
(0, 'dashboard_recent', 'dashboard_recent_width', '8', 0);

magento import export product reviews在后台无自动创建数据流

neasel 发表了文章 • 1 个评论 • 20 次浏览 • 2017-03-23 11:26 • 来自相关话题

如果您上传此插件之后,没有在后台中的sysytem--import/export--Dataflow-Advanced Profile中看到相关的自动添加的数据流数据的话 ,则需要您手动添加 点击 add New Profile ...查看全部
如果您上传此插件之后,没有在后台中的sysytem--import/export--Dataflow-Advanced Profile中看到相关的自动添加的数据流数据的话
,则需要您手动添加
点击 add New Profile
添加一条IMport 标题
下方内容写为:
<action type="dataflow/convert_adapter_io" method="load"><var name="type">file</var><var name="path">var/import</var><var name="filename"><![CDATA[import_review.csv]]></var><var name="format"><![CDATA[csv]]></var></action><action type="dataflow/convert_parser_csv" method="parse"><var name="delimiter"><![CDATA[,]]></var><var name="enclose"><![CDATA["]]></var><var name="fieldnames">true</var><var name="store"><![CDATA[0]]></var><var name="adapter">Softprodigy_Productreview_Model_Convert_Adapter_Importreview</var><var name="method">parse</var></action>
添加一条export标题,下方内容为
<action type="Softprodigy_Productreview_Model_Convert_Parser_Exportreview" method="unparse"><var name="store"><![CDATA[0]]></var></action><action type="dataflow/convert_mapper_column" method="map"></action><action type="dataflow/convert_parser_csv" method="unparse"><var name="delimiter"><![CDATA[,]]></var><var name="enclose"><![CDATA["]]></var><var name="fieldnames">true</var></action><action type="dataflow/convert_adapter_io" method="save"><var name="type">file</var><var name="path">var/export</var><var name="filename"><![CDATA[export_review.csv]]></var></action>
分别保存之后就可以正常使用导入导出评论的功能了

Magento1.X版本支持非常优秀的手机模板Magento Mobile Theme 2.0于MAGENTO1.7中已知问题

neasel 发表了文章 • 0 个评论 • 40 次浏览 • 2016-08-27 19:18 • 来自相关话题

修改app/design/frontend/default/nb_mobile/template/catalog/product/view.phtml 第45行<?php echo $this->getSubmitUrl($_product, ar ...查看全部
修改app/design/frontend/default/nb_mobile/template/catalog/product/view.phtml 第45行
<?php echo $this->getSubmitUrl($_product, array('_secure' => $this->_isSecure())) ?>

<?php echo $this->getSubmitUrl($_product) ?>
修改app/design/frontend/default/nb_mobile/template/catalog/product/view/type/default.phtml 第30行
<?php if ($this->displayProductStockStatus()): ?>
<?php if ($_product->isAvailable()): ?>