Pridanie noveho atributu do kategorie

!!! vzdy si treba spravit zalohu DB !!!

INSERT INTO `eav_attribute` (`entity_type_id`, `attribute_code`, `attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, `frontend_input`, `frontend_label`, `frontend_class`, `source_model`, `is_required`, `is_user_defined`, `default_value`, `is_unique`, `note`) VALUES
(3, ‘header_description’, NULL, NULL, ‘varchar’, NULL, NULL, ‘text’, ‘Header Description’, NULL, ‘eav/entity_attribute_source_boolean’, 0, 0, ‘0’, 0, ”);

 po vytvoreni noveho attributu v tabulke eav_attribute .. si treba pozriet jeho ID .. napriklad teraz to je 123 .. a toto cislo sa pouzije v dalsich tabulkach dole

INSERT INTO `eav_entity_attribute` (`entity_type_id`, `attribute_set_id`, `attribute_group_id`, `attribute_id`, `sort_order`) VALUES
(3, 3, 3, 123, 11);

is_global = 1 – global ak =0 -store view

INSERT INTO `catalog_eav_attribute` (`attribute_id`, `frontend_input_renderer`, `is_global`, `is_visible`, `is_searchable`, `is_filterable`, `is_comparable`, `is_visible_on_front`, `is_html_allowed_on_front`, `is_used_for_price_rules`, `is_filterable_in_search`, `used_in_product_listing`, `used_for_sort_by`, `is_configurable`, `apply_to`, `is_visible_in_advanced_search`, `position`, `is_wysiwyg_enabled`) VALUES
(123, NULL, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, ”, 0, 0, 0);

——————- Obrazok ——————-
INSERT INTO `eav_attribute` (`entity_type_id`, `attribute_code`, `attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, `frontend_input`, `frontend_label`, `frontend_class`, `source_model`, `is_required`, `is_user_defined`, `default_value`, `is_unique`, `note`) VALUES
(3, ‘header_back’, NULL,’catalog/category_attribute_backend_image’, ‘varchar’, NULL, NULL, ‘image’, ‘Header background’, NULL, ‘eav/entity_attribute_source_boolean’, 0, 0, ‘0’, 0, ”);

INSERT INTO `eav_entity_attribute` (`entity_type_id`, `attribute_set_id`, `attribute_group_id`, `attribute_id`, `sort_order`) VALUES
(3, 3, 4, 132, 11); .

INSERT INTO `catalog_eav_attribute` (`attribute_id`, `frontend_input_renderer`, `is_global`, `is_visible`, `is_searchable`, `is_filterable`, `is_comparable`, `is_visible_on_front`, `is_html_allowed_on_front`, `is_used_for_price_rules`, `is_filterable_in_search`, `used_in_product_listing`, `used_for_sort_by`, `is_configurable`, `apply_to`, `is_visible_in_advanced_search`, `position`, `is_wysiwyg_enabled`) VALUES
(132, NULL, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, NULL, 0, 0, 0);

<?php
$catId = Mage::getModel(‘catalog/layer’)->getCurrentCategory()->getId();
$_category = Mage::getModel(‘catalog/category’)->load($catId)->getData(‘header_back’);
$iamgeurl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).’catalog/category/’.$_category;
?>
<img src=”<?php echo $iamgeurl; ?>”>