//{block name="backend/article/view/detail/window" append}
//{namespace name="backend/subshop_article/main"}
Ext.define('Shopware.apps.Article.view.detail.subshop_article.Subshop_aid_window', {
override:'Shopware.apps.Article.view.detail.Window',
/**
* Creates the main tab panel which displays the different tabs for the article sections.
* To extend the tab panel this function can be override.
*
* @return Ext.tab.Panel
*/
createMainTabPanel: function() {
var me = this;
var formTab = me.callParent(arguments);
//Der Container für das Tab => Der Tab selber
me.SubshopArticleTab = Ext.create('Ext.container.Container', {
title: 'Subshop Article Number',
disabled: true,
name: 'subshop-article-tab',
layout: 'border'
});
me.mainTab.insert(me.SubshopArticleTab);
me.on('saveArticle', function(me,article) {
});
return formTab;
},
createSubshopContent: function(a,b) {
var me = this;
//console.log(a.getAttribute());
me.subshopContents = Ext.create(
'Ext.container.Container', {
anchor: '100%',
focusable: false,
margin: 20,
items:me.createFormContent()
}
);
return me.subshopContents;
},
createFormContent:function () {
var me = this;
me.customOrderNumberField = Ext.create('Ext.form.field.Text', {
name:'attribute[sanSubshopArticleNumber]',
fieldLabel:'Subshop Article Numbers',
anchor:'95%',
labelWidth:100,
minWidth:250
});
return [
me.customOrderNumberField,
];
},
onStoresLoaded: function(article, stores) {
var me = this;
me.article = article;
me.callParent(arguments);
me.SubshopArticleTab.add( me.createSubshopContent(article, stores));
me.SubshopArticleTab.setDisabled(false);
}
});
//{/block}
Hello Everyone,
I am working on a plugin where i have extended article module and added new tab.In this tab i have added two text field and want to sync them in extra field but each time i enter value in click on save button nothing happens and in database it shows blank value.
I have created this attribute in s_articles_attribute in bootsrap by :
$this->Application()->Models()->addAttribute(
's_articles_attributes',
'san',
'subshop_article_number',
'varchar(255)',
true,
null);
Shopware()->Models()->generateAttributeModels(array(
's_articles_attributes'
));
and added attribute.js
//{block name="backend/article/model/attribute/fields" append}
{ name:'sanSubshopArticleNumber', type:'string' },
//{/block}
as well used query builder but i guess its not loading value properly
/**
* Hooks the getListQueryBuilder method of the customer repository.
* Additionally selects our own attributes
*
* @param Enlight_Hook_HookArgs $arguments
*/
public function afterGetListQueryBuilder(Enlight_Hook_HookArgs $arguments)
{
// get original builder
$builder = $arguments->getReturn();
// add selection and join to original builder
$builder->addSelect(array(
'attributes.sanSubshopArticleNumber',
));
$builder->leftJoin('article.attribute', 'attributes');
$arguments->setReturn($builder);
}
$this->subscribeEvent(
'Shopware\Models\Article\Repository::getAttributesQueryBuilder::after',
'afterGetListQueryBuilder'
);
Its not working on both casing if add value directly in database this value can be seen from attribute object in json in console but does’t load in form tab even if enter text in this field and click on save button new value doens’t save in database