{"id":280734,"date":"2016-11-10T13:00:05","date_gmt":"2016-11-10T10:00:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=280734"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=280734","title":{"rendered":"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f Magento 1.x \u2014 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0433\u0430\u0439\u0434"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/214\/54f\/16b\/21454f16b8cd4adb938c1e34c2103838.jpg\"\/><br \/>  <b>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/b><br \/>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0434\u0430\u0432\u043d\u043e \u0443\u0436\u0435 \u0432\u044b\u043f\u0443\u0449\u0435\u043d\u0443\u044e Magento 2, Magento \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0435\u0449\u0435 \u0436\u0438\u0432\u0435\u0435 \u0432\u0441\u0435\u0445 \u0436\u0438\u0432\u044b\u0445 \u0438 \u043f\u043e\u043a\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0441 \u043f\u043e\u043a\u0438\u0434\u0430\u0442\u044c. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 Magento \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 3 \u0433\u043e\u0434\u0430 \u0441 \u0434\u0430\u0442\u044b \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 2, \u0442.\u0435. \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0434\u043e \u043d\u043e\u044f\u0431\u0440\u044f 2018. \u0420\u044b\u043d\u043e\u043a \u043f\u0435\u0441\u0442\u0440\u0438\u0442 \u0448\u0438\u0440\u043e\u0447\u0430\u0439\u0448\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0442\u0435\u043c, \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u044b\u0445 \u043f\u043e\u0434 Magento 1.x \u0432\u0435\u0440\u0441\u0438\u0438. \u0418 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0430\u0439\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 Magento 1.x, \u043d\u0435 \u0442\u043e\u0440\u043e\u043f\u044f\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f. \u0420\u0430\u0431\u043e\u0442\u044b \u043c\u043d\u043e\u0433\u043e \u2014 \u0432\u044b\u0445\u043b\u043e\u043f\u0430 \u043c\u0430\u043b\u043e. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0434 Magento \u043f\u0435\u0440\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0435\u0449\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430 \u0438 \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442.<\/p>\n<p>  \u041d\u043e \u043d\u0435 \u043e \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0430\u0445 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f e-commerce \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0422\u0443\u0442 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 \u0433\u0430\u0439\u0434 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f Magento 1.x (\u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e Magento). \u041d\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0433\u0430\u0439\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0434\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c, \u0430 \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u00ab\u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a, \u0430 \u043d\u0435 \u0438\u043d\u0430\u0447\u0435\u00bb. \u042f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0437\u043e\u043b\u043e\u0442\u0443\u044e \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443 \u043c\u0435\u0436\u0434\u0443 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u044c\u044e \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e. \u0418 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0433\u0430\u0439\u0434 \u043d\u0435\u0441\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u0443 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u0432 \u0434\u0435\u043b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f Magento. \u041d\u043e \u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u043f\u043e\u043b\u044c\u0437\u0443.<br \/>  <a name=\"habracut\"><\/a><br \/>   \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u044f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u0432\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0437\u044f\u0442\u044c \u0432\u0441\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0438 \u043d\u0435 \u0431\u0435\u0433\u0430\u0442\u044c \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u0433\u0430\u0439\u0434\u0443. \u0410 \u0435\u0441\u043b\u0438 \u0443\u0436\u0435 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0443\u0447\u0430\u0441\u0442\u043a\u0438 \u0438\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u0443 \u0432\u0430\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b, \u0442\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u0422\u0430\u043a\u043e\u0435 \u0436\u0435 \u0438 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u043a \u0432\u0438\u0434\u0435\u043e. \u0422\u043e\u043b\u044c\u043a\u043e \u0432\u0438\u0434\u0435\u043e \u0443\u0440\u043e\u043a\u043e\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u043e \u0438 \u0431\u0435\u0437 \u0432\u0438\u0434\u0435\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0442\u0441\u0432\u0438\u0439 \u0438 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0438 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0435\u0441\u0442\u044c. \u0425\u043e\u0442\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u0449\u0438 \u043b\u0443\u0447\u0448\u0435 \u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u0432\u0438\u0434\u0435\u043e, \u0442.\u043a. \u0442\u0430\u043c \u043f\u043e \u043c\u0438\u043c\u043e \u043a\u043e\u0434\u0438\u043d\u0433\u0430 \u0435\u0449\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438. \u0414\u0430 \u0438 \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0433, \u0447\u0442\u043e-\u0442\u043e \u0443\u043f\u0443\u0441\u0442\u0438\u0442\u044c. \u0422\u0430\u043a \u0447\u0442\u043e \u0432 \u0432\u0438\u0434\u0435\u043e \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b, \u0438 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435\u043e. \u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0438\u0437\u0431\u0435\u0436\u043d\u043e, \u0442.\u043a. \u0432\u0441\u0435 \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c \u0432 \u0440\u0430\u0437\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<ul>\n<li><a href=\"#server\">\u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Ubuntu 16.04 LTS<\/a><\/li>\n<li><a href=\"#store_setup\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430<\/a><\/li>\n<li><a href=\"#module_structure\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f<\/a><\/li>\n<li><a href=\"#xdebug\">\u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u043a\u043e\u0434\u0430 XDEBUG + PHPSTORM<\/a><\/li>\n<li><a href=\"#models\">\u041c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><\/li>\n<li><a href=\"#controllers\">\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438 \u0440\u043e\u0443\u0442\u0438\u043d\u0433<\/a><\/li>\n<li><a href=\"#helpers\">\u0425\u0435\u043b\u043f\u0435\u0440\u044b<\/a><\/li>\n<li><a href=\"#system_config\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435<\/a><\/li>\n<li><a href=\"#frontend_blocks_layouts_templates\">Frontend \u0431\u043b\u043e\u043a\u0438. \u041c\u0430\u043a\u0435\u0442\u044b. \u0422\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b<\/a><\/li>\n<li><a href=\"#admin_grid_form\">Admin \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0413\u0440\u0438\u0434. \u0424\u043e\u0440\u043c\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a><\/li>\n<li><a href=\"#observers\">\u0421\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438<\/a><\/li>\n<li><a href=\"#cron\">\u041a\u0440\u043e\u043d \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e<\/a><\/li>\n<li><a href=\"#renderers\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u043e\u0432 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435<\/a><\/li>\n<li><a href=\"#wysiwyg\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 WYSIWYG \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430<\/a><\/li>\n<li><a href=\"#promo_conditions\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Rule Conditions (\u0443\u0441\u043b\u043e\u0432\u0438\u0439)<\/a><\/li>\n<li><a href=\"#admin_tabs\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a><\/li>\n<li><a href=\"#products_grid_tab\">\u0412\u044b\u0432\u043e\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (grid) \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043d\u0430 frontend.<\/a><\/li>\n<li><a href=\"#payment_method\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u043f\u043b\u0430\u0442\u044b (Payment Method)<\/a><\/li>\n<li><a href=\"#shipping_method\">\u041c\u043e\u0434\u0443\u043b\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 (Shipping Method)<\/a><\/li>\n<\/ul>\n<h4><b>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/b><\/h4>\n<p>  \u0412\u0441\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2014 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u043c.<br \/>  <i>\u0415\u0441\u043b\u0438, \u0443 \u0432\u0430\u0441 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e \u2014 \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"#module_structure\">\u043f\u0435\u0440\u0435\u0439\u0442\u0438<\/a> \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0443.<\/i><br \/>  <a name=\"server\"><\/a>  <\/p>\n<h5><b>\u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Ubuntu 16.04 LTS<\/b><\/h5>\n<p>  \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 <a href=\"https:\/\/www.ubuntu.com\/download\/server\">Ubuntu 16.04<\/a>, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u00ab\u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0443\u00bb. \u0418 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Ubuntu \u043d\u0430 \u043d\u0430\u0448 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043d\u043e \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u0432 \u0432\u0438\u0434\u0435\u043e \u043d\u0438\u0436\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 UBUNTU 16.04 &#8212; Nginx + php7-fpm + mysql + samba<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/h4asCPT80DU?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0441\u043e\u0444\u0442.  <\/p>\n<pre><code class=\"bash\">sudo su apt-get install && apt-get upgrade <\/code><\/pre>\n<p>  \u0421\u0442\u0430\u0432\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440, \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0437\u0430\u0434\u0430\u0447  <\/p>\n<pre><code class=\"bash\">apt-get install mc nano htop <\/code><\/pre>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 IP \u0430\u0434\u0440\u0435\u0441 (\u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0440\u043e\u0443\u0442\u0435\u0440\u0430)<\/p>\n<pre><code class=\"bash\">nano \/etc\/network\/interfaces <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:  <\/p>\n<pre><code class=\"bash\">iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 gateway 192.168.0.1 dns-nameservers 192.168.0.1 8.8.8.8 auto eth0 <\/code><\/pre>\n<p>  \u0433\u0434\u0435 <i>eth0<\/i> \u2014 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0432 <i>ifconfig<\/i><br \/>  \u0412\u0435\u0431\u0441\u0435\u0440\u0432\u0435\u0440 Nginx  <\/p>\n<pre><code class=\"bash\">apt-get install nginx <\/code><\/pre>\n<p>  PHP 7.0 FPM  <\/p>\n<pre><code class=\"bash\">apt-get install php-fpm php-xdebug php-soap php-gd php-mbstring php-mcrypt php-curl php-xml <\/code><\/pre>\n<p>  MySQL 5.7 \u0438 phpMyAdmin  <\/p>\n<pre><code class=\"bash\">apt-get install mysql-server-5.7 phpmyadmin <\/code><\/pre>\n<p>  \u0421\u043c\u0435\u043d\u0438\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0438 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0444\u0430\u0439\u043b\u044b \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430.  <\/p>\n<pre><code class=\"bash\">chown -R dev:dev \/var\/www chmod -R 777 \/var\/www <\/code><\/pre>\n<p>  <i>dev:dev <\/i> \u2014 \u0438\u043c\u044f \u0438 \u0433\u0440\u0443\u043f\u043f\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u044d\u0442\u043e \u0438\u043c\u044f \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Ubuntu.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e\u0435 \u041f\u041e.<\/p>\n<h6><b>Nginx<\/b><\/h6>\n<p>  \u042f \u0441\u0434\u0435\u043b\u0430\u043b 3 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0434\u043b\u044f Nginx: \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u043e\u043c\u0435\u043d, \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f Magento 2 (\u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f), \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f phpMyAdmin<br \/>  \u041f\u0440\u0438\u0446\u043d\u0438\u043f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0434\u043e\u043c\u0435\u043d\u0430\u043c\u0438 \u043f\u0440\u043e\u0441\u0442.  <\/p>\n<ul>\n<li>\u041c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0443 \u0441\u0435\u0431\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0434\u043e\u043c\u0435\u043d \u2014 IP. \u041a\u0430\u043a \u043c\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c, \u043d\u0435 \u0432\u0430\u0436\u043d\u043e, \u044f \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e \u0432 hosts \u0444\u0430\u0439\u043b\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,<i> magento.dev 192.168.0.100 <\/i><\/li>\n<li> \u041a\u043e\u0433\u0434\u0430 Nginx \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 server_root \u043f\u0443\u0442\u044c \u0432\u0438\u0434\u0430 \/var\/www\/(\u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f). \u041f\u0440\u0438\u043c\u0435\u0440: \u043f\u0438\u0448\u0435\u043c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 <i>magento.dev \u2014 server_root \/var\/www\/magento.dev<\/i>   <\/li>\n<li>\u041d\u0443 \u0430 \u043d\u0430\u0448 \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 \/var\/www\/magento.dev<\/li>\n<\/ul>\n<div class=\"spoiler\"><b class=\"spoiler_title\">dynamic.conf<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">    server {     listen 80;     server_name $http_host;     root \/var\/www\/$http_host;      location \/ {     index index.html index.php;     try_files $uri $uri\/ @handler;     expires 30d;     }      location  \/. {     return 404;     }      location @handler {     rewrite \/ \/index.php;     }      location ~ .php\/ {     rewrite ^(.*.php)\/ $1 last;     }      location ~ .php$ {     if (!-e $request_filename) { rewrite \/ \/index.php last; }      expires        off;     fastcgi_pass unix:\/run\/php\/php7.0-fpm.sock;     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;     fastcgi_param  SCRIPT_NAME  $document_root$fastcgi_script_name;     fastcgi_param  MAGE_RUN_TYPE store;     include        fastcgi_params;     }     }      <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">m2.conf<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">    # Magento Vars      #     # Example configuration:     upstream fastcgi_backend {     server   unix:unix:\/run\/php\/php7.0-fpm.sock;     }     server {     set $MAGE_ROOT \/var\/www\/m2.dev;     set $MAGE_MODE default; # or production or developer     listen 80;     server_name m2.dev;     root \/var\/www\/m2.dev\/pub;      index index.php;     autoindex off;     charset off;      add_header 'X-Content-Type-Options' 'nosniff';     add_header 'X-XSS-Protection' '1; mode=block';      location \/setup {     root $MAGE_ROOT;     location ~ ^\/setup\/index.php {     fastcgi_pass   fastcgi_backend;     fastcgi_index  index.php;     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;     include        fastcgi_params;     }      location ~ ^\/setup\/(?!pub\/). {     deny all;     }      location ~ ^\/setup\/pub\/ {     add_header X-Frame-Options &quot;SAMEORIGIN&quot;;     }     }      location \/update {     root $MAGE_ROOT;      location ~ ^\/update\/index.php {     fastcgi_split_path_info ^(\/update\/index.php)(\/.+)$;     fastcgi_pass   fastcgi_backend;     fastcgi_index  index.php;     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;     fastcgi_param  PATH_INFO        $fastcgi_path_info;     include        fastcgi_params;     }      # deny everything but index.php     location ~ ^\/update\/(?!pub\/). {     deny all;     }      location ~ ^\/update\/pub\/ {     add_header X-Frame-Options &quot;SAMEORIGIN&quot;;     }     }      location \/ {     try_files $uri $uri\/ \/index.php?$args;     }      location \/pub {     location ~ ^\/pub\/media\/(downloadable|customer|import|theme_customization\/.*\\.xml) {     deny all;     }     alias $MAGE_ROOT\/pub;     add_header X-Frame-Options &quot;SAMEORIGIN&quot;;     }      location \/static\/ {     if ($MAGE_MODE = &quot;production&quot;) {     expires max;     }     location ~* \\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {     add_header Cache-Control &quot;public&quot;;     add_header X-Frame-Options &quot;SAMEORIGIN&quot;;     expires +1y;      if (!-f $request_filename) {     rewrite ^\/static\/(version\\d*\/)?(.*)$ \/static.php?resource=$2 last;     }     }     location ~* \\.(zip|gz|gzip|bz2|csv|xml)$ {     add_header Cache-Control &quot;no-store&quot;;     add_header X-Frame-Options &quot;SAMEORIGIN&quot;;     expires    off;      if (!-f $request_filename) {     rewrite ^\/static\/(version\\d*\/)?(.*)$ \/static.php?resource=$2 last;     }     }     if (!-f $request_filename) {     rewrite ^\/static\/(version\\d*\/)?(.*)$ \/static.php?resource=$2 last;     }     add_header X-Frame-Options &quot;SAMEORIGIN&quot;;     }      location \/media\/ {     try_files $uri $uri\/ \/get.php?$args;      location ~ ^\/media\/theme_customization\/.*\\.xml {     deny all;     }      location ~* \\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {     add_header Cache-Control &quot;public&quot;;     add_header X-Frame-Options &quot;SAMEORIGIN&quot;;     expires +1y;     try_files $uri $uri\/ \/get.php?$args;     }     location ~* \\.(zip|gz|gzip|bz2|csv|xml)$ {     add_header Cache-Control &quot;no-store&quot;;     add_header X-Frame-Options &quot;SAMEORIGIN&quot;;     expires    off;     try_files $uri $uri\/ \/get.php?$args;     }     add_header X-Frame-Options &quot;SAMEORIGIN&quot;;     }      location \/media\/customer\/ {     deny all;     }      location \/media\/downloadable\/ {     deny all;     }      location \/media\/import\/ {     deny all;     }      location ~ cron\\.php {     deny all;     }      location ~ (index|get|static|report|404|503)\\.php$ {     try_files $uri =404;     fastcgi_pass   fastcgi_backend;      fastcgi_param  PHP_FLAG  &quot;session.auto_start=off \\n suhosin.session.cryptua=off&quot;;     fastcgi_param  PHP_VALUE &quot;memory_limit=256M \\n max_execution_time=600&quot;;     fastcgi_read_timeout 600s;     fastcgi_connect_timeout 600s;     fastcgi_param  MAGE_MODE $MAGE_MODE;      fastcgi_index  index.php;     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;     include        fastcgi_params;     }     }      <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">phpmyadmin.conf<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">    server {     listen 80;     server_name pma myadmin;     root \/usr\/share\/phpmyadmin\/;     index index.php;      location \/setup\/index.php {     deny all;     }     location ~ .php$ {     if (!-e $request_filename) { rewrite \/ \/index.php last; }      expires        off;     fastcgi_pass unix:\/run\/php\/php7.0-fpm.sock;     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;     fastcgi_param  SCRIPT_NAME  $document_root$fastcgi_script_name;     fastcgi_param  MAGE_RUN_TYPE store;     include        fastcgi_params;     }     include        fastcgi_params;     }     <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041a\u043b\u0430\u0434\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443 \/etc\/nginx\/sites-availiable\/ \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0438 \u043d\u0430 \u043d\u0438\u0445 \u0432 \u043f\u0430\u043f\u043a\u0435 \/etc\/nginx\/sites-enabled\/<br \/>  \u0418\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0438\u0445 \u0432 \u043f\u0430\u043f\u043a\u0443 \/etc\/nginx\/sites-enabled\/<\/p>\n<h6><b>PHP 7.0 FPM<\/b><\/h6>\n<p>  \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \/etc\/php\/7.0\/fpm\/php.ini<br \/>  \u041d\u0430\u0441 \u0432\u043e\u043b\u043d\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0439 \u0432\u043a\u0443\u0441.<br \/>  <code> max_execution_time = 300<br \/>   max_input_time = 160<br \/>   memory_limit = 512M<br \/>   display_errors = On<br \/>   log_errors = On<br \/>   html_errors = On<br \/>   date.timezone = (\u0442\u0443\u0442 \u0441\u0432\u043e\u044e \u0442\u0430\u0439\u043c\u0437\u043e\u043d\u0443 \u0443\u043a\u0430\u0437\u0430\u0442\u044c)<br \/>  <\/code><br \/>  <b> Samba server<\/b><br \/>  \u041c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0441\u0430\u043c\u0431\u0443, \u043f\u043e\u0434\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u0435 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0434\u0438\u0441\u043a \u0438 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b. \u041d\u043e \u0432\u0430\u043c \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f. \u041d\u0430 \u0432\u043a\u0443\u0441 \u0438 \u0446\u0432\u0435\u0442, \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f\u2026<br \/>  \u041c\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0442\u0430\u043a\u043e\u0432: <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">smb.conf<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">     [global]     workgroup = WORKGROUP      server string = %h server (Samba, Ubuntu)      dns proxy = no      log file = \/var\/log\/samba\/log.%m      max log size = 1000      syslog = 0      panic action = \/usr\/share\/samba\/panic-action %d      server role = standalone server     passdb backend = tdbsam      obey pam restrictions = yes      unix password sync = yes      passwd program = \/usr\/bin\/passwd %u     passwd chat = *Enter\\snew\\s*\\spassword:* %n\\n *Retype\\snew\\s*\\spassword:* %n\\n *password\\supdated\\ssuccessfully* .      pam password change = yes      map to guest = bad user     null passwords = Yes     guest account = www-data      [www]     path = \/var\/www\/     comment = WWW folder     guest ok = yes     browseable = yes     read only = no     locking = no     force user = www-data     force group = www-data     <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h5><b>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430<\/b><\/h5>\n<p>  \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0441\u0442 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043e\u0441\u043e\u0431\u044b\u0445 \u0443\u043c\u0435\u043d\u0438\u0439. \u041d\u043e \u0434\u043b\u044f \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u044f\u0441\u043d\u043e\u0441\u0442\u0438, \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0432\u0438\u0434\u0435\u043e-\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0441\u043f\u0440\u044f\u0442\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c.<br \/>  <a name=\"store_setup\"><\/a>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0433\u0430\u0437\u0438\u043d Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/7psPnJfQQds?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<h4><b>C\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f<\/b><\/h4>\n<p>  <a name=\"module_structure\"><\/a>  <\/p>\n<h5><b>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/LovPDwQFOOk?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/1\/IGN_Siteblocks-1.zip\">IGN_Siteblocks-1.zip<\/a><\/p>\n<p>  \u0423\u0447\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u0431\u0443\u0434\u0435\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0431\u043b\u043e\u043a\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 (\u0435\u0433\u043e frontend \u0447\u0430\u0441\u0442\u0438). \u0418 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043c\u044b \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c \u0438 \u043d\u0435\u0441\u0442\u0438 \u0441\u043c\u044b\u0441\u043b.<br \/>  \u0410 \u0435\u0449\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u0439\u043c\u0441\u043f\u0435\u0439\u0441 (\u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0438\u043b\u0438 \u0435\u0433\u043e \u0424\u0418\u041e). \u0418 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0438\u0434 <b>Namespace_Modulename<\/b>. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u043d\u0430\u0437\u0432\u0430\u043b <b>IGN_Siteblocks<\/b>.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 XML \u0444\u0430\u0439\u043b:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/etc\/modules\/IGN_Siteblocks.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">    &lt;?xml version=&quot;1.0&quot; ?&gt;     &lt;config&gt;         &lt;modules&gt;             &lt;IGN_Siteblocks&gt;                 &lt;active&gt;true&lt;\/active&gt; &lt;!-- \u043c\u043e\u0434\u0443\u043b\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d --&gt;                 &lt;codePool&gt;local&lt;\/codePool&gt;             &lt;\/IGN_Siteblocks&gt;         &lt;\/modules&gt;     &lt;\/config&gt;     <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e codePool. \u0412\u0441\u0435\u0433\u043e \u0438\u0445 3: <i>local<\/i>, <i>community<\/i>, <i>core<\/i> (\u0438 <i>enterprise<\/i> \u0432 Enterprise \u0432\u0435\u0440\u0441\u0438\u0438 Magento)<br \/>  \u0418 \u0441\u0440\u0430\u0437\u0443 \u0440\u0435\u0448\u0438\u043c, \u0447\u0442\u043e \u0432 core \u043c\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u0442\u0430\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0430\u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u043f\u043e\u043c\u0438\u043c\u043e \u0438\u0445 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <i>local<\/i> \u0438 <i>community<\/i> (\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0437\u0443 \u0432\u0437\u044f\u0442\u044c <i>community<\/i>, \u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 <i>local<\/i>)<br \/>  \u0417\u0430\u0439\u0434\u0435\u043c \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0443 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430, \u0432 \u0440\u0430\u0437\u0434\u0435\u043b System &gt; Configuration &gt; Advanced &gt; Disable Modules Output \u0438 \u0443\u0432\u0438\u0434\u0438\u043c \u043d\u0430\u0448 IGN_Siteblocks.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f:<br \/>  <b>app\/code\/local\/IGN\/Siteblocks\/<\/b>  <\/p>\n<ol>\n<li> <b>Block <\/b> \u2014 \u043a\u043b\u0430\u0441\u0441\u044b \u0431\u043b\u043e\u043a\u043e\u0432, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0441\u0442\u0440\u0430\u043d\u0438\u0446<\/li>\n<li> <b>controllers <\/b> \u2014 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/li>\n<li> <b>etc <\/b> \u2014 \u0442\u0443\u0442 \u0432\u0441\u044f\u043a\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b<\/li>\n<li> <b>Helper <\/b> \u2014 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0438<\/li>\n<li> <b>Model <\/b> \u2014 \u043c\u043e\u0434\u0435\u043b\u0438<\/li>\n<li> <b>sql <\/b> \u2014 \u0438\u043d\u0441\u0442\u0430\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/li>\n<\/ol>\n<p>  \u041c\u043e\u0434\u0443\u043b\u0438 \u0432 Magento \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d <a href=\"https:\/\/habrahabr.ru\/post\/215605\/\">MVC<\/a><br \/>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u0432\u0438\u0434 (\u0431\u043b\u043e\u043a\u0438, \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b \u0438 \u043c\u0430\u043a\u0435\u0442\u044b) \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b.<br \/>  \u0412 \u043f\u0430\u043f\u043a\u0435 <i>etc <\/i>\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <i>config.xml<\/i><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">    &lt;?xml version=&quot;1.0&quot; ?&gt;     &lt;config&gt;         &lt;modules&gt;             &lt;IGN_Siteblocks&gt;                 &lt;version&gt;1.0.0&lt;\/version&gt;             &lt;\/IGN_Siteblocks&gt;         &lt;\/modules&gt;         &lt;global&gt;             &lt;!-- \u0422\u0443\u0442 \u0431\u0443\u0434\u0443\u0442 \u043c\u043e\u0434\u0435\u043b\u0438, \u0431\u043b\u043e\u043a\u0438, \u0445\u0435\u043b\u043f\u0435\u0440\u044b, \u0440\u0435\u0432\u0440\u0430\u0439\u0442\u044b, \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u0441\u0435\u0440\u0432\u0435\u0440\u044b --&gt;         &lt;\/global&gt;         &lt;frontend&gt;             &lt;!-- \u0412\u0441\u0435 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e frontend \u0447\u0430\u0441\u0442\u0438 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430: \u0440\u043e\u0443\u0442\u044b, \u043c\u0430\u043a\u0435\u0442\u044b, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b, \u043e\u0431\u0441\u0435\u0440\u0432\u0435\u0440\u044b --&gt;         &lt;\/frontend&gt;         &lt;admin&gt;             &lt;!-- \u0412\u0441\u0435 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e admin \u0447\u0430\u0441\u0442\u0438 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430: \u0440\u043e\u0443\u0442\u044b, \u043c\u0430\u043a\u0435\u0442\u044b, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b--&gt;         &lt;\/admin&gt;         &lt;adminhtml&gt;             &lt;!-- \u0412\u0441\u0435 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e admin \u0447\u0430\u0441\u0442\u0438 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430:  \u043c\u0430\u043a\u0435\u0442\u044b, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b, \u043e\u0431\u0441\u0435\u0440\u0432\u0435\u0440\u044b --&gt;         &lt;\/adminhtml&gt;         &lt;defalut&gt;             &lt;!-- \u0412\u0441\u0435 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e admin \u0447\u0430\u0441\u0442\u0438 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430:  \u043c\u0430\u043a\u0435\u0442\u044b, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b, \u043e\u0431\u0441\u0435\u0440\u0432\u0435\u0440\u044b --&gt;         &lt;\/defalut&gt;     &lt;\/config&gt;     <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0443\u0442 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0431\u043b\u043e\u043a\u0438, \u043c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b, \u0445\u0435\u043b\u043f\u0435\u0440\u044b, \u043e\u0431\u0441\u0435\u0440\u0432\u0435\u0440\u044b, \u0440\u0435\u0432\u0440\u0430\u0439\u0442\u044b, \u043c\u0430\u043a\u0435\u0442\u044b, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043c\u043e\u0434\u0443\u043b\u044f.<br \/>  <a name=\"xdebug\"><\/a>  <\/p>\n<h5><b>\u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u043a\u043e\u0434\u0430 XDEBUG + PHPSTORM<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u041e\u0442\u043b\u0430\u0434\u043a\u0430 \u043a\u043e\u0434\u0430 XDEBUG + PHPSTORM<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/4NH3kFce-50?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0443\u0442 \u044f \u0431\u044b \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e.<br \/>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0435\u0440\u0432\u0435\u0440:<br \/>  <code>apt-get install php-xdebug<\/code><br \/>  \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 php.ini \u0438\u043b\u0438 xdebug.ini<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\/etc\/php\/7.0\/conf.d\/20-xdebug.ini<\/b><\/p>\n<div class=\"spoiler_text\"> <code>zend_extension = xdebug.so<br \/>  xdebug.idekey = &quot;PHPSTORM&quot;<br \/>  xdebug.remote_autostart = 1<br \/>  xdebug.remote_connect_back = 1<br \/>  xdebug.remote_enable = 1<br \/>  xdebug.remote_port = 9000<br \/>  <\/code>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 <b>service php7.0-fpm restart<\/b><br \/>  \u0412 PHPSTORM \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 Remote Debug \u043a\u043e\u043d\u0444\u0438\u0433.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0442\u0443\u044e\u0449\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u043e\u043c \u0438 \u043f\u043e\u0440\u0442\u043e\u043c.<br \/>  \u0412 \u043f\u043e\u043b\u0435 IDE key \u0432\u0432\u043e\u0434\u0438\u043c \u0441\u043b\u043e\u0432\u043e PHPSTORM.<br \/>  <a name=\"models\"><\/a>  <\/p>\n<h5><b>\u041c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u041c\u043e\u0434\u0435\u043b\u0438, \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/oEOTyJU_lwE?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/2\/IGN_Siteblocks-2.zip\">IGN_Siteblocks-2.zip<\/a><\/p>\n<p>  \u041c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0435\u0439 \u0441\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0435. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u043e\u043c \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 Magento \u044d\u0442\u043e: Customer, Product, Order \u0438 \u0442\u0434.<br \/>  \u0427\u0442\u043e \u0431\u044b \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0433 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c config.xml<br \/>  \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u0438, \u0431\u043b\u043e\u043a\u0438 \u0438 \u0445\u0435\u043b\u043f\u0435\u0440\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 global \u0441\u0435\u043a\u0446\u0438\u044e.<br \/>  config.xml \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">    &lt;?xml version=&quot;1.0&quot; ?&gt;     &lt;config&gt;         &lt;modules&gt;             &lt;IGN_Siteblocks&gt;                 &lt;version&gt;1.0.0&lt;\/version&gt;             &lt;\/IGN_Siteblocks&gt;         &lt;\/modules&gt;         &lt;global&gt;             &lt;models&gt;                 &lt;siteblocks&gt; &lt;!-- \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0443\u0442 namespace_modulename \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e modulename --&gt;                     &lt;class&gt;IGN_Siteblocks_Model&lt;\/class&gt;                     &lt;resourceModel&gt;siteblocks_resource&lt;\/resourceModel&gt;                 &lt;\/siteblocks&gt;                 &lt;siteblocks_resource&gt;                     &lt;class&gt;IGN_Siteblocks_Resource&lt;\/class&gt;                     &lt;entities&gt;                         &lt;block&gt; &lt;!-- \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 --&gt;                             &lt;table&gt;ign_siteblock&lt;\/table&gt; &lt;!-- \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 &quot;\u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430&quot; \u043c\u043e\u0434\u0435\u043b\u044c --&gt;                         &lt;\/block&gt;                     &lt;\/entities&gt;                 &lt;\/siteblocks_resource&gt;             &lt;\/models&gt;             &lt;resources&gt;                 &lt;siteblocks_setup&gt; &lt;!-- \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0442\u0430\u043a\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c install \u0438 upgrade \u0441\u043a\u0440\u0438\u043f\u0442\u044b --&gt;                     &lt;setup&gt;                         &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                     &lt;\/setup&gt;                 &lt;\/siteblocks_setup&gt;             &lt;\/resources&gt;         &lt;\/global&gt;         &lt;frontend&gt;          &lt;\/frontend&gt;         &lt;admin&gt;          &lt;\/admin&gt;         &lt;defalut&gt;          &lt;\/defalut&gt;     &lt;\/config&gt;     <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0430\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 (\u043d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a\u043e\u0439 \u0442\u0435\u0440\u043c\u0438\u043d \u0442\u0443\u0442 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043b\u0443\u0447\u0448\u0435). \u042f \u0432\u044b\u0431\u0440\u0430\u043b siteblocks. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u043d\u0435\u0439\u043c\u0441\u043f\u0435\u0439\u0441\u0430 \u0438 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u0435\u043d\u0438 \u043c\u043e\u0434\u0443\u043b\u044f. \u041d\u0443 \u0438\u043b\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0438\u043a\u0443\u043f\u0438\u0432 \u043e\u0431\u0435\u0440\u0435\u0433 \u043e\u0442 \u043f\u0440\u043e\u043a\u043b\u044f\u0442\u0438\u0439.<br \/>  \u0412\u044b\u0431\u0438\u0440\u0430\u0439\u0442\u0435 \u0447\u0435\u0442\u043a\u043e \u0438 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u041e\u0434\u043d\u0430 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430, \u0438 \u0431\u0443\u0434\u0435\u0442\u0435 \u0434\u043e\u043b\u0433\u043e \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f, \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435. \u0418\u043c\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435.<br \/>  \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0442\u043e \u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"php\">Mage::getModel('siteblocks\/block'); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u044c Block.<br \/>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c 3 \u0444\u0430\u0439\u043b\u0430: \u043c\u043e\u0434\u0435\u043b\u044c, \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c, \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438.<br \/>  \u041c\u043e\u0434\u0435\u043b\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439, \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u043d\u0438\u0436\u0435. \u0422\u0430\u043c \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e \u0438\u0445 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437 \u0431\u0430\u0437\u044b.<br \/>  \u041a\u043e\u0434 \u043c\u043e\u0434\u0435\u043b\u0438 Block.php:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Model\/Block.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">    &lt;?php class IGN_Siteblocks_Model_Block extends Mage_Core_Model_Abstract {      public function _construct()     {         parent::_construct();         $this-&gt;_init('siteblocks\/block'); \/\/\u0412\u0441\u0435 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0441\u0442\u0432\u0438\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 config.xml \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438     }     }     <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u043e\u0434\u0435\u043b\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 <i>Mage_Core_Model_Abstract<\/i>.<br \/>  \u0420\u0435\u0441\u0443\u0440\u0441\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0435 Model\/Resource.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Model\/Resource\/Block.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">    &lt;?php class IGN_Siteblocks_Model_Resource_Block extends  Mage_Core_Model_Mysql4_Abstract {      public function _construct()     {         $this-&gt;_init('siteblocks\/block','block_id'); \/\/block_id \u044d\u0442\u043e \u043d\u0430\u0448 PRIMARY KEY \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e entity_id     }      }     <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Model\/Resource\/Block\/Collection.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">    &lt;?php class IGN_Siteblocks_Model_Resource_Block_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {      public function _construct()     {         parent::_construct();         $this-&gt;_init('siteblocks\/block');     }     }     <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430\u0448\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u0443\u0441\u0442\u044b, \u043d\u043e \u043e\u043d\u0438 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043f\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e.<br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043d\u0438\u0445 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u043c \u043f\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0410 \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043c\u043e\u0434\u0435\u043b\u0438 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438 \u043d\u043e\u0432\u044b\u0445 3 \u0444\u0430\u0439\u043b\u0430. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 (\u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430), \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b, \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442<br \/>  <i>Mage_Core_Model_Abstract <\/i>\u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<br \/>  \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0430\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/sql\/siteblocks_setup\/install-1.0.0.sql<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">    &lt;?php \/** @var Mage_Core_Model_Resource_Setup $installer *\/ $installer = $this; $installer-&gt;startSetup();      $installer-&gt;run(&quot;     CREATE TABLE IF NOT EXISTS `{$this-&gt;getTable('siteblocks\/block')}` (     `block_id` int(11) NOT NULL AUTO_INCREMENT,     `title` varchar(500) NOT NULL,     `content` text NOT NULL,     `block_status` tinyint(4) NOT NULL,     `created_at` datetime NOT NULL,     PRIMARY KEY (`block_id`)     ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;     &quot;);      \/\/\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b     $table = $installer-&gt;getConnection()     -&gt;newTable($this-&gt;getTable('siteblocks\/block'))     -&gt;addColumn('block_id',Varien_Db_Ddl_Table::TYPE_INTEGER,null,array(     'identity' =&gt; true,     'unsigned' =&gt; true,     'nullable' =&gt; false,     'primary'  =&gt; true     ))     -&gt;addColumn('title',Varien_Db_Ddl_Table::TYPE_VARCHAR,null,array(     'nullable' =&gt; false     ))     -&gt;addColumn('content',Varien_Db_Ddl_Table::TYPE_TEXT,null,array(     'nullable' =&gt; false     ))     -&gt;addColumn('block_status',Varien_Db_Ddl_Table::TYPE_TINYINT,null,array(     'nullable' =&gt; false     ))     -&gt;addColumn('created_at',Varien_Db_Ddl_Table::TYPE_DATETIME,null,array(     'nullable' =&gt; false     ));      $installer-&gt;endSetup();     <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <b> \u0412\u0410\u0416\u041d\u042b\u0419 \u041c\u041e\u041c\u0415\u041d\u0422!<br \/>  <\/b><br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0437\u0430\u0439\u0442\u0438 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0443, \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435, \u043a\u043e\u0433\u0434\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u043d\u0441\u0442\u0430\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0430\u0448 \u0438\u043d\u0441\u0442\u0430\u043b\u043b \u0441\u043a\u0440\u0438\u043f\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0441\u044f. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0439\u0442\u0438 \u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c siteblocks_setup \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b core_resource \u0432 \u0431\u0430\u0437\u0435 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430.<br \/>  \u041f\u0440\u0438 \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f. \u041c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0432 <i>config.xml<\/i>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <i>1.0.1<\/i>. \u0418 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u043f\u0433\u0440\u0435\u0439\u0434 \u0441\u043a\u0440\u0438\u043f\u0442: <i>upgrade-1.0.0-1.0.1.php<\/i><br \/>  \u0418 \u0432 \u0442\u0430\u043a\u043e\u043c \u0436\u0435 \u0434\u0443\u0445\u0435 \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0430\u0445.<br \/>  \u0413\u043e\u0432\u043e\u0440\u044f \u043e \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u0445, \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043e \u0441\u0430\u043c\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u044d\u0442\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">    \/\/\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b block_id = 1     $block = Mage::getModel('siteblocks\/block')-&gt;load(1);      \/\/\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u043b\u043e\u043a     $block-&gt;delete();      \/\/C\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c     $block-&gt;save();      \/\/\u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u043b\u043e\u043a \u043d\u0435 \u0434\u0435\u043b\u0430\u044f \u0435\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437 \u0431\u0430\u0437\u044b     Mage::getModel('siteblocks\/block')-&gt;setId(1)-&gt;delete();      \/\/\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0431\u043b\u043e\u043a\u043e\u0432 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     $blocks = Mage::getModel('siteblocks\/block')-&gt;getCollection();      \/\/\u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u0433\u0434\u0435 block_id = 1, 2 \u0438 3     $blocks-&gt;addFieldToFilter('block_id',array('in'=&gt;array(1,2,3))) ;      echo $blocks-&gt;getSelect(); \/\/\u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0438\u0439\u0441\u044f SQL \u0437\u0430\u043f\u0440\u043e\u0441      \/\/\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438     $blocks = Mage::getResourceModel('siteblocks\/block_collection');     <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"controllers\"><\/a>  <\/p>\n<h5><b>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438 \u0440\u043e\u0443\u0442\u0438\u043d\u0433<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438 \u0440\u043e\u0443\u0442\u0438\u043d\u0433 \u0432 Magento.<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/eJ6KdoWgooI?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/3\/IGN_Siteblocks-3.zip\">IGN_Siteblocks-3.zip<\/a><\/p>\n<p>  \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0443 MVC, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u0432 \u0432\u0438\u0434\u0435 HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u0435\u0440\u0435\u0448\u0435\u043b \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u2014 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440.<br \/>  \u041f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0440\u043e\u0443\u0442\u0438\u043d\u0433 \u0432 <i>config.xml<\/i>. \u0420\u043e\u0443\u0442\u0438\u043d\u0433 \u0434\u043b\u044f frontend \u0438 admin \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c routers \u0432 \u0441\u0435\u043a\u0446\u0438\u044e <i>frontend <\/i>\u0438 <i>admin<\/i>.<br \/>  <i>config.xml<\/i> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">    &lt;?xml version=&quot;1.0&quot; ?&gt;     &lt;config&gt;         &lt;modules&gt;             &lt;IGN_Siteblocks&gt;                 &lt;version&gt;1.0.0&lt;\/version&gt;             &lt;\/IGN_Siteblocks&gt;         &lt;\/modules&gt;         &lt;global&gt;             &lt;models&gt;                 &lt;siteblocks&gt;                     &lt;class&gt;IGN_Siteblocks_Model&lt;\/class&gt;                     &lt;resourceModel&gt;siteblocks_resource&lt;\/resourceModel&gt;                 &lt;\/siteblocks&gt;                 &lt;siteblocks_resource&gt;                     &lt;class&gt;IGN_Siteblocks_Resource&lt;\/class&gt;                     &lt;entities&gt;                         &lt;block&gt;                             &lt;table&gt;ign_siteblock&lt;\/table&gt;                         &lt;\/block&gt;                     &lt;\/entities&gt;                 &lt;\/siteblocks_resource&gt;             &lt;\/models&gt;             &lt;resources&gt;                 &lt;siteblocks_setup&gt;                     &lt;setup&gt;                         &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                     &lt;\/setup&gt;                 &lt;\/siteblocks_setup&gt;             &lt;\/resources&gt;         &lt;\/global&gt;         &lt;frontend&gt;             &lt;routers&gt;                 &lt;siteblocks&gt;                     &lt;use&gt;standard&lt;\/use&gt;                     &lt;args&gt;                         &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                         &lt;frontName&gt;siteblocks&lt;\/frontName&gt;&lt;!-- \u043b\u044e\u0431\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043d\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u0439\u0442\u0435 \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0440\u043e\u0443\u0442\u0435\u0440\u0430\u043c\u0438 --&gt;                     &lt;\/args&gt;                 &lt;\/siteblocks&gt;             &lt;\/routers&gt;         &lt;\/frontend&gt;         &lt;admin&gt;             &lt;routers&gt;                 &lt;adminhtml&gt;                     &lt;args&gt;                         &lt;modules&gt;                             &lt;siteblocks before=&quot;Mage_Adminhtml&quot;&gt;IGN_Siteblocks_Adminhtml&lt;\/siteblocks&gt;                         &lt;\/modules&gt;                     &lt;\/args&gt;                 &lt;\/adminhtml&gt;             &lt;\/routers&gt;         &lt;\/admin&gt;         &lt;default&gt;          &lt;\/default&gt;     &lt;\/config&gt;     <\/code><\/pre>\n<p>   <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0432 \u043f\u0430\u043f\u043a\u0435 <i>controllers <\/i>\u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<br \/>  \u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043b\u044f frontend \u0447\u0430\u0441\u0442\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <b>Mage_Core_Controller_Front_Action<\/b><br \/>   \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 TestController.php<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/TestController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_TestController extends Mage_Core_Controller_Front_Action {      public function mytestAction()     {         die('test');     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043f\u043e URL \u0432\u0438\u0434\u0430 <a href=\"http:\/\/example.com\/siteblocks\/test\/mytest\">example.com\/siteblocks\/test\/mytest<\/a><br \/>  \u0412\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u0435 \u0431\u0435\u043b\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u0441 \u043d\u0430\u0434\u043f\u0438\u0441\u044c\u044e \u00abtest\u00bb. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e, \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430. \u041f\u0435\u0440\u0435\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u043a\u043e\u0434 \u0438 \u0447\u0438\u0442\u0430\u0439\u0442\u0435 \u043b\u043e\u0433\u0438.<br \/>  URL \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 router (<b>siteblocks<\/b>) \/ controller (<b>Test<\/b>Controller) \/ action (<b>mytest<\/b>Action)<\/p>\n<p>  GET \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c 2\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:  <\/p>\n<ul>\n<li>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c: <a href=\"http:\/\/example.com\/siteblocks\/test\/mytest?param=val&amp;param2=val\">example.com\/siteblocks\/test\/mytest?param=val&amp;param2=val<\/a><\/li>\n<li>\u0427\u0435\u0440\u0435\u0437 \u0441\u043b\u044d\u0448\u0438: <a href=\"http:\/\/example.com\/siteblocks\/test\/mytest\/param\/val\/param2\/val\">example.com\/siteblocks\/test\/mytest\/param\/val\/param2\/val<\/a><\/li>\n<\/ul>\n<p>  \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 controllers\/Adminhtml.<br \/>  \u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043b\u044f frontend \u0447\u0430\u0441\u0442\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <b>Mage_Adminhtml_Controller_Action<\/b><br \/>   \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 TestController.php<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/Adminhtml\/TestController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Adminhtml_TestController extends Mage_Adminhtml_Controller_Action {      public function mytestAction()     {         die('admin');     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0439\u0442\u0438 \u043f\u043e URL: <a href=\"http:\/\/example.com\/admin\/test\/mytest\">example.com\/admin\/test\/mytest<\/a> \u2014 \u0433\u0434\u0435 <b>admin <\/b>\u044d\u0442\u043e \u0432\u0430\u0448 \u043f\u0443\u0442\u044c \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0443.<br \/>  \u0418 \u0442\u0443\u0442 \u0435\u0441\u0442\u044c \u043d\u044c\u044e\u0430\u043d\u0441: \u0442\u0430\u043a\u043e\u0439 \u0443\u0440\u043b \u0443\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043d\u044f\u0442 \u0434\u0440\u0443\u0433\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c. \u0412\u044b\u0445\u043e\u0434\u0430 \u0442\u0443\u0442 2: \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043d\u0430 \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043d\u0435\u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043d\u043e\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 IgntestController.php) \u0438\u043b\u0438 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0432 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0443.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/Adminhtml\/Siteblocks\/TestController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Adminhtml_Siteblocks_TestController extends Mage_Adminhtml_Controller_Action {      public function mytestAction()     {         die('admin');     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 URL \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0438\u0434: <a href=\"http:\/\/example.com\/admin\/siteblocks_test\/mytest\">example.com\/admin\/siteblocks_test\/mytest<\/a><br \/>  <a name=\"helpers\"><\/a>  <\/p>\n<h5><b>\u0425\u0435\u043b\u043f\u0435\u0440\u044b<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0425\u0435\u043b\u043f\u0435\u0440\u044b \u0432 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/dG722lJK2gE?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/4\/IGN_Siteblocks-4.zip\">IGN_Siteblocks-4.zip<\/a><\/p>\n<p>  \u041a\u043b\u0430\u0441\u0441\u044b \u0445\u0435\u043b\u043f\u0435\u0440\u043e\u0432 \u0432 Magento \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b. \u0412 \u043d\u0438\u0445 \u0441\u0442\u043e\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0431\u043b\u043e\u043a\u043e\u0432 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u041d\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0445\u0435\u043b\u043f\u0435\u0440\u0430 Data.php.<br \/>  \u042d\u0442\u043e\u0442 \u0445\u0435\u043b\u043f\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 (\u043b\u0435\u0439\u0431\u043b\u043e\u0432, \u043f\u0443\u043d\u043a\u0442\u043e\u0432 \u043c\u0435\u043d\u044e \u0438 \u0442\u0434) \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438.<br \/>  \u0412 \u0445\u0435\u043b\u043f\u0435\u0440\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0447\u0442\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0430.<br \/>  \u0425\u0435\u043b\u043f\u0435\u0440\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <b>Mage_Core_Helper_Abstract<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/loca\/IGN\/Siteblocks\/Helper\/Data.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Helper_Data extends Mage_Core_Helper_Abstract {  }<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0445\u0435\u043b\u043f\u0435\u0440\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 __(), \u0430 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a  <\/p>\n<pre><code class=\"php\">echo Mage::helper('siteblocks')-&gt;__('Some text') <\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432 \u043c\u044b \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0432 config.xml.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; ?&gt; &lt;config&gt;     &lt;modules&gt;         &lt;IGN_Siteblocks&gt;             &lt;version&gt;1.0.0&lt;\/version&gt;         &lt;\/IGN_Siteblocks&gt;     &lt;\/modules&gt;     &lt;global&gt;         &lt;models&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Model&lt;\/class&gt;                 &lt;resourceModel&gt;siteblocks_resource&lt;\/resourceModel&gt;             &lt;\/siteblocks&gt;             &lt;siteblocks_resource&gt;                 &lt;class&gt;IGN_Siteblocks_Resource&lt;\/class&gt;                 &lt;entities&gt;                     &lt;block&gt;                         &lt;table&gt;ign_siteblock&lt;\/table&gt;                     &lt;\/block&gt;                 &lt;\/entities&gt;             &lt;\/siteblocks_resource&gt;         &lt;\/models&gt;         &lt;resources&gt;             &lt;siteblocks_setup&gt;                 &lt;setup&gt;                     &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                 &lt;\/setup&gt;             &lt;\/siteblocks_setup&gt;         &lt;\/resources&gt;         &lt;helpers&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Helper&lt;\/class&gt;             &lt;\/siteblocks&gt;         &lt;\/helpers&gt;     &lt;\/global&gt;     &lt;frontend&gt;         &lt;routers&gt;             &lt;siteblocks&gt;                 &lt;use&gt;standard&lt;\/use&gt;                 &lt;args&gt;                     &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                     &lt;frontName&gt;siteblocks&lt;\/frontName&gt;                 &lt;\/args&gt;             &lt;\/siteblocks&gt;         &lt;\/routers&gt;         &lt;translate&gt;             &lt;modules&gt;                 &lt;IGN_Siteblocks&gt;                     &lt;files&gt;                         &lt;default&gt;IGN_Siteblocks.csv&lt;\/default&gt;                     &lt;\/files&gt;                 &lt;\/IGN_Siteblocks&gt;             &lt;\/modules&gt;         &lt;\/translate&gt;     &lt;\/frontend&gt;     &lt;admin&gt;         &lt;routers&gt;             &lt;adminhtml&gt;                 &lt;args&gt;                     &lt;modules&gt;                         &lt;siteblocks before=&quot;Mage_Adminhtml&quot;&gt;IGN_Siteblocks_Adminhtml&lt;\/siteblocks&gt;                     &lt;\/modules&gt;                 &lt;\/args&gt;             &lt;\/adminhtml&gt;         &lt;\/routers&gt;     &lt;\/admin&gt;     &lt;defalut&gt;      &lt;\/defalut&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0410 \u0444\u0430\u0439\u043b IGN_Siteblocks.csv \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0435 app\/locale\/en_US\/<br \/>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0438\u0434\u0430:<br \/>  <i>\u00abSome text\u00bb,\u00abSome text\u00bb<\/i><br \/>  \u0421\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0432\u043e\u0435\u0433\u043e \u0445\u0435\u043b\u043f\u0435\u0440\u0430 \u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438.<br \/>  \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u0432 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u043b\u043e\u043a\u0430\u043b\u044c \u0438 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0438 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435.<br \/>  <a name=\"system_config\"><\/a>  <\/p>\n<h5><b>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/0e5CaB9DkM4?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/5\/IGN_Siteblocks-5.zip\">IGN_Siteblocks-5.zip<\/a><\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u0434\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f.<br \/>  \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u0443\u0433\u0443\u0431\u043e \u0447\u0435\u0440\u0435\u0437 xml \u0444\u0430\u0439\u043b\u044b.<br \/>  \u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c 2 \u0444\u0430\u0439\u043b\u0430: <br \/>  system.xml \u2014 \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u043e\u043b\u044f<br \/>  adminhtml.xml \u2014 \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u0438 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430<br \/>  \u0410 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 default \u0432 \u0444\u0430\u0439\u043b\u0435 config.xml<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; ?&gt; &lt;config&gt;     &lt;modules&gt;         &lt;IGN_Siteblocks&gt;             &lt;version&gt;1.0.0&lt;\/version&gt;         &lt;\/IGN_Siteblocks&gt;     &lt;\/modules&gt;     &lt;global&gt;         &lt;models&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Model&lt;\/class&gt;                 &lt;resourceModel&gt;siteblocks_resource&lt;\/resourceModel&gt;             &lt;\/siteblocks&gt;             &lt;siteblocks_resource&gt;                 &lt;class&gt;IGN_Siteblocks_Resource&lt;\/class&gt;                 &lt;entities&gt;                     &lt;block&gt;                         &lt;table&gt;ign_siteblock&lt;\/table&gt;                     &lt;\/block&gt;                 &lt;\/entities&gt;             &lt;\/siteblocks_resource&gt;         &lt;\/models&gt;         &lt;resources&gt;             &lt;siteblocks_setup&gt;                 &lt;setup&gt;                     &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                 &lt;\/setup&gt;             &lt;\/siteblocks_setup&gt;         &lt;\/resources&gt;         &lt;helpers&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Helper&lt;\/class&gt;             &lt;\/siteblocks&gt;         &lt;\/helpers&gt;     &lt;\/global&gt;     &lt;frontend&gt;         &lt;routers&gt;             &lt;siteblocks&gt;                 &lt;use&gt;standard&lt;\/use&gt;                 &lt;args&gt;                     &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                     &lt;frontName&gt;siteblocks&lt;\/frontName&gt;                 &lt;\/args&gt;             &lt;\/siteblocks&gt;         &lt;\/routers&gt;         &lt;translate&gt;             &lt;modules&gt;                 &lt;IGN_Siteblocks&gt;                     &lt;files&gt;                         &lt;default&gt;IGN_Siteblocks.csv&lt;\/default&gt;                     &lt;\/files&gt;                 &lt;\/IGN_Siteblocks&gt;             &lt;\/modules&gt;         &lt;\/translate&gt;     &lt;\/frontend&gt;     &lt;admin&gt;         &lt;routers&gt;             &lt;adminhtml&gt;                 &lt;args&gt;                     &lt;modules&gt;                         &lt;siteblocks before=&quot;Mage_Adminhtml&quot;&gt;IGN_Siteblocks_Adminhtml&lt;\/siteblocks&gt;                     &lt;\/modules&gt;                 &lt;\/args&gt;             &lt;\/adminhtml&gt;         &lt;\/routers&gt;     &lt;\/admin&gt;     &lt;defalut&gt; &lt;siteblocks&gt;                 &lt;settings&gt;                     &lt;enabled&gt;1&lt;\/enabled&gt;                     &lt;block_count&gt;10&lt;\/block_count&gt;                 &lt;\/settings&gt;             &lt;\/siteblocks&gt;     &lt;\/defalut&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/adminhtml.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;config&gt;     &lt;acl&gt;         &lt;resources&gt;             &lt;admin&gt;                 &lt;children&gt;                     &lt;system&gt;                         &lt;children&gt;                             &lt;config&gt;                                 &lt;children&gt;                                     &lt;siteblocks translate=&quot;title&quot; module=&quot;siteblocks&quot;&gt;                                         &lt;title&gt;Siteblocks&lt;\/title&gt;                                     &lt;\/siteblocks&gt;                                 &lt;\/children&gt;                             &lt;\/config&gt;                         &lt;\/children&gt;                     &lt;\/system&gt;                 &lt;\/children&gt;             &lt;\/admin&gt;         &lt;\/resources&gt;     &lt;\/acl&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/system.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;config&gt;     &lt;tabs&gt;          &lt;ign translate=&quot;label&quot; module=&quot;siteblocks&quot;&gt; &lt;!-- \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0432\u043e\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0432 \u043c\u0435\u043d\u044e \u0441\u043b\u0435\u0432\u0430--&gt;             &lt;label&gt;IGN&lt;\/label&gt;             &lt;sort_order&gt;2&lt;\/sort_order&gt;         &lt;\/ign&gt;     &lt;\/tabs&gt;     &lt;sections&gt;         &lt;siteblocks module=&quot;siteblocks&quot; translate=&quot;label&quot;&gt;             &lt;label&gt;Siteblocks&lt;\/label&gt;             &lt;tab&gt;ign&lt;\/tab&gt; &lt;!-- \u0412 \u043a\u0430\u043a\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0430\u0448\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 --&gt;             &lt;frontend&gt;text&lt;\/frontend&gt;             &lt;sort_order&gt;1&lt;\/sort_order&gt;             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;             &lt;groups&gt;                 &lt;settings module=&quot;siteblocks&quot; translate=&quot;label&quot;&gt;                     &lt;label&gt;Settings&lt;\/label&gt;                     &lt;expanded&gt;1&lt;\/expanded&gt;                     &lt;sort_order&gt;1&lt;\/sort_order&gt;                     &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                     &lt;show_in_Website&gt;1&lt;\/show_in_Website&gt;                     &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                     &lt;fields&gt;                         &lt;enabled translate=&quot;label comment&quot; module=&quot;siteblocks&quot;&gt;                             &lt;label&gt;Enabled&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt; &lt;!-- \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0438\u043f\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 lib\/Varien\/Data\/Form\/Element --&gt;                             &lt;source_model&gt;siteblocks\/source_status&lt;\/source_model&gt; &lt;!-- \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043e\u043f\u0446\u0438\u0439 --&gt;                             &lt;sort_order&gt;1&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_Website&gt;1&lt;\/show_in_Website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                             &lt;comment&gt;Is module enabled&lt;\/comment&gt;                         &lt;\/enabled&gt;                         &lt;blocks_count&gt;                             &lt;label&gt;Blocks on page&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;2&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_Website&gt;1&lt;\/show_in_Website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                             &lt;depends&gt;&lt;enabled&gt;1&lt;\/enabled&gt;&lt;\/depends&gt; &lt;!-- \u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u043b\u044f --&gt;                         &lt;\/blocks_count&gt;                         &lt;raw_text&gt;                             &lt;label&gt;Raw text&lt;\/label&gt;                             &lt;frontend_type&gt;textarea&lt;\/frontend_type&gt;                             &lt;sort_order&gt;3&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_Website&gt;1&lt;\/show_in_Website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                             &lt;depends&gt;&lt;enabled&gt;1&lt;\/enabled&gt;&lt;\/depends&gt;                         &lt;\/raw_text&gt;                     &lt;\/fields&gt;                 &lt;\/settings&gt;             &lt;\/groups&gt;         &lt;\/siteblocks&gt;     &lt;\/sections&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u043d\u0430\u0448\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0440\u043e\u043f\u0434\u0430\u0443\u043d \u0441 \u043e\u043f\u0446\u0438\u044f\u043c\u0438, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u043e\u043f\u0446\u0438\u0439:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Model\/Source\/Status.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Model_Source_Status {     const ENABLED = '1';     const DISABLED = '0';      \/**      * Options getter      *      * @return array      *\/     public function toOptionArray()     {         return array(             array('value' =&gt; self::ENABLED, 'label'=&gt;Mage::helper('siteblocks')-&gt;__('Enabled')),             array('value' =&gt; self::DISABLED, 'label'=&gt;Mage::helper('siteblocks')-&gt;__('Disabled')),         );     }      \/**      * Get options in &quot;key-value&quot; format      *      * @return array      *\/     public function toArray()     {         return array(             self::DISABLED =&gt; Mage::helper('siteblocks')-&gt;__('Disabled'),             self::ENABLED =&gt; Mage::helper('siteblocks')-&gt;__('Enabled'),         );     }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"frontend_blocks_layouts_templates\"><\/a>  <\/p>\n<h5><b>Frontend \u0431\u043b\u043e\u043a\u0438. \u041c\u0430\u043a\u0435\u0442\u044b. \u0422\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: Frontend \u0431\u043b\u043e\u043a\u0438. \u041c\u0430\u043a\u0435\u0442\u044b. \u0422\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/tQveLimh1xc?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/6\/IGN_Siteblocks-6.zip\">IGN_Siteblocks-6.zip<\/a><\/p>\n<p>  \u0417\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 frontend \u0447\u0430\u0441\u0442\u0438 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430.<br \/>  \u0418, \u043a\u0430\u043a \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u044b 3 \u0442\u0438\u043f\u0430 \u0444\u0430\u0439\u043b\u043e\u0432: \u0431\u043b\u043e\u043a\u0438, \u043c\u0430\u043a\u0435\u0442\u044b \u0438 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b.<br \/>  \u0411\u043b\u043e\u043a\u0438 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u044b, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u0438 \u0432\u044b\u0432\u043e\u0434 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0411\u043b\u043e\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430. \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442, \u0442\u043e \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u043a\u043b\u044e\u0434\u0438\u0442\u0441\u044f \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 fetchView<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/112\/287\/ad9\/112287ad9c1345a9bc7c6bea34bef52d.png\"\/><br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0437 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0430 \u043a \u0431\u043b\u043e\u043a\u0443 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <b>$this<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/List.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Block_List extends Mage_Core_Block_Template {      public function getBlocks()     {         \/\/return Mage::getResourceModel('siteblocks\/block_collection');         return Mage::getModel('siteblocks\/block')-&gt;getCollection()             -&gt;addFieldToFilter('block_status',array('eq'=&gt;IGN_Siteblocks_Model_Source_Status::ENABLED));     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0411\u043b\u043e\u043a \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <b>Mage_Core_Block_Template <\/b><br \/>  \u041d\u043e \u044d\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430\u0448 \u0431\u043b\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c. \u0422\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0431\u043b\u043e\u043a\u0430 <b>Mage_Catalog_Block_Product_List<\/b><br \/>  \u041c\u0430\u043a\u0435\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043a\u0430\u043a\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0438 \u0432 \u043a\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u043c\u0430\u043a\u0435\u0442\u043e\u0432:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/frontend\/base\/default\/layout\/siteblocks.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;layout version=&quot;1.0.0&quot;&gt;     &lt;siteblocks_index_index&gt; &lt;!-- \u044d\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 URL example.com\/siteblocks\/index\/index --&gt;         &lt;reference name=&quot;head&quot;&gt;             &lt;action method=&quot;setTitle&quot;&gt;                 &lt;title&gt;My Siteblocks&lt;\/title&gt;             &lt;\/action&gt;         &lt;\/reference&gt;         &lt;reference name=&quot;content&quot;&gt;             &lt;block name=&quot;siteblocks.list&quot; as=&quot;siteblocks&quot; type=&quot;siteblocks\/list&quot; template=&quot;siteblocks\/list.phtml&quot;\/&gt;         &lt;\/reference&gt;     &lt;\/siteblocks_index_index&gt;      &lt;catalog_category_default&gt; &lt;!-- \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 handle \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0431\u043b\u043e\u043a \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043d\u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 --&gt;         &lt;reference name=&quot;left&quot;&gt;             &lt;block name=&quot;siteblocks.list&quot; as=&quot;siteblocks&quot; type=&quot;siteblocks\/list&quot; template=&quot;siteblocks\/list.phtml&quot;\/&gt;         &lt;\/reference&gt;         &lt;reference name=&quot;right&quot;&gt;             &lt;block name=&quot;siteblocks.list&quot; as=&quot;siteblocks&quot; type=&quot;siteblocks\/list&quot; template=&quot;siteblocks\/list.phtml&quot;\/&gt;         &lt;\/reference&gt;     &lt;\/catalog_category_default&gt;      &lt;catalog_product_view&gt; &lt;!-- \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u044b\u0432\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0442\u043e\u0432\u0430\u0440\u0430 --&gt;         &lt;reference name=&quot;product.info.extrahint&quot;&gt; &lt;!-- \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u0443\u0436\u0435 \u0437\u0430\u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0430\u043a\u0435\u0442\u0435 catalog.xml \u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0432\u043e\u0439 \u0431\u043b\u043e\u043a \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e\u0433\u043e --&gt;             &lt;block name=&quot;siteblocks.list&quot; before=&quot;-&quot; as=&quot;siteblocks&quot; type=&quot;siteblocks\/list&quot; template=&quot;siteblocks\/list.phtml&quot;\/&gt;         &lt;\/reference&gt;     &lt;\/catalog_product_view&gt; &lt;\/layout&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u043c\u0430\u043a\u0435\u0442\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c js, css \u0444\u0430\u0439\u043b\u044b \u0432 head, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u043b\u043e\u043a \u0432 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0439 \u043d\u0430\u0441 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. \u0422\u0435\u043c\u0430 \u043c\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u0448\u0438\u0440\u043d\u0430 \u0438 \u0441\u0432\u0435\u0440\u0445\u0443 \u044f \u043f\u0440\u0438\u0432\u0435\u043b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u043a\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u043d\u0430\u0448 \u0431\u043b\u043e\u043a \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0441\u0430\u0439\u0442\u0430.<\/p>\n<p>  \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c (\u0431\u0435\u0437 \u043c\u0430\u043a\u0435\u0442\u043e) \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 HTML \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"php\">$html = Mage::app()-&gt;getLayout()-&gt;createBlock('siteblocks\/list')-&gt;setTemplate('siteblocks\/list.phtml')-&gt;toHtml() $this-&gt;getResponse()-&gt;setBody($html); <\/code><\/pre>\n<p>  \u0418 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d HTML \u043a\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430. \u0422\u0430\u043a\u043e\u0435 \u0447\u0430\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 AJAX \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>  \u0412 \u043c\u0430\u043a\u0435\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b siteblocks\/list.phtml. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.  <\/p>\n<pre><code class=\"php\">class IGN_Siteblocks_Block_List extends Mage_Core_Block_Template { protected $_template = 'siteblocks\/list.phtml'; } <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/base\/default\/template\/siteblocks\/list.phtml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php foreach($this-&gt;getBlocks() as $block):?&gt;     &lt;div class=&quot;siteblock&quot;&gt;         &lt;div class=&quot;block-title&quot;&gt;&lt;?php echo $block-&gt;getTitle()?&gt;&lt;\/div&gt;         &lt;div class=&quot;block-content&quot;&gt;&lt;?php echo $block-&gt;getContent()?&gt;&lt;\/div&gt;     &lt;\/div&gt; &lt;?php endforeach;?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0432 \u043a\u043e\u0434\u0435, \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0431\u043b\u043e\u043a\u0430 getBlocks, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c TestController \u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439. IndexController<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/IndexController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_IndexController extends Mage_Core_Controller_Front_Action {      public function indexAction()     {         $this-&gt;loadLayout(); #\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043c\u0430\u043a\u0435\u0442\u044b         $this-&gt;renderLayout(); #\u0432\u044b\u0432\u043e\u0434\u0438\u043c html     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  URL \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0432\u044b\u0432\u043e\u0434 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434: <a href=\"http:\/\/example.com\/siteblocks\/index\/index\/\">example.com\/siteblocks\/index\/index<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/example.com\/siteblocks\/\">example.com\/siteblocks<\/a>, \u0442.\u043a. index\/index \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<br \/>  \u0410 handle \u0432 \u043c\u0430\u043a\u0435\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u043e\u0439: <b>siteblocks_index_index<\/b><br \/>  \u0427\u0442\u043e \u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u044b\u0432\u043e\u0434 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u0431\u0430\u0437\u0443 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0448\u0430\u0433\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u043e\u0440\u043c\u044b \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/>  <a name=\"admin_grid_form\"><\/a>  <\/p>\n<h5><b>Admin \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0413\u0440\u0438\u0434. \u0424\u043e\u0440\u043c\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: Admin \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0413\u0440\u0438\u0434. \u0424\u043e\u0440\u043c\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/fplonyvBrcU?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/7\/IGN_Siteblocks-7.zip\">IGN_Siteblocks-7.zip<\/a><\/p>\n<p>  \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f Admin \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u044d\u0442\u0430\u043f\u043e\u0432:  <\/p>\n<ul>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u043d\u043a\u0442\u044b \u0432 \u043c\u0435\u043d\u044e<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u043b\u043e\u043a\u0438<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b<\/li>\n<\/ul>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0443\u043d\u043a\u0442\u044b \u0432 \u043c\u0435\u043d\u044e:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/adminhtml.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;config&gt;     &lt;acl&gt;         &lt;resources&gt;             &lt;admin&gt;                 &lt;children&gt;                     &lt;system&gt;                         &lt;children&gt;                             &lt;config&gt;                                 &lt;children&gt;                                     &lt;siteblocks translate=&quot;title&quot; module=&quot;siteblocks&quot;&gt;                                         &lt;title&gt;Siteblocks&lt;\/title&gt;                                     &lt;\/siteblocks&gt;                                 &lt;\/children&gt;                             &lt;\/config&gt;                         &lt;\/children&gt;                     &lt;\/system&gt;                     &lt;cms&gt;                         &lt;children&gt;                             &lt;siteblocks translate=&quot;title&quot; module=&quot;siteblocks&quot;&gt;                                 &lt;title&gt;Siteblocks&lt;\/title&gt;                             &lt;\/siteblocks&gt;                         &lt;\/children&gt;                     &lt;\/cms&gt;                 &lt;\/children&gt;             &lt;\/admin&gt;         &lt;\/resources&gt;     &lt;\/acl&gt;     &lt;menu&gt;         &lt;cms&gt; &lt;!-- \u0420\u0430\u0437\u0434\u0435\u043b \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0432\u043e\u0439 \u043f\u0443\u043d\u043a\u0442 --&gt;             &lt;children&gt;                 &lt;siteblocks translate=&quot;title&quot; module=&quot;siteblocks&quot;&gt;                     &lt;title&gt;Siteblocks&lt;\/title&gt;                     &lt;action&gt;adminhtml\/siteblocks&lt;\/action&gt; &lt;!-- \u041d\u0430 \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0432\u0435\u0434\u0435\u0442 \u044d\u0442\u043e\u0442 \u043f\u0443\u043d\u043a\u0442 \u043c\u0435\u043d\u044e, index \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u043e\u043f\u0443\u0441\u0442\u0438\u043b --&gt;                     &lt;sort_order&gt;20&lt;\/sort_order&gt;                 &lt;\/siteblocks&gt;             &lt;\/children&gt;         &lt;\/cms&gt;     &lt;\/menu&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 (\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 cms) \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 adminhtml.xml \u0444\u0430\u0439\u043b\u0430\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 Magento. \u0422\u0430\u043c \u0436\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0440\u0430\u0437\u0434\u0435\u043b.<br \/>  \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0431\u043b\u043e\u043a\u0435 <b>acl<\/b>.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438 1 \u044d\u043a\u0448\u0435\u043d \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/Adminhtml\/SiteblocksController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Adminhtml_SiteblocksController extends Mage_Adminhtml_Controller_Action {      public function indexAction()     {         $this-&gt;loadLayout();         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks'));         $this-&gt;renderLayout();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u043a\u0438, \u043d\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435. \u0422\u0443\u0442 \u043c\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0430\u0448\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. Index \u044d\u043a\u0448\u0435\u043d \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 Grid \u0437\u0430\u043f\u0438\u0441\u0435\u0439.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u043b\u043e\u043a\u043e\u0432.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks extends Mage_Adminhtml_Block_Widget_Grid_Container {      public function __construct()     {         $this-&gt;_controller = 'adminhtml_siteblocks';         $this-&gt;_blockGroup = 'siteblocks';         $this-&gt;_headerText = Mage::helper('siteblocks')-&gt;__('Siteblocks');         $this-&gt;_addButtonLabel = Mage::helper('siteblocks')-&gt;__('Add New Block');         parent::__construct();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u0441\u0435\u0439\u0447\u0430\u0441 \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 Mage_Adminhtml_Block_Widget_Grid_Container<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/112\/287\/ad9\/112287ad9c1345a9bc7c6bea34bef52d.png\"\/><br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f block type \u0431\u043b\u043e\u043a\u0430 grid.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Grid.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Grid extends Mage_Adminhtml_Block_Widget_Grid {      public function __construct()     {         parent::__construct();         $this-&gt;setId('cmsBlockGrid');         $this-&gt;setDefaultSort('block_identifier');         $this-&gt;setDefaultDir('ASC');     }      protected function _prepareCollection()     {         $collection = Mage::getModel('siteblocks\/block')-&gt;getCollection();         \/* @var $collection Mage_Cms_Model_Mysql4_Block_Collection *\/         $this-&gt;setCollection($collection);         return parent::_prepareCollection();     }      protected function _prepareColumns()     {          $this-&gt;addColumn('title', array(             'header'    =&gt; Mage::helper('siteblocks')-&gt;__('Title'),             'align'     =&gt; 'left',             'index'     =&gt; 'title',         ));          $this-&gt;addColumn('block_status', array(             'header'    =&gt; Mage::helper('cms')-&gt;__('Status'),             'align'     =&gt; 'left',             'type'      =&gt; 'options',             'options'   =&gt; Mage::getModel('siteblocks\/source_status')-&gt;toArray(),             'index'     =&gt; 'block_status'         ));           $this-&gt;addColumn('created_at', array(             'header'    =&gt; Mage::helper('siteblocks')-&gt;__('Created At'),             'index'     =&gt; 'created_at',             'type'      =&gt; 'date',          ));           return parent::_prepareColumns();     }      protected function _prepareMassaction()     {         $this-&gt;setMassactionIdField('block_id');         $this-&gt;getMassactionBlock()-&gt;setIdFieldName('block_id');         $this-&gt;getMassactionBlock()             -&gt;addItem('delete',                 array(                     'label' =&gt; Mage::helper('siteblocks')-&gt;__('Delete'),                     'url' =&gt; $this-&gt;getUrl('*\/*\/massDelete'),                     'confirm' =&gt; Mage::helper('siteblocks')-&gt;__('Are you sure?')                 )             )             -&gt;addItem('status',                 array(                     'label' =&gt; Mage::helper('siteblocks')-&gt;__('Update status'),                     'url' =&gt; $this-&gt;getUrl('*\/*\/massStatus'),                     'additional' =&gt;                         array('block_status'=&gt;                         array(                             'name' =&gt; 'block_status',                             'type' =&gt; 'select',                             'class' =&gt; 'required-entry',                             'label' =&gt; Mage::helper('siteblocks')-&gt;__('Status'),                             'values' =&gt; Mage::getModel('siteblocks\/source_status')-&gt;toOptionArray()                         )                     )                 )             );          return $this;     }      \/**      * Row click url      *      * @return string      *\/     public function getRowUrl($row)     {         return $this-&gt;getUrl('*\/*\/edit', array('block_id' =&gt; $row-&gt;getId()));     }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0411\u043b\u043e\u043a Grid \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0432\u0438\u0434. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u043e\u043d\u043e\u043a, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f URL \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435.<br \/>  \u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0438\u043f\u044b \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0438\u0445 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 <b>app\/code\/core\/Mage\/Adminhtml\/Block\/Widget\/Grid\/Column\/Renderer\/<\/b><\/p>\n<p>  \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a \u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 2\u0445 \u0431\u043b\u043e\u043a\u043e\u0432: \u0431\u043b\u043e\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438 \u0431\u043b\u043e\u043a \u0444\u043e\u0440\u043c\u044b.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {     public function __construct()     {         $this-&gt;_objectId = 'block_id';         $this-&gt;_controller = 'adminhtml_siteblocks';         $this-&gt;_blockGroup = 'siteblocks';          parent::__construct();          $this-&gt;_updateButton('save', 'label', Mage::helper('siteblocks')-&gt;__('Save Block'));         $this-&gt;_updateButton('delete', 'label', Mage::helper('siteblocks')-&gt;__('Delete Block'));          $this-&gt;_addButton('saveandcontinue', array(             'label'     =&gt; Mage::helper('adminhtml')-&gt;__('Save and Continue Edit'),             'onclick'   =&gt; 'saveAndContinueEdit()',             'class'     =&gt; 'save',         ), -100);          $this-&gt;_formScripts[] = &quot;               function saveAndContinueEdit(){                 editForm.submit($('edit_form').action+'back\/edit\/');             }         &quot;;     }      \/**      * Get edit form container header text      *      * @return string      *\/     public function getHeaderText()     {         if (Mage::registry('siteblocks_block')-&gt;getId()) {             return Mage::helper('siteblocks')-&gt;__(&quot;Edit Block '%s'&quot;, $this-&gt;escapeHtml(Mage::registry('siteblocks_block')-&gt;getTitle()));         }         else {             return Mage::helper('siteblocks')-&gt;__('New Block');         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418 \u0442\u0443\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0441\u044f \u043f\u043e\u0434 \u043c\u0435\u0442\u043e\u0434 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f block type siteblocks\/adminhtml_siteblocks_edit_form<\/p>\n<p>  \u041a\u043b\u0430\u0441\u0441 \u0444\u043e\u0440\u043c\u044b:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Form.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {      \/**      * Init form      *\/     public function __construct()     {         parent::__construct();         $this-&gt;setId('block_form');         $this-&gt;setTitle(Mage::helper('siteblocks')-&gt;__('Block Information'));     }      protected function _prepareForm()     {         $model = Mage::registry('siteblocks_block');         $form = new Varien_Data_Form(             array(                 'id' =&gt; 'edit_form',                 'action' =&gt; $this-&gt;getUrl('*\/*\/save',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id'))),                 'method' =&gt; 'post'             )         );          $form-&gt;setHtmlIdPrefix('block_');          $fieldset = $form-&gt;addFieldset('base_fieldset', array('legend'=&gt;Mage::helper('siteblocks')-&gt;__('General Information'), 'class' =&gt; 'fieldset-wide'));          if ($model-&gt;getBlockId()) {             $fieldset-&gt;addField('block_id', 'hidden', array(                 'name' =&gt; 'block_id',             ));         }          $fieldset-&gt;addField('title', 'text', array(             'name'      =&gt; 'title',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'required'  =&gt; true,         ));           $fieldset-&gt;addField('block_status', 'select', array(             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'name'      =&gt; 'block_status',             'required'  =&gt; true,             'options'   =&gt; Mage::getModel('siteblocks\/source_status')-&gt;toArray(),         ));           $fieldset-&gt;addField('content', 'textarea', array(             'name'      =&gt; 'content',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'style'     =&gt; 'height:36em',             'required'  =&gt; true,          ));          $form-&gt;setValues($model-&gt;getData());         $form-&gt;setUseContainer(true);         $this-&gt;setForm($form);          return parent::_prepareForm();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438 \u0441 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043e\u043f\u0446\u0438\u0439, \u0430 \u0442\u0438\u043f\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 lib\/Varien\/Data\/Form\/Element\/<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0443\u0442 \u0443 \u043d\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u0430\u0439\u0442\u0431\u043b\u043e\u043a\u0430 $model = Mage::registry(&#8216;siteblocks_block&#8217;); \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u044d\u043a\u0448\u0435\u043d\u044b \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440.<br \/>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u044d\u043a\u0448\u0435\u043d\u044b, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0422\u0430\u043a \u0436\u0435 \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u044d\u043a\u0448\u0435\u043d\u044b \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0443\u0441\u0430, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u043a\u043e \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439.<\/p>\n<p>  \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/Adminhtml\/SiteblocksController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Adminhtml_SiteblocksController extends Mage_Adminhtml_Controller_Action {      public function indexAction()     {         $this-&gt;loadLayout();         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks'));         $this-&gt;renderLayout();     }      public function newAction()     {         $this-&gt;_forward('edit');     }      public function editAction()     {         $id = $this-&gt;getRequest()-&gt;getParam('block_id');         Mage::register('siteblocks_block',Mage::getModel('siteblocks\/block')-&gt;load($id));         $blockObject = (array)Mage::getSingleton('adminhtml\/session')-&gt;getBlockObject(true);         if(count($blockObject)) {             Mage::registry('siteblocks_block')-&gt;setData($blockObject);         }         $this-&gt;loadLayout();         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit'));         $this-&gt;renderLayout();     }      public function saveAction()     {         try {             $id = $this-&gt;getRequest()-&gt;getParam('block_id');             $block = Mage::getModel('siteblocks\/block')-&gt;load($id);             \/*$block                 -&gt;setTitle($this-&gt;getRequest()-&gt;getParam('title'))                 -&gt;setContent($this-&gt;getRequest()-&gt;getParam('content'))                 -&gt;setBlockStatus($this-&gt;getRequest()-&gt;getParam('block_status'))                 -&gt;save();*\/             $block                 -&gt;setData($this-&gt;getRequest()-&gt;getParams())                 -&gt;setCreatedAt(Mage::app()-&gt;getLocale()-&gt;date())                 -&gt;save();              if(!$block-&gt;getId()) {                 Mage::getSingleton('adminhtml\/session')-&gt;addError('Cannot save the block');             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             Mage::getSingleton('adminhtml\/session')-&gt;setBlockObject($block-&gt;getData());             return  $this-&gt;_redirect('*\/*\/edit',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id')));         }          Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was saved successfully!');          $this-&gt;_redirect('*\/*\/'.$this-&gt;getRequest()-&gt;getParam('back','index'),array('block_id'=&gt;$block-&gt;getId()));     }       public function deleteAction()     {         $block = Mage::getModel('siteblocks\/block')             -&gt;setId($this-&gt;getRequest()-&gt;getParam('block_id'))             -&gt;delete();         if($block-&gt;getId()) {             Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was deleted successfully!');         }         $this-&gt;_redirect('*\/*\/');      }       public function massStatusAction()     {         $statuses = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$statuses['massaction']));             foreach($blocks as $block) {                 $block-&gt;setBlockStatus($statuses['block_status'])-&gt;save();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were updated!');          return $this-&gt;_redirect('*\/*\/');      }      public function massDeleteAction()     {         $blocks = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$blocks['massaction']));             foreach($blocks as $block) {                 $block-&gt;delete();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were deleted!');          return $this-&gt;_redirect('*\/*\/');      } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 frontend \u0447\u0430\u0441\u0442\u0438.<br \/>  <a name=\"observers\"><\/a>  <\/p>\n<h5><b>\u0421\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0421\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438 \u0432 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/qJk_tiYuuJA?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/8\/IGN_Siteblocks-8.zip\">IGN_Siteblocks-8.zip<\/a><\/p>\n<p>  \u0412 Magento \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d \u00ab\u0441\u043e\u0431\u044b\u0442\u0438\u0435-\u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c\u00bb. \u0427\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0430\u0439\u0442\u0430. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u043d\u043e\u0441\u0442\u0438, \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u0438 \u0432\u043d\u043e\u0441\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438.<br \/>  \u0418 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 Magento \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e.<br \/>  \u0421\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0444\u0430\u0439\u043b\u0430\u043c Magento \u0442\u0435\u043a\u0441\u0442\u0430 \u00abMage::dispatchEvent\u00bb<br \/>  \u0418\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/magento2.atlassian.net\/wiki\/display\/m1wiki\/Magento+1.x+Events+Reference\">magento2.atlassian.net\/wiki\/display\/m1wiki\/Magento+1.x+Events+Reference<\/a><br \/>  \u042d\u0442\u043e \u0438\u0437 \u044f\u0432\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0435\u0449\u0435 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e, \u043a\u0430\u0436\u0434\u044b\u043c \u0431\u043b\u043e\u043a\u043e\u043c \u0438\u043b\u0438 \u044d\u043a\u0448\u0435\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u044d\u0442\u043e \u043f\u0440\u0435\u0434 \u0438 \u043f\u043e\u0441\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f. <br \/>  model_save_before, model_save_after, controller_action_predispatch, controller_action_postdispatch, core_block_abstract_to_html_before, core_block_abstract_to_html_after<br \/>  \u041f\u043b\u044e\u0441, \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f event_prefix \u0432\u0430\u0448\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438\u043b\u0438 \u0432\u0430\u0448 route name \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 (siteblocks_save_before, controller_action_predispatch_siteblocks&#8230;)<br \/>  \u0412\u0430\u0440\u0438\u0430\u0446\u0438\u0439 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0438 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043c\u043e\u0436\u043d\u043e \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u00ab\u043f\u043e\u0434\u043b\u043e\u0432\u0438\u0442\u044c\u00bb \u043d\u0443\u0436\u043d\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435.<\/p>\n<p>  \u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0432 \u043a\u043e\u0434\u0435:  <\/p>\n<pre><code class=\"php\">Mage::dispatchEvent('some_event_name',array('myparam' =&gt; $someVar)); <\/code><\/pre>\n<p>  \u0421\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u044e\u0442 \u0432 config.xml. \u0418 \u0442\u0430\u043c \u0435\u0441\u0442\u044c 3 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430: global, admin, frontend. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u0433\u0434\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e \u0431\u044b \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u043d\u0430\u0448 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c.<br \/>  \u041d\u0430\u0448 \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; ?&gt; &lt;config&gt;     &lt;modules&gt;         &lt;IGN_Siteblocks&gt;             &lt;version&gt;1.0.0&lt;\/version&gt;         &lt;\/IGN_Siteblocks&gt;     &lt;\/modules&gt;     &lt;global&gt;         &lt;blocks&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Block&lt;\/class&gt;             &lt;\/siteblocks&gt;         &lt;\/blocks&gt;         &lt;models&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Model&lt;\/class&gt;                 &lt;resourceModel&gt;siteblocks_resource&lt;\/resourceModel&gt;             &lt;\/siteblocks&gt;             &lt;siteblocks_resource&gt;                 &lt;class&gt;IGN_Siteblocks_Model_Resource&lt;\/class&gt;                 &lt;entities&gt;                     &lt;block&gt;                         &lt;table&gt;ign_siteblock&lt;\/table&gt;                     &lt;\/block&gt;                 &lt;\/entities&gt;             &lt;\/siteblocks_resource&gt;         &lt;\/models&gt;         &lt;resources&gt;             &lt;siteblocks_setup&gt;                 &lt;setup&gt;                     &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                 &lt;\/setup&gt;             &lt;\/siteblocks_setup&gt;         &lt;\/resources&gt;         &lt;helpers&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Helper&lt;\/class&gt;             &lt;\/siteblocks&gt;         &lt;\/helpers&gt;     &lt;\/global&gt;     &lt;frontend&gt;         &lt;events&gt;             &lt;checkout_cart_product_add_after&gt; &lt;!-- \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0441\u0430\u043c\u043e \u0437\u0430 \u0441\u0435\u0431\u044f--&gt;                 &lt;observers&gt;                     &lt;siteblocks&gt;                         &lt;class&gt;siteblocks\/observer&lt;\/class&gt;                         &lt;method&gt;checkout_cart_product_add_after&lt;\/method&gt; &lt;!-- \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u044f --&gt;                         &lt;type&gt;model&lt;\/type&gt;                     &lt;\/siteblocks&gt;                 &lt;\/observers&gt;             &lt;\/checkout_cart_product_add_after&gt;         &lt;\/events&gt;         &lt;layout&gt;             &lt;updates&gt;                 &lt;siteblocks module=&quot;siteblocks&quot;&gt;                     &lt;file&gt;siteblocks.xml&lt;\/file&gt;                 &lt;\/siteblocks&gt;             &lt;\/updates&gt;         &lt;\/layout&gt;         &lt;routers&gt;             &lt;siteblocks&gt;                 &lt;use&gt;standard&lt;\/use&gt;                 &lt;args&gt;                     &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                     &lt;frontName&gt;siteblocks&lt;\/frontName&gt;                 &lt;\/args&gt;             &lt;\/siteblocks&gt;         &lt;\/routers&gt;         &lt;translate&gt;             &lt;modules&gt;                 &lt;IGN_Siteblocks&gt;                     &lt;files&gt;                         &lt;default&gt;IGN_Siteblocks.csv&lt;\/default&gt;                     &lt;\/files&gt;                 &lt;\/IGN_Siteblocks&gt;             &lt;\/modules&gt;         &lt;\/translate&gt;     &lt;\/frontend&gt;     &lt;admin&gt;         &lt;routers&gt;             &lt;adminhtml&gt;                 &lt;args&gt;                     &lt;modules&gt;                         &lt;siteblocks before=&quot;Mage_Adminhtml&quot;&gt;IGN_Siteblocks_Adminhtml&lt;\/siteblocks&gt;                     &lt;\/modules&gt;                 &lt;\/args&gt;             &lt;\/adminhtml&gt;         &lt;\/routers&gt;     &lt;\/admin&gt;     &lt;default&gt;             &lt;siteblocks&gt;                 &lt;settings&gt;                     &lt;enabled&gt;1&lt;\/enabled&gt;                     &lt;block_count&gt;10&lt;\/block_count&gt;                 &lt;\/settings&gt;             &lt;\/siteblocks&gt;     &lt;\/default&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 1 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u0432\u0430\u0440\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f. \u041c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0438 \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u043c\u043e\u0434\u0435\u043b\u044c. \u041d\u043e \u044d\u0442\u043e \u0434\u0443\u0440\u043d\u043e\u0439 \u0442\u043e\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 Observer.php<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Model\/Observer.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Model_Observer {     \/**      * @param $bserver Varien_Event_Observer      *\/     public function checkout_cart_product_add_after($observer)     {         var_dump($observer-&gt;getEvent()-&gt;getData('quote_item')-&gt;getData());die;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0441\u0432\u043e\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438.<br \/>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0441\u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0430\u0439\u0442\u0435\u043c\u0430 \u0438\u0437 \u043a\u043e\u0440\u0437\u0438\u043d\u044b. (\u043f\u043e\u0437\u0436\u0435 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0438\u043d\u0430\u0447\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u0432\u0430\u0440\u044b \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443)<br \/>  <a name=\"cron\"><\/a>  <\/p>\n<h5><b>\u041a\u0440\u043e\u043d \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u041a\u0440\u043e\u043d \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0432 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/h_EK9iKFVfY?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/9\/IGN_Siteblocks-9.zip\">IGN_Siteblocks-9.zip<\/a><\/p>\n<p>  \u0415\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u043f\u043e\u0441\u043f\u043e\u0440\u044c\u0435\u043c \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e.<br \/>  \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u0440\u043e\u043d\u0430 Magento, \u0430 \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b Magento \u0431\u0443\u0434\u0435\u0442 \u0441\u0430\u043c \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u043a\u0430\u043a\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c.<br \/>  \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Magento cron \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438:<br \/>  crontab -e<br \/>  * *\/1 * * * php \/var\/www\/magento.dev\/cron.php<br \/>  \u0411\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0442\u0443\u0442: <a href=\"http:\/\/help.ubuntu.ru\/wiki\/cron\">help.ubuntu.ru\/wiki\/cron<\/a><br \/>  \u0418\u043b\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c, \u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0440\u043e\u043d, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0439\u0434\u044f \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0432\u0438\u0434\u0430 example.com\/cron.php<\/p>\n<p>  \u041d\u0430\u0448\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u044b \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u0443\u0435\u043c \u0432 config.xml \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0431\u043b\u043e\u043a\u0435 crontab.<br \/>  \u0418 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u0438\u0434 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; ?&gt; &lt;config&gt;     &lt;modules&gt;         &lt;IGN_Siteblocks&gt;             &lt;version&gt;1.0.0&lt;\/version&gt;         &lt;\/IGN_Siteblocks&gt;     &lt;\/modules&gt;     &lt;global&gt;         &lt;blocks&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Block&lt;\/class&gt;             &lt;\/siteblocks&gt;         &lt;\/blocks&gt;         &lt;models&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Model&lt;\/class&gt;                 &lt;resourceModel&gt;siteblocks_resource&lt;\/resourceModel&gt;             &lt;\/siteblocks&gt;             &lt;siteblocks_resource&gt;                 &lt;class&gt;IGN_Siteblocks_Model_Resource&lt;\/class&gt;                 &lt;entities&gt;                     &lt;block&gt;                         &lt;table&gt;ign_siteblock&lt;\/table&gt;                     &lt;\/block&gt;                 &lt;\/entities&gt;             &lt;\/siteblocks_resource&gt;         &lt;\/models&gt;         &lt;resources&gt;             &lt;siteblocks_setup&gt;                 &lt;setup&gt;                     &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                 &lt;\/setup&gt;             &lt;\/siteblocks_setup&gt;         &lt;\/resources&gt;         &lt;helpers&gt;             &lt;siteblocks&gt;                 &lt;class&gt;IGN_Siteblocks_Helper&lt;\/class&gt;             &lt;\/siteblocks&gt;         &lt;\/helpers&gt;     &lt;\/global&gt;     &lt;frontend&gt;         &lt;events&gt;             &lt;controller_action_predispatch&gt;              &lt;\/controller_action_predispatch&gt;             &lt;checkout_cart_product_add_after&gt;                 &lt;observers&gt;                     &lt;siteblocks&gt;                         &lt;class&gt;siteblocks\/observer&lt;\/class&gt;                         &lt;method&gt;checkout_cart_product_add_after&lt;\/method&gt;                         &lt;type&gt;model&lt;\/type&gt;                     &lt;\/siteblocks&gt;                 &lt;\/observers&gt;             &lt;\/checkout_cart_product_add_after&gt;         &lt;\/events&gt;         &lt;layout&gt;             &lt;updates&gt;                 &lt;siteblocks module=&quot;siteblocks&quot;&gt;                     &lt;file&gt;siteblocks.xml&lt;\/file&gt;                 &lt;\/siteblocks&gt;             &lt;\/updates&gt;         &lt;\/layout&gt;         &lt;routers&gt;             &lt;siteblocks&gt;                 &lt;use&gt;standard&lt;\/use&gt;                 &lt;args&gt;                     &lt;module&gt;IGN_Siteblocks&lt;\/module&gt;                     &lt;frontName&gt;siteblocks&lt;\/frontName&gt;                 &lt;\/args&gt;             &lt;\/siteblocks&gt;         &lt;\/routers&gt;         &lt;translate&gt;             &lt;modules&gt;                 &lt;IGN_Siteblocks&gt;                     &lt;files&gt;                         &lt;default&gt;IGN_Siteblocks.csv&lt;\/default&gt;                     &lt;\/files&gt;                 &lt;\/IGN_Siteblocks&gt;             &lt;\/modules&gt;         &lt;\/translate&gt;     &lt;\/frontend&gt;     &lt;admin&gt;         &lt;routers&gt;             &lt;adminhtml&gt;                 &lt;args&gt;                     &lt;modules&gt;                         &lt;siteblocks before=&quot;Mage_Adminhtml&quot;&gt;IGN_Siteblocks_Adminhtml&lt;\/siteblocks&gt;                     &lt;\/modules&gt;                 &lt;\/args&gt;             &lt;\/adminhtml&gt;         &lt;\/routers&gt;     &lt;\/admin&gt;     &lt;default&gt;             &lt;siteblocks&gt;                 &lt;settings&gt;                     &lt;enabled&gt;1&lt;\/enabled&gt;                     &lt;block_count&gt;10&lt;\/block_count&gt;                 &lt;\/settings&gt;             &lt;\/siteblocks&gt;     &lt;\/default&gt;     &lt;crontab&gt;         &lt;jobs&gt;             &lt;siteblocks_clear_cache&gt; &lt;!-- \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438--&gt;                 &lt;schedule&gt;                     &lt;cron_expr&gt;*\/10 * * * *&lt;\/cron_expr&gt; &lt;!-- \u043a\u0430\u0436\u0434\u044b\u0435 10 \u043c\u0438\u043d\u0443\u0442 --&gt;                 &lt;\/schedule&gt;                 &lt;run&gt;                     &lt;model&gt;siteblocks\/cron::siteblocks_clear_cache&lt;\/model&gt; &lt;!-- \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c --&gt;                 &lt;\/run&gt;             &lt;\/siteblocks_clear_cache&gt;         &lt;\/jobs&gt;     &lt;\/crontab&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0437\u0430\u0434\u0430\u0447 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Cron.php<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Model\/Cron.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Model_Cron {     public function siteblocks_clear_cache()     {       \/\/do something here         Mage::app()-&gt;cleanCache(array('siteblocks_blocks'));     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"renderers\"><\/a>  <\/p>\n<h5><b>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u043e\u0432 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u043e\u0432 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/n4Is6Gd35FE?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/10\/IGN_Siteblocks-10.zip\">IGN_Siteblocks-10.zip<\/a><\/p>\n<p>  \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440 \u0434\u043b\u044f \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0437\u0430\u0442\u0440\u0430\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438.<br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u0430 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0444\u043e\u0440\u043c\u044b.<br \/>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0430\u0434\u043c\u0438\u043d \u0444\u043e\u0440\u043c\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Form.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {      \/**      * Init form      *\/     public function __construct()     {         parent::__construct();         $this-&gt;setId('block_form');         $this-&gt;setTitle(Mage::helper('siteblocks')-&gt;__('Block Information'));     }      protected function _prepareForm()     {         $model = Mage::registry('siteblocks_block');         $form = new Varien_Data_Form(             array(                 'id' =&gt; 'edit_form',                 'action' =&gt; $this-&gt;getUrl('*\/*\/save',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id'))),                 'method' =&gt; 'post',                 'enctype' =&gt; 'multipart\/form-data'             )         );           $form-&gt;setHtmlIdPrefix('block_');          $fieldset = $form-&gt;addFieldset('base_fieldset',             array(                 'legend'=&gt;Mage::helper('siteblocks')-&gt;__('General Information'),                 'class' =&gt; 'fieldset-wide')         );          if ($model-&gt;getBlockId()) {             $fieldset-&gt;addField('block_id', 'hidden', array(                 'name' =&gt; 'block_id',             ));         }          $fieldset-&gt;addField('title', 'text', array(             'name'      =&gt; 'title',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'required'  =&gt; true,         ));  #1\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u0430 \u0438\u043b\u0438 \u0440\u0435\u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0430 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u043e\u043b\u0435\u0439 #\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0442\u0435\u043d\u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043f\u043e \u043f\u0443\u0442\u0438 ...\/Block\/Adminhtml\/Siteblocks\/Edit\/Renderer\/Myimage.php         $fieldset-&gt;addType('myimage','IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Renderer_Myimage');  #\u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0438\u044f \u0442\u0438\u043f\u0430-\u043a\u043b\u0430\u0441\u0441, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b lib\/Varien\/Data\/Form\/Element\/Myimage.php         $fieldset-&gt;addField('image', 'myimage', array(             'name'      =&gt; 'image',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Image'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Image'),             'required'  =&gt; true,         ));          $fieldset-&gt;addField('block_status', 'select', array(             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'name'      =&gt; 'block_status',             'required'  =&gt; true,             'options'   =&gt; Mage::getModel('siteblocks\/source_status')-&gt;toArray(),         ));          $fieldset-&gt;addField('content', 'textarea', array(             'name'      =&gt; 'content',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'style'     =&gt; 'height:36em',             'required'  =&gt; true,          ));          $form-&gt;setValues($model-&gt;getData());         $form-&gt;setUseContainer(true);         $this-&gt;setForm($form);          return parent::_prepareForm();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u043d\u0430\u0448\u0435\u0439 \u0444\u043e\u0440\u043c\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e 2 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u043e\u0432 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u043b\u044e\u0431\u044b\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c, \u043d\u043e \u043c\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043c\u043f\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0444\u0430\u0439\u043b\u0430 \u0432 \u043f\u0430\u043f\u043a\u0435 lib\/Varien\/Data\/Form\/Element\/<br \/>  \u0422.\u043a. \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0436\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440 \u0438 \u0432 \u043f\u043e\u043b\u044f\u0445 \u0434\u043b\u044f system.xml<br \/>  \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f &lt;frontend_type&gt;myimage&lt;\/frontend_type&gt; \u043f\u043e \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443.<\/p>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Renderer\/Myimage.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Renderer_Myimage extends Varien_Data_Form_Element_Abstract {     \/**      * Constructor      *      * @param array $data      *\/     public function __construct($data)     {         parent::__construct($data);         $this-&gt;setType('file');     }      \/**      * Return element html code      *      * @return string      *\/     public function getElementHtml()     {         $html = '';          if ((string)$this-&gt;getValue()) {             $url = $this-&gt;_getUrl();              if( !preg_match(&quot;\/^http\\:\\\/\\\/|https\\:\\\/\\\/\/&quot;, $url) ) {                 $url = Mage::getBaseUrl('media') . 'siteblocks' .DS.$url;             }              $html = '&lt;a href=&quot;' . $url . '&quot;'                 . ' onclick=&quot;imagePreview(\\'' . $this-&gt;getHtmlId() . '_image\\'); return false;&quot;&gt;'                 . '&lt;img src=&quot;' . $url . '&quot; id=&quot;' . $this-&gt;getHtmlId() . '_image&quot; title=&quot;' . $this-&gt;getValue() . '&quot;'                 . ' alt=&quot;' . $this-&gt;getValue() . '&quot; height=&quot;100&quot; width=&quot;100&quot; class=&quot;small-image-preview v-middle&quot; \/&gt;'                 . '&lt;\/a&gt; ';             \/*$additional = Mage::app()-&gt;getLayout()-&gt;createBlock('Mage_Adminhtml_Block_Template');             $additional-&gt;setTemplate('siteblocks\/image.phtml')                 -&gt;setImageUrl($url);             $html = $additional-&gt;toHtml();*\/ #\u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u0434 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b html \u043a\u043e\u0434 \u0441\u0442\u0440\u043e\u0438\u043b\u0441\u044f \u0432 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0435, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432         }         $this-&gt;setClass('input-file');         $html .= parent::getElementHtml();         return $html;     }      \/**      * Return html code of hidden element      *      * @return string      *\/     protected function _getHiddenInput()     {         return '&lt;input type=&quot;hidden&quot; name=&quot;' . parent::getName() . '[value]&quot; value=&quot;' . $this-&gt;getValue() . '&quot; \/&gt;';     }      \/**      * Get image preview url      *      * @return string      *\/     protected function _getUrl()     {         return $this-&gt;getValue();     }      \/**      * Return name      *      * @return string      *\/     public function getName()     {         return  $this-&gt;getData('name');     } }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">lib\/Varien\/Data\/Form\/Element\/Myimage.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class Varien_Data_Form_Element_Myimage extends Varien_Data_Form_Element_Abstract {     \/**      * Constructor      *      * @param array $data      *\/     public function __construct($data)     {         parent::__construct($data);         $this-&gt;setType('file');     }      \/**      * Return element html code      *      * @return string      *\/     public function getElementHtml()     {         $html = '';          if ((string)$this-&gt;getValue()) {             $url = $this-&gt;_getUrl();              if( !preg_match(&quot;\/^http\\:\\\/\\\/|https\\:\\\/\\\/\/&quot;, $url) ) {                 $url = Mage::getBaseUrl('media') . 'siteblocks' .DS.$url;             }              $html = '&lt;a href=&quot;' . $url . '&quot;'                 . ' onclick=&quot;imagePreview(\\'' . $this-&gt;getHtmlId() . '_image\\'); return false;&quot;&gt;'                 . '&lt;img src=&quot;' . $url . '&quot; id=&quot;' . $this-&gt;getHtmlId() . '_image&quot; title=&quot;' . $this-&gt;getValue() . '&quot;'                 . ' alt=&quot;' . $this-&gt;getValue() . '&quot; height=&quot;150&quot; width=&quot;150&quot; class=&quot;small-image-preview v-middle&quot; \/&gt;'                 . '&lt;\/a&gt; ';             \/*$additional = Mage::app()-&gt;getLayout()-&gt;createBlock('Mage_Adminhtml_Block_Template');             $additional-&gt;setTemplate('siteblocks\/image.phtml')                 -&gt;setImageUrl($url);             $html = $additional-&gt;toHtml();*\/ #\u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u0434 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b html \u043a\u043e\u0434 \u0441\u0442\u0440\u043e\u0438\u043b\u0441\u044f \u0432 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0435, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432         }         $this-&gt;setClass('input-file');         $html .= parent::getElementHtml();         return $html;     }      \/**      * Return html code of hidden element      *      * @return string      *\/     protected function _getHiddenInput()     {         return '&lt;input type=&quot;hidden&quot; name=&quot;' . parent::getName() . '[value]&quot; value=&quot;' . $this-&gt;getValue() . '&quot; \/&gt;';     }      \/**      * Get image preview url      *      * @return string      *\/     protected function _getUrl()     {         return $this-&gt;getValue();     }      \/**      * Return name      *      * @return string      *\/     public function getName()     {         return  $this-&gt;getData('name');     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e lib\/Varien\/Data\/Form\/Element\/Image.php<br \/>  \u0418 \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u043b \u043a\u043e\u0434 \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u043c\u0435\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u0430 \u0434\u043b\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0438 Grid.<\/p>\n<p>  \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c \u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0435 \u043c\u043e\u0434\u0443\u043b\u044f. \u041d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Grid.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Grid extends Mage_Adminhtml_Block_Widget_Grid {      public function __construct()     {         parent::__construct();         $this-&gt;setId('cmsBlockGrid');         $this-&gt;setDefaultSort('block_identifier');         $this-&gt;setDefaultDir('ASC');     }      protected function _prepareCollection()     {         $collection = Mage::getModel('siteblocks\/block')-&gt;getCollection();         \/* @var $collection Mage_Cms_Model_Mysql4_Block_Collection *\/         $this-&gt;setCollection($collection);         return parent::_prepareCollection();     }      protected function _prepareColumns()     {          $this-&gt;addColumn('title', array(             'header'    =&gt; Mage::helper('siteblocks')-&gt;__('Title'),             'align'     =&gt; 'left',             'index'     =&gt; 'title',         ));          $this-&gt;addColumn('image', array(             'header'    =&gt; Mage::helper('siteblocks')-&gt;__('Image'),             'align'     =&gt; 'left',             'index'     =&gt; 'image',             'filter'    =&gt; false, &lt;!-- \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043c\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c --&gt;             'sortable'  =&gt; false,&lt;!-- \u0438 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c \u0438\u0445 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c --&gt;             'renderer'  =&gt; 'IGN_Siteblocks_Block_Adminhtml_Siteblocks_Grid_Renderer_Image', \/\/         'renderer'  =&gt; 'siteblocks\/adminhtml_siteblocks_grid_renderer_image' #\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431         ));          $this-&gt;addColumn('block_status', array(             'header'    =&gt; Mage::helper('cms')-&gt;__('Status'),             'align'     =&gt; 'left',             'type'      =&gt; 'options',             'options'   =&gt; Mage::getModel('siteblocks\/source_status')-&gt;toArray(),             'index'     =&gt; 'block_status'         ));           $this-&gt;addColumn('created_at', array(             'header'    =&gt; Mage::helper('siteblocks')-&gt;__('Created At'),             'index'     =&gt; 'created_at',             'type'      =&gt; 'date',          ));           return parent::_prepareColumns();     }      protected function _prepareMassaction()     {         $this-&gt;setMassactionIdField('block_id');         $this-&gt;getMassactionBlock()-&gt;setIdFieldName('block_id');         $this-&gt;getMassactionBlock()             -&gt;addItem('delete',                 array(                     'label' =&gt; Mage::helper('siteblocks')-&gt;__('Delete'),                     'url' =&gt; $this-&gt;getUrl('*\/*\/massDelete'),                     'confirm' =&gt; Mage::helper('siteblocks')-&gt;__('Are you sure?')                 )             )             -&gt;addItem('status',                 array(                     'label' =&gt; Mage::helper('siteblocks')-&gt;__('Update status'),                     'url' =&gt; $this-&gt;getUrl('*\/*\/massStatus'),                     'additional' =&gt;                         array('block_status'=&gt;                         array(                             'name' =&gt; 'block_status',                             'type' =&gt; 'select',                             'class' =&gt; 'required-entry',                             'label' =&gt; Mage::helper('siteblocks')-&gt;__('Status'),                             'values' =&gt; Mage::getModel('siteblocks\/source_status')-&gt;toOptionArray()                         )                     )                 )             );          return $this;     }      \/**      * Row click url      *      * @return string      *\/     public function getRowUrl($row)     {         return $this-&gt;getUrl('*\/*\/edit', array('block_id' =&gt; $row-&gt;getId()));     }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Grid\/Renderer\/Image.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Grid_Renderer_Image     extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {     public function render(Varien_Object $row) #\u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443     {         if( ! $row-&gt;getImage()) {             return '';         }         $url = Mage::getBaseUrl('media') . 'siteblocks' .DS .$row-&gt;getImage();         $html = &quot;&lt;img src='$url' width='100' height='auto'&gt;&quot;;         return $html;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u0435 \u043c\u044b \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c $src URL \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c html \u043a\u043e\u0434 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<br \/>  1. \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0432 config.xml \u0434\u043e 1.0.1<br \/>  2. \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b upgrade-1.0.0-1.0.1.php<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/sql\/siteblocks_setup\/upgrade-1.0.0-1.0.1.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php \/** @var Mage_Core_Model_Resource_Setup $installer *\/ $installer = $this; $installer-&gt;startSetup();  $installer-&gt;run(&quot; ALTER TABLE `{$this-&gt;getTable('siteblocks\/block')}` ADD `image` TEXT NOT NULL; &quot;);  $installer-&gt;endSetup(); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  3. \u0412 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/Adminhtml\/SiteblocksController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Adminhtml_SiteblocksController extends Mage_Adminhtml_Controller_Action {      public function indexAction()     {         $this-&gt;loadLayout();         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks'));         $this-&gt;renderLayout();     }      public function newAction()     {         $this-&gt;_forward('edit');     }      public function editAction()     {         $id = $this-&gt;getRequest()-&gt;getParam('block_id');         Mage::register('siteblocks_block',Mage::getModel('siteblocks\/block')-&gt;load($id));         $blockObject = (array)Mage::getSingleton('adminhtml\/session')-&gt;getBlockObject(true);         if(count($blockObject)) {             Mage::registry('siteblocks_block')-&gt;setData($blockObject);         }         $this-&gt;loadLayout();         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit'));         $this-&gt;renderLayout();     }  \/\/ \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432     protected function _uploadFile($fieldName,$model)     {          if( ! isset($_FILES[$fieldName])) {             return false;         }         $file = $_FILES[$fieldName];          if(isset($file['name']) && (file_exists($file['tmp_name']))){             if($model-&gt;getId()){                 unlink(Mage::getBaseDir('media').DS.$model-&gt;getData($fieldName));             }             try             {                 $path = Mage::getBaseDir('media') . DS . 'siteblocks' . DS;                 $uploader = new Varien_File_Uploader($file);                 $uploader-&gt;setAllowedExtensions(array('jpg','png','gif','jpeg'));                 $uploader-&gt;setAllowRenameFiles(true);                 $uploader-&gt;setFilesDispersion(false);                  $uploader-&gt;save($path, $file['name']);                 $model-&gt;setData($fieldName,$uploader-&gt;getUploadedFileName());                 return true;             }             catch(Exception $e)             {                 return false;             }         }     }      public function saveAction()     {         try {             $id = $this-&gt;getRequest()-&gt;getParam('block_id');             $block = Mage::getModel('siteblocks\/block')-&gt;load($id);             \/*$block                 -&gt;setTitle($this-&gt;getRequest()-&gt;getParam('title'))                 -&gt;setContent($this-&gt;getRequest()-&gt;getParam('content'))                 -&gt;setBlockStatus($this-&gt;getRequest()-&gt;getParam('block_status'))                 -&gt;save();*\/             $block                 -&gt;setData($this-&gt;getRequest()-&gt;getParams());             $this-&gt;_uploadFile('image',$block); \/\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432             $block                 -&gt;setCreatedAt(Mage::app()-&gt;getLocale()-&gt;date())                 -&gt;save();              if(!$block-&gt;getId()) {                 Mage::getSingleton('adminhtml\/session')-&gt;addError('Cannot save the block');             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             Mage::getSingleton('adminhtml\/session')-&gt;setBlockObject($block-&gt;getData());             return  $this-&gt;_redirect('*\/*\/edit',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id')));         }          Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was saved successfully!');          $this-&gt;_redirect('*\/*\/'.$this-&gt;getRequest()-&gt;getParam('back','index'),array('block_id'=&gt;$block-&gt;getId()));     }      public function deleteAction()     {         $block = Mage::getModel('siteblocks\/block')             -&gt;setId($this-&gt;getRequest()-&gt;getParam('block_id'))             -&gt;delete();         if($block-&gt;getId()) {             Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was deleted successfully!');         }         $this-&gt;_redirect('*\/*\/');      }      public function massStatusAction()     {         $statuses = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$statuses['massaction']));             foreach($blocks as $block) {                 $block-&gt;setBlockStatus($statuses['block_status'])-&gt;save();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were updated!');          return $this-&gt;_redirect('*\/*\/');      }      public function massDeleteAction()     {         $blocks = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$blocks['massaction']));             foreach($blocks as $block) {                 $block-&gt;delete();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were deleted!');          return $this-&gt;_redirect('*\/*\/');      } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  4. \u041d\u0435\u0437\u0430\u0431\u044b\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 media\/siteblocks\/ \u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u044e\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c.  <\/p>\n<h6> \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u0438 \u043f\u0440\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u043d\u0430 frontend.<\/h6>\n<p>  \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/frontend\/base\/default\/template\/siteblocks\/list.phtml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php foreach($this-&gt;getBlocks() as $block):?&gt;     &lt;div class=&quot;siteblock&quot;&gt;         &lt;div class=&quot;block-title&quot;&gt;&lt;?php echo $block-&gt;getTitle()?&gt;&lt;\/div&gt;         &lt;div class=&quot;block-image&quot;&gt;             &lt;?php if($block-&gt;getImage()):?&gt;                 &lt;img src=&quot;&lt;?php echo $block-&gt;getImageSrc()?&gt;&quot; height=&quot;150&quot; width=&quot;auto&quot; alt=&quot;&lt;?php $block-&gt;getTitle()?&gt;&quot; title=&quot;&lt;?php $block-&gt;getTitle()?&gt;&quot;&gt;             &lt;?php endif;?&gt;         &lt;\/div&gt;         &lt;div class=&quot;block-content&quot;&gt;&lt;?php echo $block-&gt;getContent() ?&gt;&lt;\/div&gt;     &lt;\/div&gt; &lt;?php endforeach;?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u043c\u043e\u0434\u0435\u043b\u044c \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 getImageSrc \u0438 \u0432\u043e\u0442 \u0435\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Model\/Block.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  \/**  * Class IGN_Siteblocks_Model_Block  * @method getBlockStatus()  * @method getContent()  * @method getImage()  *\/ class IGN_Siteblocks_Model_Block extends Mage_Core_Model_Abstract {      protected $_eventPrefix = 'siteblocks_block';      public function _construct()     {         parent::_construct();         $this-&gt;_init('siteblocks\/block');      }      public function getImageSrc()     {         return Mage::getBaseUrl('media') . 'siteblocks' . DS . $this-&gt;getImage();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0440\u0430\u0437\u043c\u0435\u0440\u043d\u044b\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u044d\u0442\u043e \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u043d\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0441\u0435\u0439\u0447\u0430\u0441 \u0431\u044b\u043b\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440\u043e\u0432.<br \/>  <a name=\"wysiwyg\"><\/a>  <\/p>\n<h5><b>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 WYSIWYG \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 WYSIWYG \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/EJd3VDRSHzg?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/11\/IGN_Siteblocks-11.zip\">IGN_Siteblocks-11.zip<\/a><\/p>\n<p>  WYSIWYG \u2014 What you see is what you get (\u0442\u043e \u0447\u0442\u043e \u0432\u044b \u0432\u0438\u0434\u0435\u0442\u0435, \u0442\u043e \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435)<br \/>  \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0418 \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0435\u043c\u0443 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435.<br \/>  \u041d\u043e \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c.<br \/>  \u041c\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u043a\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/adminhtml\/default\/default\/layout\/siteblocks.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;layout version=&quot;1.0.0&quot;&gt;     &lt;adminhtml_siteblocks_edit&gt; &lt;!-- \u044d\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0443\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f --&gt;         &lt;update handle=&quot;editor&quot;\/&gt; &lt;!-- \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f handle \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 js \u0438 css \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430, \u0430 \u043e\u043f\u0438\u0441\u0430\u043d \u043e\u043d \u0432 \u043c\u0430\u043a\u0435\u0442\u0435 cms.xml --&gt;     &lt;\/adminhtml_siteblocks_edit&gt;      &lt;adminhtml_system_config_edit&gt;         &lt;update handle=&quot;editor&quot;\/&gt;     &lt;\/adminhtml_system_config_edit&gt; &lt;\/layout&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Form.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {      \/**      * Init form      *\/     public function __construct()     {         parent::__construct();         $this-&gt;setId('block_form');         $this-&gt;setTitle(Mage::helper('siteblocks')-&gt;__('Block Information'));     }      protected function _prepareForm()     {         $model = Mage::registry('siteblocks_block');         $form = new Varien_Data_Form(             array(                 'id' =&gt; 'edit_form',                 'action' =&gt; $this-&gt;getUrl('*\/*\/save',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id'))),                 'method' =&gt; 'post',                 'enctype' =&gt; 'multipart\/form-data'             )         );           $form-&gt;setHtmlIdPrefix('block_');          $fieldset = $form-&gt;addFieldset('base_fieldset',             array(                 'legend'=&gt;Mage::helper('siteblocks')-&gt;__('General Information'),                 'class' =&gt; 'fieldset-wide')         );          if ($model-&gt;getBlockId()) {             $fieldset-&gt;addField('block_id', 'hidden', array(                 'name' =&gt; 'block_id',             ));         }          $fieldset-&gt;addField('title', 'text', array(             'name'      =&gt; 'title',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'required'  =&gt; true,         ));          \/\/$fieldset-&gt;addType('myimage','IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Renderer_Myimage');          $fieldset-&gt;addField('image', 'myimage', array(             'name'      =&gt; 'image',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Image'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Image'),             'required'  =&gt; true,         ));            $fieldset-&gt;addField('block_status', 'select', array(             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'name'      =&gt; 'block_status',             'required'  =&gt; true,             'options'   =&gt; Mage::getModel('siteblocks\/source_status')-&gt;toArray(),         ));   #\u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442         $fieldset-&gt;addField('content', 'editor', array(             'name'      =&gt; 'content',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'style'     =&gt; 'height:36em',             'required'  =&gt; true,             'config'    =&gt; Mage::getSingleton('cms\/wysiwyg_config')-&gt;getConfig()          ));          $form-&gt;setValues($model-&gt;getData());         $form-&gt;setUseContainer(true);         $this-&gt;setForm($form);          return parent::_prepareForm();     }  \/\/\u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0444\u043b\u0430\u0433 \u0432 \u0431\u043b\u043e\u043a head, \u0435\u0441\u043b\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445     protected function _prepareLayout()     {         parent::_prepareLayout();         if (Mage::getSingleton('cms\/wysiwyg_config')-&gt;isEnabled()) {             $this-&gt;getLayout()-&gt;getBlock('head')-&gt;setCanLoadTinyMce(true);         }     } }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u043a\u0443\u0447\u043d\u043e\u0439 textarea \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430.<br \/>  \u0410 \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0437 \u0441\u0435\u0431\u044f \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e Editor \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">lib\/Varien\/Data\/Form\/Element\/Myeditor.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class Varien_Data_Form_Element_Myeditor extends Varien_Data_Form_Element_Editor {     public function __construct($attributes=array())     {          parent::__construct($attributes); #\u0432\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0432 \u0431\u043b\u043e\u043a\u0435 \u043d\u0438\u0436\u0435         if (Mage::getSingleton('cms\/wysiwyg_config')-&gt;isEnabled()) {             Mage::app()-&gt;getLayout()-&gt;getBlock('head')-&gt;setCanLoadTinyMce(true);             $this-&gt;setData('config',Mage::getSingleton('cms\/wysiwyg_config')-&gt;getConfig());         }         if($this-&gt;isEnabled()) {             $this-&gt;setType('wysiwyg');             $this-&gt;setExtType('wysiwyg');         } else {             $this-&gt;setType('textarea');             $this-&gt;setExtType('textarea');         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0410 system.xml \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/etc\/system.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;config&gt;     &lt;tabs&gt;         &lt;ign translate=&quot;label&quot; module=&quot;siteblocks&quot;&gt;             &lt;label&gt;IGN&lt;\/label&gt;             &lt;sort_order&gt;2&lt;\/sort_order&gt;         &lt;\/ign&gt;     &lt;\/tabs&gt;     &lt;sections&gt;         &lt;siteblocks module=&quot;siteblocks&quot; translate=&quot;label&quot;&gt;             &lt;label&gt;Siteblocks&lt;\/label&gt;             &lt;tab&gt;ign&lt;\/tab&gt;             &lt;frontend&gt;text&lt;\/frontend&gt;             &lt;sort_order&gt;1&lt;\/sort_order&gt;             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;             &lt;groups&gt;                 &lt;settings module=&quot;siteblocks&quot; translate=&quot;label&quot;&gt;                     &lt;label&gt;Settings&lt;\/label&gt;                     &lt;expanded&gt;1&lt;\/expanded&gt;                     &lt;sort_order&gt;1&lt;\/sort_order&gt;                     &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                     &lt;show_in_Website&gt;1&lt;\/show_in_Website&gt;                     &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                     &lt;fields&gt;                         &lt;enabled translate=&quot;label comment&quot; module=&quot;siteblocks&quot;&gt;                             &lt;label&gt;Enabled&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt;                             &lt;source_model&gt;siteblocks\/source_status&lt;\/source_model&gt;                             &lt;sort_order&gt;1&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_Website&gt;1&lt;\/show_in_Website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                             &lt;comment&gt;Is module enabled&lt;\/comment&gt;                         &lt;\/enabled&gt;                         &lt;blocks_count&gt;                             &lt;label&gt;Blocks on page&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;2&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_Website&gt;1&lt;\/show_in_Website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                             &lt;depends&gt;&lt;enabled&gt;1&lt;\/enabled&gt;&lt;\/depends&gt;                         &lt;\/blocks_count&gt;                         &lt;raw_text&gt;                             &lt;label&gt;Raw text&lt;\/label&gt;                             &lt;frontend_type&gt;myeditor&lt;\/frontend_type&gt; &lt;!-- \u041f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 frontend_type --&gt;                             &lt;sort_order&gt;3&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_Website&gt;1&lt;\/show_in_Website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                             &lt;depends&gt;&lt;enabled&gt;1&lt;\/enabled&gt;&lt;\/depends&gt;                         &lt;\/raw_text&gt;                         &lt;myimage&gt;                             &lt;label&gt;Image&lt;\/label&gt;                             &lt;frontend_type&gt;myimage&lt;\/frontend_type&gt;                             &lt;sort_order&gt;3&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_Website&gt;1&lt;\/show_in_Website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                             &lt;depends&gt;&lt;enabled&gt;1&lt;\/enabled&gt;&lt;\/depends&gt;                         &lt;\/myimage&gt;                     &lt;\/fields&gt;                 &lt;\/settings&gt;             &lt;\/groups&gt;         &lt;\/siteblocks&gt;     &lt;\/sections&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u044d\u0442\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u0438 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<br \/>  \u0410 \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u043d\u0430 frontend.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/frontend\/base\/default\/template\/siteblocks\/list.phtml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php foreach($this-&gt;getBlocks() as $block):?&gt;     &lt;div class=&quot;siteblock&quot;&gt;         &lt;div class=&quot;block-title&quot;&gt;&lt;?php echo $block-&gt;getTitle()?&gt;&lt;\/div&gt;         &lt;div class=&quot;block-image&quot;&gt;             &lt;?php if($block-&gt;getImage()):?&gt;                 &lt;img src=&quot;&lt;?php echo $block-&gt;getImageSrc()?&gt;&quot; height=&quot;150&quot; width=&quot;auto&quot; alt=&quot;&lt;?php $block-&gt;getTitle()?&gt;&quot; title=&quot;&lt;?php $block-&gt;getTitle()?&gt;&quot;&gt;             &lt;?php endif;?&gt;         &lt;\/div&gt;         &lt;div class=&quot;block-content&quot;&gt;&lt;?php echo $this-&gt;getBlockContent($block)?&gt;&lt;\/div&gt;     &lt;\/div&gt; &lt;?php endforeach;?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0431\u043b\u043e\u043a\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 getBlockContent<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/local\/IGN\/Siteblocks\/Block\/List.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Block_List extends Mage_Core_Block_Template {      public function getBlocks()     {         \/\/return Mage::getResourceModel('siteblocks\/block_collection');         $items = Mage::getModel('siteblocks\/block')-&gt;getCollection()             -&gt;addFieldToFilter('block_status',array('eq'=&gt;IGN_Siteblocks_Model_Source_Status::ENABLED));         return $items;     }      public function getBlockContent($block)     {         $processor = Mage::helper('cms')-&gt;getBlockTemplateProcessor();         $html = $processor-&gt;filter($block-&gt;getContent());         return $html;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"promo_conditions\"><\/a>  <\/p>\n<h5><b>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Rule Conditions (\u0443\u0441\u043b\u043e\u0432\u0438\u0439)<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Rule Conditions (\u0443\u0441\u043b\u043e\u0432\u0438\u0439) \u0432 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/t32VeK0JfUw?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/12\/IGN_Siteblocks-12.zip\">IGN_Siteblocks-12.zip<\/a><\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u0422\u0430\u043a\u0438\u0435 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 Magento Promotional Rules. \u0418 \u0442\u0443\u0442 \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043e 2 \u0442\u0438\u043f\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0439. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0442\u043e\u0432\u0430\u0440\u0430, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u0440\u0437\u0438\u043d\u0430. \u0418\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u0440\u0435\u0446\u0435\u043f\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043d\u043e \u0438\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0432 \u043f\u043e\u0434\u043c\u0435\u043d\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a.<br \/>  \u0417\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0443\u0441\u043b\u043e\u0432\u0438\u044f? \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0431\u043b\u043e\u043a. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0446\u0435\u043d\u0430 \u043d\u0438\u0436\u0435 $100 \u0438\u043b\u0438 \u0432\u0441\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u044b \u0438\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 16\u0433\u0431 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0434\u0430\u0442\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430 2015. \u041c\u044b \u0442\u0443\u0442 \u043d\u0435 \u043e \u044e\u0437\u043a\u0435\u0439\u0441\u0430\u0445 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f:<br \/>  1. \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u0434\u043e\u0430\u0432\u043b\u044f\u0435\u043c upgrade \u0441\u043a\u0440\u0438\u043f\u0442, \u0447\u0442\u043e \u0431\u044b \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u043e\u0432\u0430\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430 <i>conditions_serialized <\/i>\u0442\u0438\u043f\u0430 <i>TEXT<\/i>.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/sql\/siteblocks_setup\/upgrade-1.0.1-1.0.2.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php \/** @var Mage_Core_Model_Resource_Setup $installer *\/ $installer = $this; $installer-&gt;startSetup();  $installer-&gt;run(&quot; ALTER TABLE `{$this-&gt;getTable('siteblocks\/block')}` ADD `conditions_serialized` TEXT NOT NULL; &quot;); $installer-&gt;endSetup(); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  2. \u041c\u043e\u0434\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 <b>Mage_Rule_Model_Abstract<\/b>.<br \/>  \u0418 \u0434\u043e\u043b\u0436\u043d\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c 2 \u043c\u0435\u0442\u043e\u0434\u0430: <b>getConditionsInstance <\/b>\u0438 <b>getActionInstance <\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Model\/Observer.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  \/**  * Class IGN_Siteblocks_Model_Block  * @method getBlockStatus()  * @method getContent()  * @method getImage()  *\/ class IGN_Siteblocks_Model_Block extends Mage_Rule_Model_Abstract {      protected $_eventPrefix = 'siteblocks_block';  #\u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0435\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442     public function getActionsInstance()     {         return Mage::getModel('catalogrule\/rule_action_collection');     }       public function getConditionsInstance()     {         return Mage::getModel('catalogrule\/rule_condition_combine');     }      public function _construct()     {         parent::_construct();         $this-&gt;_init('siteblocks\/block');      }      public function getImageSrc()     {         return Mage::getBaseUrl('media') . 'siteblocks' . DS . $this-&gt;getImage();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u0441\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 <b>getConditionsInstance<\/b>.<br \/>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043a\u0430\u043a \u0432 Catalog Price Rules, \u0442.\u0435. \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0442\u043e\u0432\u0430\u0440\u0430.<br \/>  \u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043a\u0430\u043a \u0432 Shopping Cart Price Rules, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <br \/>  Mage::getModel(&#8216;salesrule\/rule_condition_combine&#8217;);<br \/>  \u0418 \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0440\u0435\u0448\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0431\u043b\u043e\u043a \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0435, \u0442\u043e \u0431\u0435\u0440\u0435\u043c salesrule.<br \/>  \u0410 \u0442\u0430\u043a \u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0432 \u043d\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f.<br \/>  3. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c <b>saveAction <\/b>\u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/Adminhtml\/SiteblocksController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Adminhtml_SiteblocksController extends Mage_Adminhtml_Controller_Action {      public function indexAction()     {         $this-&gt;loadLayout();         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks'));         $this-&gt;renderLayout();     }      public function newAction()     {         $this-&gt;_forward('edit');     }      public function editAction()     {         $id = $this-&gt;getRequest()-&gt;getParam('block_id');         Mage::register('siteblocks_block',Mage::getModel('siteblocks\/block')-&gt;load($id));         $blockObject = (array)Mage::getSingleton('adminhtml\/session')-&gt;getBlockObject(true);         if(count($blockObject)) {             Mage::registry('siteblocks_block')-&gt;setData($blockObject);         }         $this-&gt;loadLayout();         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit'));         $this-&gt;renderLayout();     }      protected function _uploadFile($fieldName,$model)     {          if( ! isset($_FILES[$fieldName])) {             return false;         }         $file = $_FILES[$fieldName];          if(isset($file['name']) && (file_exists($file['tmp_name']))){             if($model-&gt;getId()){                 unlink(Mage::getBaseDir('media').DS.$model-&gt;getData($fieldName));             }             try             {                 $path = Mage::getBaseDir('media') . DS . 'siteblocks' . DS;                 $uploader = new Varien_File_Uploader($file);                 $uploader-&gt;setAllowedExtensions(array('jpg','png','gif','jpeg'));                 $uploader-&gt;setAllowRenameFiles(true);                 $uploader-&gt;setFilesDispersion(false);                  $uploader-&gt;save($path, $file['name']);                 $model-&gt;setData($fieldName,$uploader-&gt;getUploadedFileName());                 return true;             }             catch(Exception $e)             {                 return false;             }         }     }      public function saveAction()     {         try {             $id = $this-&gt;getRequest()-&gt;getParam('block_id');             \/** @var IGN_Siteblocks_Model_Block $block *\/             $block = Mage::getModel('siteblocks\/block')-&gt;load($id);             \/*$block                 -&gt;setTitle($this-&gt;getRequest()-&gt;getParam('title'))                 -&gt;setContent($this-&gt;getRequest()-&gt;getParam('content'))                 -&gt;setBlockStatus($this-&gt;getRequest()-&gt;getParam('block_status'))                 -&gt;save();*\/ #\u043d\u0438\u0436\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0439             $data = $this-&gt;getRequest()-&gt;getParams();             if (isset($data['rule']['conditions'])) {                 $data['conditions'] = $data['rule']['conditions'];             }             unset($data['rule']); #\u0432\u043c\u0435\u0441\u0442\u043e setData \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c loadPost             $block                 -&gt;loadPost($data);             $this-&gt;_uploadFile('image',$block);             $block                 -&gt;setCreatedAt(Mage::app()-&gt;getLocale()-&gt;date())                 -&gt;save();              if(!$block-&gt;getId()) {                 Mage::getSingleton('adminhtml\/session')-&gt;addError('Cannot save the block');             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             Mage::getSingleton('adminhtml\/session')-&gt;setBlockObject($block-&gt;getData());             return  $this-&gt;_redirect('*\/*\/edit',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id')));         }          Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was saved successfully!');          $this-&gt;_redirect('*\/*\/'.$this-&gt;getRequest()-&gt;getParam('back','index'),array('block_id'=&gt;$block-&gt;getId()));     }      public function deleteAction()     {         $block = Mage::getModel('siteblocks\/block')             -&gt;setId($this-&gt;getRequest()-&gt;getParam('block_id'))             -&gt;delete();         if($block-&gt;getId()) {             Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was deleted successfully!');         }         $this-&gt;_redirect('*\/*\/');      }      public function massStatusAction()     {         $statuses = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$statuses['massaction']));             foreach($blocks as $block) {                 $block-&gt;setBlockStatus($statuses['block_status'])-&gt;save();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were updated!');          return $this-&gt;_redirect('*\/*\/');      }      public function massDeleteAction()     {         $blocks = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$blocks['massaction']));             foreach($blocks as $block) {                 $block-&gt;delete();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were deleted!');          return $this-&gt;_redirect('*\/*\/');      } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  4. \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u0430\u043a\u0435\u0442 admin<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/design\/adminhtml\/default\/default\/layout\/siteblocks.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;layout version=&quot;1.0.0&quot;&gt;     &lt;adminhtml_siteblocks_edit&gt;         &lt;update handle=&quot;editor&quot;\/&gt; &lt;!-- \u0427\u0442\u043e \u0431\u044b \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u043b\u0438\u0441\u044c \u043d\u0443\u0436\u043d\u044b\u0435 js \u0440\u0435\u0441\u0443\u0440\u0441\u044b --&gt;         &lt;reference name=&quot;head&quot;&gt;             &lt;action method=&quot;setCanLoadExtJs&quot;&gt;&lt;flag&gt;1&lt;\/flag&gt;&lt;\/action&gt;             &lt;action method=&quot;setCanLoadRulesJs&quot;&gt;&lt;flag&gt;1&lt;\/flag&gt;&lt;\/action&gt;         &lt;\/reference&gt;     &lt;\/adminhtml_siteblocks_edit&gt;      &lt;adminhtml_system_config_edit&gt;         &lt;update handle=&quot;editor&quot;\/&gt;     &lt;\/adminhtml_system_config_edit&gt;  &lt;\/layout&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  5. \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b admin \u0444\u043e\u0440\u043c\u044b, \u0433\u0434\u0435 \u043c\u044b \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440 \u0443\u0441\u043b\u043e\u0432\u0438\u0439.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Form.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {      \/**      * Init form      *\/     public function __construct()     {         parent::__construct();         $this-&gt;setId('block_form');         $this-&gt;setTitle(Mage::helper('siteblocks')-&gt;__('Block Information'));     }      protected function _prepareForm()     {         $model = Mage::registry('siteblocks_block');         $form = new Varien_Data_Form(             array(                 'id' =&gt; 'edit_form',                 'action' =&gt; $this-&gt;getUrl('*\/*\/save',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id'))),                 'method' =&gt; 'post',                 'enctype' =&gt; 'multipart\/form-data'             )         );           $form-&gt;setHtmlIdPrefix('block_');          $fieldset = $form-&gt;addFieldset('base_fieldset',             array(                 'legend'=&gt;Mage::helper('siteblocks')-&gt;__('General Information'),                 'class' =&gt; 'fieldset-wide')         );          if ($model-&gt;getBlockId()) {             $fieldset-&gt;addField('block_id', 'hidden', array(                 'name' =&gt; 'block_id',             ));         }          $fieldset-&gt;addField('title', 'text', array(             'name'      =&gt; 'title',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'required'  =&gt; true,         ));          \/\/$fieldset-&gt;addType('myimage','IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Renderer_Myimage');          $fieldset-&gt;addField('image', 'myimage', array(             'name'      =&gt; 'image',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Image'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Image'),             'required'  =&gt; true,         ));            $fieldset-&gt;addField('block_status', 'select', array(             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'name'      =&gt; 'block_status',             'required'  =&gt; true,             'options'   =&gt; Mage::getModel('siteblocks\/source_status')-&gt;toArray(),         ));           $fieldset-&gt;addField('content', 'editor', array(             'name'      =&gt; 'content',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'style'     =&gt; 'height:36em',             'required'  =&gt; true,             'config'    =&gt; Mage::getSingleton('cms\/wysiwyg_config')-&gt;getConfig()          ));  #\u0432\u0441\u0435 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0439         $model-&gt;getConditions()-&gt;setJsFormObject('block_conditions_fieldset');          $renderer = Mage::getBlockSingleton('adminhtml\/widget_form_renderer_fieldset')             -&gt;setTemplate('promo\/fieldset.phtml')             -&gt;setNewChildUrl($this-&gt;getUrl('*\/promo_catalog\/newConditionHtml\/form\/block_conditions_fieldset'));          $conditionsFieldset = $form-&gt;addFieldset('conditions_fieldset',             array(                 'legend'=&gt;Mage::helper('siteblocks')-&gt;__('Conditions'),                 'class' =&gt; 'fieldset-wide')         )-&gt;setRenderer($renderer);         $conditionsFieldset-&gt;addField('conditions', 'text', array(             'name' =&gt; 'conditions',             'label' =&gt; Mage::helper('siteblocks')-&gt;__('Conditions'),             'title' =&gt; Mage::helper('siteblocks')-&gt;__('Conditions'),             'required' =&gt; true,         ))-&gt;setRule($model)-&gt;setRenderer(Mage::getBlockSingleton('rule\/conditions'));          $form-&gt;setValues($model-&gt;getData());         $form-&gt;setUseContainer(true);         $this-&gt;setForm($form);          return parent::_prepareForm();     }      protected function _prepareLayout()     {         parent::_prepareLayout();         if (Mage::getSingleton('cms\/wysiwyg_config')-&gt;isEnabled()) { #\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0435\u0442, \u0442\u043e\u0433\u0434\u0430 \u043f\u0438\u0448\u0435\u043c \u044d\u0442\u0438 2 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0443\u0442 $this-&gt;getLayout()-&gt;getBlock('head')-&gt;setCanLoadExtJs(true); $this-&gt;getLayout()-&gt;getBlock('head')-&gt;setCanLoadRulesJs(true);              $this-&gt;getLayout()-&gt;getBlock('head')-&gt;setCanLoadTinyMce(true);         }     } }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0443: $this-&gt;getUrl(&#8216;*\/promo_catalog\/newConditionHtml\/form\/block_conditions_fieldset&#8217;)<br \/>  \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Shopping Cart Price Rules \u0442\u043e \u043f\u0438\u0448\u0435\u043c:<br \/>  $this-&gt;getUrl(&#8216;*\/promo_quote\/newConditionHtml\/form\/block_conditions_fieldset&#8217;)<br \/>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0435\u0449\u0435 \u043d\u0430 \u043e\u0434\u0438\u043d \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442:<br \/>  <b>block_conditions_fieldset <\/b> \u2014 \u0433\u0434\u0435 <b>block_ <\/b>\u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 <b>$form-&gt;setHtmlIdPrefix(&#8216;block_&#8217;);<\/b><\/p>\n<p>  \u0418 \u044d\u0442\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f admin \u0447\u0430\u0441\u0442\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043d\u0430 frontend.<br \/>  \u0410 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0431\u043b\u043e\u043a List.php<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/List.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Block_List extends Mage_Core_Block_Template {      public function getBlocks()     {         \/\/return Mage::getResourceModel('siteblocks\/block_collection');         $items = Mage::getModel('siteblocks\/block')-&gt;getCollection()             -&gt;addFieldToFilter('block_status',array('eq'=&gt;IGN_Siteblocks_Model_Source_Status::ENABLED));         $filteredItems = $items; #\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0432\u044b\u0432\u043e\u0434 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0442\u043e\u0432\u0430\u0440\u0430.         if(Mage::registry('current_product') instanceof Mage_Catalog_Model_Product) {             $filteredItems = array();             \/** @var IGN_Siteblocks_Model_Block $item *\/             foreach ($items as $item) { #\u0432 \u043c\u0435\u0442\u043e\u0434 validate \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u0432\u0430\u0440                 if($item-&gt;validate(Mage::registry('current_product'))) {                     $filteredItems[] = $item;                 }             }         }         return $filteredItems;     }      public function getBlockContent($block)     {         $processor = Mage::helper('cms')-&gt;getBlockTemplateProcessor();         $html = $processor-&gt;filter($block-&gt;getContent());         return $html;     }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0435\u0441\u043b\u0438 \u0432\u044b\u0432\u043e\u0434 \u0431\u043b\u043e\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0442\u0432\u0430\u0440\u0430 \u0438 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0447\u0435\u0433\u043e.<br \/>  <a name=\"admin_tabs\"><\/a>  <\/p>\n<h5><b>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/9Ot6b8KiWBk?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/13\/IGN_Siteblocks-13.zip\">IGN_Siteblocks-13.zip<\/a><\/p>\n<p>  \u0412\u043a\u043b\u0430\u0434\u043a\u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0439. \u0412\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442\u0435 \u043f\u043e\u043b\u044f \u043f\u043e \u0433\u0440\u0443\u043f\u043f\u0430\u043c \u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u0441\u0432\u043e\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043a\u043b\u0430\u0434\u043e\u043a.<br \/>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432\u044b\u0432\u043e\u0434 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/>  \u0421\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Tabs.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {      public function __construct()     {         parent::__construct();         $this-&gt;setId('block_tabs');         $this-&gt;setDestElementId('edit_form');         $this-&gt;setTitle(Mage::helper('siteblocks')-&gt;__('Block Information'));     }  #\u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u043a\u043b\u0430\u0434\u043a\u0438. \u0435\u0449\u0435 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043c\u0430\u043a\u0435\u0442\u0435     protected function _prepareLayout()     {         $this-&gt;addTab('main_tab',array(             'label' =&gt; $this-&gt;__('Main'),             'title' =&gt; $this-&gt;__('Main'),             'content' =&gt; $this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit_tab_main')-&gt;toHtml()         ));         \/*$this-&gt;addTab('conditions_tab',array(             'label' =&gt; $this-&gt;__('Conditions'),             'title' =&gt; $this-&gt;__('Conditions'),             'content' =&gt; $this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit_tab_conditions')-&gt;toHtml()         ));*\/          $this-&gt;addTab('conditions_tab','siteblocks\/adminhtml_siteblocks_edit_tab_conditions');          return parent::_prepareLayout();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430 addTab \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u0435, \u0447\u0442\u043e \u043d\u0430 \u0432\u0445\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432, \u043e\u0431\u044a\u0435\u043a\u0442, \u0441\u0442\u0440\u043e\u043a\u0443. \u0418 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f. \u0422\u0443\u0442 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e, \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u0432\u0438\u0434\u0435\u043e, \u0433\u0434\u0435 \u044d\u0442\u043e \u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e. \u041d\u043e \u0438 \u0442\u0443\u0442 \u0437\u0430\u043c\u043e\u043b\u0432\u043b\u044e \u0441\u043b\u043e\u0432\u0435\u0447\u043a\u043e. <br \/>  \u0415\u0441\u043b\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u043c\u0435\u0442\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0443, \u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u0432\u043a\u043b\u0430\u0434\u043a\u0438 \u043e\u0431\u044f\u0437\u0430\u043d \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <b>Mage_Adminhtml_Block_Widget_Tab_Interface<\/b><br \/>  \u0418\u043d\u0430\u0447\u0435 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443. \u0410 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 4 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<br \/>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c 2 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0434\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043a\u043b\u0430\u0434\u043e\u043a.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430\u0448\u0438\u0445 \u0432\u043a\u043b\u0430\u0434\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 Form.php<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Tab\/Main.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form {      \/**      * Init form      *\/     public function __construct()     {         parent::__construct();         $this-&gt;setId('main_form');         $this-&gt;setTitle(Mage::helper('siteblocks')-&gt;__('Block Information'));     }      protected function _prepareForm()     {         $model = Mage::registry('siteblocks_block');         $form = new Varien_Data_Form();           $form-&gt;setHtmlIdPrefix('main_');          $fieldset = $form-&gt;addFieldset('base_fieldset',             array(                 'legend'=&gt;Mage::helper('siteblocks')-&gt;__('General Information'),                 'class' =&gt; 'fieldset-wide')         );          if ($model-&gt;getBlockId()) {             $fieldset-&gt;addField('block_id', 'hidden', array(                 'name' =&gt; 'block_id',             ));         }          $fieldset-&gt;addField('title', 'text', array(             'name'      =&gt; 'title',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Block Title'),             'required'  =&gt; true,         ));          \/\/$fieldset-&gt;addType('myimage','IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Renderer_Myimage');          $fieldset-&gt;addField('image', 'myimage', array(             'name'      =&gt; 'image',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Image'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Image'),             'required'  =&gt; true,         ));            $fieldset-&gt;addField('block_status', 'select', array(             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Status'),             'name'      =&gt; 'block_status',             'required'  =&gt; true,             'options'   =&gt; Mage::getModel('siteblocks\/source_status')-&gt;toArray(),         ));           $fieldset-&gt;addField('content', 'editor', array(             'name'      =&gt; 'content',             'label'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'title'     =&gt; Mage::helper('siteblocks')-&gt;__('Content'),             'style'     =&gt; 'height:36em',             'required'  =&gt; true,             'config'    =&gt; Mage::getSingleton('cms\/wysiwyg_config')-&gt;getConfig()          ));           $form-&gt;setValues($model-&gt;getData());         $this-&gt;setForm($form);          return parent::_prepareForm();     }      protected function _prepareLayout()     {         parent::_prepareLayout();         if (Mage::getSingleton('cms\/wysiwyg_config')-&gt;isEnabled()) {             $this-&gt;getLayout()-&gt;getBlock('head')-&gt;setCanLoadTinyMce(true);         }     } }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Tab\/Conditions.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Tab_Conditions extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface {  #\u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441     public function getTabTitle()     {         return $this-&gt;__('Conditions');     }      public function getTabLabel()     {         return $this-&gt;__('Conditions');     }      public function canShowTab()     {         return true;     }      public function isHidden()     {         return false;     }      \/**      * Init form      *\/     public function __construct()     {         parent::__construct();         $this-&gt;setId('conditions_form');         $this-&gt;setTitle(Mage::helper('siteblocks')-&gt;__('Block Conditions'));     }      protected function _prepareForm()     {         $model = Mage::registry('siteblocks_block');         $form = new Varien_Data_Form();           $form-&gt;setHtmlIdPrefix('block_');           $model-&gt;getConditions()-&gt;setJsFormObject('block_conditions_fieldset');          $renderer = Mage::getBlockSingleton('adminhtml\/widget_form_renderer_fieldset')             -&gt;setTemplate('promo\/fieldset.phtml')             -&gt;setNewChildUrl($this-&gt;getUrl('*\/promo_catalog\/newConditionHtml\/form\/block_conditions_fieldset'));          $conditionsFieldset = $form-&gt;addFieldset('conditions_fieldset',             array(                 'legend'=&gt;Mage::helper('siteblocks')-&gt;__('Conditions'),                 'class' =&gt; 'fieldset-wide')         )-&gt;setRenderer($renderer);         $conditionsFieldset-&gt;addField('conditions', 'text', array(             'name' =&gt; 'conditions',             'label' =&gt; Mage::helper('siteblocks')-&gt;__('Conditions'),             'title' =&gt; Mage::helper('siteblocks')-&gt;__('Conditions'),             'required' =&gt; true,         ))-&gt;setRule($model)-&gt;setRenderer(Mage::getBlockSingleton('rule\/conditions'));          $form-&gt;setValues($model-&gt;getData());         $this-&gt;setForm($form);          return parent::_prepareForm();     }      protected function _prepareLayout()     {         parent::_prepareLayout();         if (Mage::getSingleton('cms\/wysiwyg_config')-&gt;isEnabled()) {             $this-&gt;getLayout()-&gt;getBlock('head')-&gt;setCanLoadTinyMce(true);         }     } }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Form.php. \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0444\u043e\u0440\u043c\u044b. \u0418 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0443\u0431\u0440\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <b>$form-&gt;setUseContainer(true);<\/b><br \/>  C\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u044f \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0444\u043e\u0440\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Form.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {      \/**      * Init form      *\/     public function __construct()     {         parent::__construct();         $this-&gt;setId('block_form');         $this-&gt;setTitle(Mage::helper('siteblocks')-&gt;__('Block Information'));     }      protected function _prepareForm()     {         $model = Mage::registry('siteblocks_block');         $form = new Varien_Data_Form(             array(                 'id' =&gt; 'edit_form',                 'action' =&gt; $this-&gt;getUrl('*\/*\/save',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id'))),                 'method' =&gt; 'post',                 'enctype' =&gt; 'multipart\/form-data'             )         );           $form-&gt;setHtmlIdPrefix('block_');           $form-&gt;setValues($model-&gt;getData());         $form-&gt;setUseContainer(true);         $this-&gt;setForm($form);          return parent::_prepareForm();     }      protected function _prepareLayout()     {         parent::_prepareLayout();         if (Mage::getSingleton('cms\/wysiwyg_config')-&gt;isEnabled()) {             $this-&gt;getLayout()-&gt;getBlock('head')-&gt;setCanLoadTinyMce(true);         }     } }  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u0431\u043b\u043e\u043a\u0430 \u0432\u043a\u043b\u0430\u0434\u043e\u043a.<br \/>  \u0421\u043f\u043e\u0441\u043e\u0431 \u21161 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/Adminhtml\/SiteblocksController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Adminhtml_SiteblocksController extends Mage_Adminhtml_Controller_Action {      public function indexAction()     {         $this-&gt;loadLayout();         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks'));         $this-&gt;renderLayout();     }      public function newAction()     {         $this-&gt;_forward('edit');     }      public function editAction()     {         $id = $this-&gt;getRequest()-&gt;getParam('block_id');         Mage::register('siteblocks_block',Mage::getModel('siteblocks\/block')-&gt;load($id));         $blockObject = (array)Mage::getSingleton('adminhtml\/session')-&gt;getBlockObject(true);         if(count($blockObject)) {             Mage::registry('siteblocks_block')-&gt;setData($blockObject);         }         $this-&gt;loadLayout(); #\u0432\u044b\u0432\u043e\u0434 \u0431\u043b\u043e\u043a\u0430 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435         $this-&gt;_addLeft($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit_tabs'));         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit'));         $this-&gt;renderLayout();     }      protected function _uploadFile($fieldName,$model)     {          if( ! isset($_FILES[$fieldName])) {             return false;         }         $file = $_FILES[$fieldName];          if(isset($file['name']) && (file_exists($file['tmp_name']))){             if($model-&gt;getId()){                 unlink(Mage::getBaseDir('media').DS.$model-&gt;getData($fieldName));             }             try             {                 $path = Mage::getBaseDir('media') . DS . 'siteblocks' . DS;                 $uploader = new Varien_File_Uploader($file);                 $uploader-&gt;setAllowedExtensions(array('jpg','png','gif','jpeg'));                 $uploader-&gt;setAllowRenameFiles(true);                 $uploader-&gt;setFilesDispersion(false);                  $uploader-&gt;save($path, $file['name']);                 $model-&gt;setData($fieldName,$uploader-&gt;getUploadedFileName());                 return true;             }             catch(Exception $e)             {                 return false;             }         }     }      public function saveAction()     {         try {             $id = $this-&gt;getRequest()-&gt;getParam('block_id');             \/** @var IGN_Siteblocks_Model_Block $block *\/             $block = Mage::getModel('siteblocks\/block')-&gt;load($id);             \/*$block                 -&gt;setTitle($this-&gt;getRequest()-&gt;getParam('title'))                 -&gt;setContent($this-&gt;getRequest()-&gt;getParam('content'))                 -&gt;setBlockStatus($this-&gt;getRequest()-&gt;getParam('block_status'))                 -&gt;save();*\/             $data = $this-&gt;getRequest()-&gt;getParams();             if (isset($data['rule']['conditions'])) {                 $data['conditions'] = $data['rule']['conditions'];             }             unset($data['rule']);             $block                 -&gt;loadPost($data);             $this-&gt;_uploadFile('image',$block);             $block                 -&gt;setCreatedAt(Mage::app()-&gt;getLocale()-&gt;date())                 -&gt;save();              if(!$block-&gt;getId()) {                 Mage::getSingleton('adminhtml\/session')-&gt;addError('Cannot save the block');             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             Mage::getSingleton('adminhtml\/session')-&gt;setBlockObject($block-&gt;getData());             return  $this-&gt;_redirect('*\/*\/edit',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id')));         }          Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was saved successfully!');          $this-&gt;_redirect('*\/*\/'.$this-&gt;getRequest()-&gt;getParam('back','index'),array('block_id'=&gt;$block-&gt;getId()));     }      public function deleteAction()     {         $block = Mage::getModel('siteblocks\/block')             -&gt;setId($this-&gt;getRequest()-&gt;getParam('block_id'))             -&gt;delete();         if($block-&gt;getId()) {             Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was deleted successfully!');         }         $this-&gt;_redirect('*\/*\/');      }      public function massStatusAction()     {         $statuses = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$statuses['massaction']));             foreach($blocks as $block) {                 $block-&gt;setBlockStatus($statuses['block_status'])-&gt;save();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were updated!');          return $this-&gt;_redirect('*\/*\/');      }      public function massDeleteAction()     {         $blocks = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$blocks['massaction']));             foreach($blocks as $block) {                 $block-&gt;delete();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were deleted!');          return $this-&gt;_redirect('*\/*\/');      } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u043e \u043c\u044b \u043e\u0442\u043a\u0430\u0436\u0435\u043c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0439 \u0437\u0430\u0442\u0435\u0438 \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u21162 \u0432 \u043c\u0430\u043a\u0435\u0442\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/adminhtml\/default\/default\/layout\/siteblocks.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;layout version=&quot;1.0.0&quot;&gt;     &lt;adminhtml_siteblocks_edit&gt;         &lt;update handle=&quot;editor&quot;\/&gt;         &lt;reference name=&quot;head&quot;&gt;             &lt;action method=&quot;setCanLoadExtJs&quot;&gt;&lt;flag&gt;1&lt;\/flag&gt;&lt;\/action&gt;             &lt;action method=&quot;setCanLoadRulesJs&quot;&gt;&lt;flag&gt;1&lt;\/flag&gt;&lt;\/action&gt;         &lt;\/reference&gt; &lt;!-- \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0431\u043b\u043e\u043a \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f --&gt;         &lt;reference name=&quot;left&quot;&gt;             &lt;block type=&quot;siteblocks\/adminhtml_siteblocks_edit_tabs&quot; name=&quot;siteblocks_tabs&quot;&gt; &lt;!-- 2 c\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u0432 \u043c\u0430\u043a\u0435\u0442\u0435 --&gt;                 &lt;block name=&quot;conditions_tab&quot; type=&quot;siteblocks\/adminhtml_siteblocks_edit_tab_conditions&quot;\/&gt;                 &lt;action method=&quot;addTab&quot;&gt;&lt;name&gt;my_conditions&lt;\/name&gt;&lt;block&gt;conditions_tab&lt;\/block&gt;&lt;\/action&gt;                  &lt;action method=&quot;addTab&quot;&gt;&lt;name&gt;my_conditions&lt;\/name&gt;&lt;block&gt;siteblocks\/adminhtml_siteblocks_edit_tab_conditions&lt;\/block&gt;&lt;\/action&gt;             &lt;\/block&gt;         &lt;\/reference&gt;     &lt;\/adminhtml_siteblocks_edit&gt;      &lt;adminhtml_system_config_edit&gt;         &lt;update handle=&quot;editor&quot;\/&gt;     &lt;\/adminhtml_system_config_edit&gt;  &lt;\/layout&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u043e\u0434\u0438\u043d \u0441\u043e\u0432\u0435\u0442: \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u043a\u043b\u0430\u0434\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432 2\u0445 \u043c\u0435\u0441\u0442\u0430\u0445. \u041e\u0434\u043d\u0443 \u0432 \u043c\u0430\u043a\u0435\u0442\u0435, \u0434\u0440\u0443\u0433\u0443\u044e \u0432 \u0431\u043b\u043e\u043a\u0435. \u0414\u0435\u043b\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438\u043b\u0438 \u0432\u0441\u0435 \u0432 \u043c\u0430\u043a\u0435\u0442\u0435 \u0438\u043b\u0438 \u0432\u0441\u0435 \u0432 \u0431\u043b\u043e\u043a\u0435.<br \/>  <a name=\"products_grid_tab\"><\/a>  <\/p>\n<h5><b>\u0412\u044b\u0432\u043e\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (grid) \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043d\u0430 frontend.<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043a\u043b\u0430\u0434\u043e\u043a \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/VOqVEQXGrvk?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u0443\u0440\u043e\u043a\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/igentu.com\/lessons\/magento\/14\/IGN_Siteblocks-14.zip\">IGN_Siteblocks-14.zip<\/a><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0438\u0447\u0443 \u2014 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0442\u043e\u0432\u0430\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0431\u043b\u043e\u043a\u043e\u043c.<br \/>  \u042d\u0442\u0430\u043a\u0430\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432. \u0412 \u0443\u043c\u0435 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043e\u043b\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u044e\u0437\u043a\u0435\u0439\u0441\u044b \u0432\u044b\u0432\u043e\u0434\u0430 \u0431\u043b\u043e\u043a\u0430 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0438 \u0442\u043e\u0432\u0430\u0440\u0430\u043c\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0432\u043a\u043b\u0430\u0434\u043a\u0443:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Tabs.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {      public function __construct()     {         parent::__construct();         $this-&gt;setId('block_tabs');         $this-&gt;setDestElementId('edit_form');         $this-&gt;setTitle(Mage::helper('siteblocks')-&gt;__('Block Information'));     }      protected function _prepareLayout()     {         $this-&gt;addTab('main_tab',array(             'label' =&gt; $this-&gt;__('Main'),             'title' =&gt; $this-&gt;__('Main'),             'content' =&gt; $this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit_tab_main')-&gt;toHtml()         ));          $this-&gt;addTab('conditions_tab',array(             'label' =&gt; $this-&gt;__('Conditions'),             'title' =&gt; $this-&gt;__('Conditions'),             'content' =&gt; $this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit_tab_conditions')-&gt;toHtml()         )); \/\/\u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u0441 \u0442\u043e\u0432\u0430\u0440\u0430\u043c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c AJAX, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435         $this-&gt;addTab('products_tab','siteblocks\/adminhtml_siteblocks_edit_tab_products');          return parent::_prepareLayout();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u043a\u043b\u0430\u0434\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 AJAX. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043a\u043e\u0434\u0435. \u0422\u0430\u043c \u0436\u0435 \u0438 \u0443\u043a\u0430\u0437\u0430\u043d URL \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Tab\/Products.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Tab_Products extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface {      public function getTabTitle()     {         return $this-&gt;__('Products');     }      public function getTabLabel()     {         return $this-&gt;__('Products');     }      public function canShowTab()     {         return true;     }      public function isHidden()     {         return false;     }      public function getClass()     {         return 'ajax';     }      public function getTabClass()     {         return 'ajax';     }  #URL \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, ('_current'=&gt;true) \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0432 \u0443\u0440\u043b \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 block_id \u0442\u0430\u043c \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442     public function getTabUrl()     {         return $this-&gt;getUrl('*\/*\/products',array('_current'=&gt;true));     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422.\u043a. \u0432\u043a\u043b\u0430\u0434\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 AJAX, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043a\u0448\u0435\u043d\u044b \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440.<br \/>  \u0418, \u0437\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434, \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u0430\u043a\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 saveAction, \u0447\u0442\u043e \u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u0438\u0441\u044c \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0442\u043e\u0432\u0430\u0440\u044b.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/controllers\/Adminhtml\/SiteblocksController.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Adminhtml_SiteblocksController extends Mage_Adminhtml_Controller_Action {      public function indexAction()     {         $this-&gt;loadLayout();         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks'));         $this-&gt;renderLayout();     }      public function newAction()     {         $this-&gt;_forward('edit');     }      public function editAction()     {         $id = $this-&gt;getRequest()-&gt;getParam('block_id');         Mage::register('siteblocks_block',Mage::getModel('siteblocks\/block')-&gt;load($id));         $blockObject = (array)Mage::getSingleton('adminhtml\/session')-&gt;getBlockObject(true);         if(count($blockObject)) {             Mage::registry('siteblocks_block')-&gt;setData($blockObject);         }         $this-&gt;loadLayout();         \/\/$this-&gt;_addLeft($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit_tabs'));         $this-&gt;_addContent($this-&gt;getLayout()-&gt;createBlock('siteblocks\/adminhtml_siteblocks_edit'));         $this-&gt;renderLayout();     }      protected function _uploadFile($fieldName,$model)     {          if( ! isset($_FILES[$fieldName])) {             return false;         }         $file = $_FILES[$fieldName];          if(isset($file['name']) && (file_exists($file['tmp_name']))){             if($model-&gt;getId()){                 unlink(Mage::getBaseDir('media').DS.$model-&gt;getData($fieldName));             }             try             {                 $path = Mage::getBaseDir('media') . DS . 'siteblocks' . DS;                 $uploader = new Varien_File_Uploader($file);                 $uploader-&gt;setAllowedExtensions(array('jpg','png','gif','jpeg'));                 $uploader-&gt;setAllowRenameFiles(true);                 $uploader-&gt;setFilesDispersion(false);                  $uploader-&gt;save($path, $file['name']);                 $model-&gt;setData($fieldName,$uploader-&gt;getUploadedFileName());                 return true;             }             catch(Exception $e)             {                 return false;             }         }     }      public function saveAction()     {         try {             $id = $this-&gt;getRequest()-&gt;getParam('block_id');             \/** @var IGN_Siteblocks_Model_Block $block *\/             $block = Mage::getModel('siteblocks\/block')-&gt;load($id);             \/*$block                 -&gt;setTitle($this-&gt;getRequest()-&gt;getParam('title'))                 -&gt;setContent($this-&gt;getRequest()-&gt;getParam('content'))                 -&gt;setBlockStatus($this-&gt;getRequest()-&gt;getParam('block_status'))                 -&gt;save();*\/             $data = $this-&gt;getRequest()-&gt;getParams();  #\u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u0447\u0435\u043a\u0431\u043e\u043a\u0430\u043c\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432             $links = $this-&gt;getRequest()-&gt;getPost('links', array());             if (array_key_exists('products', $links)) {                 $selectedProducts = Mage::helper('adminhtml\/js')-&gt;decodeGridSerializedInput($links['products']);                 $products = array();                 foreach($selectedProducts as $product =&gt; $position) {                     $products[$product] = isset($position['position']) ? $position['position'] : $product;                 }                 $data['products'] = $products;             }              if (isset($data['rule']['conditions'])) {                 $data['conditions'] = $data['rule']['conditions'];             }             unset($data['rule']);             $block                 -&gt;loadPost($data);             $this-&gt;_uploadFile('image',$block);             $block                 -&gt;setCreatedAt(Mage::app()-&gt;getLocale()-&gt;date())                 -&gt;save();              if(!$block-&gt;getId()) {                 Mage::getSingleton('adminhtml\/session')-&gt;addError('Cannot save the block');             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             Mage::getSingleton('adminhtml\/session')-&gt;setBlockObject($block-&gt;getData());             return  $this-&gt;_redirect('*\/*\/edit',array('block_id'=&gt;$this-&gt;getRequest()-&gt;getParam('block_id')));         }          Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was saved successfully!');          $this-&gt;_redirect('*\/*\/'.$this-&gt;getRequest()-&gt;getParam('back','index'),array('block_id'=&gt;$block-&gt;getId()));     }      public function deleteAction()     {         $block = Mage::getModel('siteblocks\/block')             -&gt;setId($this-&gt;getRequest()-&gt;getParam('block_id'))             -&gt;delete();         if($block-&gt;getId()) {             Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Block was deleted successfully!');         }         $this-&gt;_redirect('*\/*\/');      }      public function massStatusAction()     {         $statuses = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$statuses['massaction']));             foreach($blocks as $block) {                 $block-&gt;setBlockStatus($statuses['block_status'])-&gt;save();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were updated!');          return $this-&gt;_redirect('*\/*\/');      }      public function massDeleteAction()     {         $blocks = $this-&gt;getRequest()-&gt;getParams();         try {             $blocks= Mage::getModel('siteblocks\/block')                 -&gt;getCollection()                 -&gt;addFieldToFilter('block_id',array('in'=&gt;$blocks['massaction']));             foreach($blocks as $block) {                 $block-&gt;delete();             }         } catch(Exception $e) {             Mage::logException($e);             Mage::getSingleton('adminhtml\/session')-&gt;addError($e-&gt;getMessage());             return $this-&gt;_redirect('*\/*\/');         }         Mage::getSingleton('adminhtml\/session')-&gt;addSuccess('Blocks were deleted!');          return $this-&gt;_redirect('*\/*\/');      }  #2 \u043d\u0430\u0448\u0438\u0445 \u043d\u043e\u0432\u044b\u0445 \u044d\u043a\u0448\u0435\u043d\u0430 \u0434\u043b\u044f AJAX \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432     public function productsAction()     {         $this-&gt;loadLayout()             -&gt;renderLayout();     }      public function productsgridAction()     {         $this-&gt;loadLayout()             -&gt;renderLayout();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418\u0437 \u043a\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u0430\u043a\u0435\u0442.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/adminhtml\/default\/default\/layout\/adminhtml.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;layout version=&quot;1.0.0&quot;&gt;     &lt;adminhtml_siteblocks_edit&gt;         &lt;update handle=&quot;editor&quot;\/&gt;         &lt;reference name=&quot;head&quot;&gt;             &lt;action method=&quot;setCanLoadExtJs&quot;&gt;&lt;flag&gt;1&lt;\/flag&gt;&lt;\/action&gt;             &lt;action method=&quot;setCanLoadRulesJs&quot;&gt;&lt;flag&gt;1&lt;\/flag&gt;&lt;\/action&gt;         &lt;\/reference&gt;         &lt;reference name=&quot;left&quot;&gt;             &lt;block type=&quot;siteblocks\/adminhtml_siteblocks_edit_tabs&quot; name=&quot;siteblocks_tabs&quot;&gt;                &lt;!-- &lt;block name=&quot;conditions_tab&quot; type=&quot;siteblocks\/adminhtml_siteblocks_edit_tab_conditions&quot;\/&gt;                 &lt;action method=&quot;addTab&quot;&gt;&lt;name&gt;my_conditions&lt;\/name&gt;&lt;block&gt;conditions_tab&lt;\/block&gt;&lt;\/action&gt;--&gt;                 &lt;!--&lt;action method=&quot;addTab&quot;&gt;&lt;name&gt;my_conditions&lt;\/name&gt;&lt;block&gt;siteblocks\/adminhtml_siteblocks_edit_tab_conditions&lt;\/block&gt;&lt;\/action&gt;--&gt;             &lt;\/block&gt;         &lt;\/reference&gt;     &lt;\/adminhtml_siteblocks_edit&gt;      &lt;adminhtml_system_config_edit&gt;         &lt;update handle=&quot;editor&quot;\/&gt;     &lt;\/adminhtml_system_config_edit&gt;  &lt;!-- \u0422\u0443\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u0430 \u0432\u0441\u044f\u043a\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0443\u0436\u043d\u044b, \u0447\u0442\u043e \u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0442\u043e\u0432\u0430\u0440\u044b --&gt;     &lt;adminhtml_siteblocks_products&gt;         &lt;block type=&quot;core\/text_list&quot; name=&quot;root&quot; output=&quot;toHtml&quot;&gt;             &lt;block type=&quot;siteblocks\/adminhtml_siteblocks_edit_tab_products_grid&quot; name=&quot;siteblocks_products&quot;\/&gt;             &lt;block type=&quot;adminhtml\/widget_grid_serializer&quot; name=&quot;siteblocks_products_serializer&quot;&gt;                 &lt;reference name=&quot;siteblocks_products_serializer&quot;&gt;                     &lt;action method=&quot;initSerializerBlock&quot;&gt;                         &lt;grid_block_name&gt;siteblocks_products&lt;\/grid_block_name&gt;                         &lt;data_callback&gt;getSelectedBlockProducts&lt;\/data_callback&gt;                         &lt;hidden_input_name&gt;links[products]&lt;\/hidden_input_name&gt;                         &lt;reload_param_name&gt;siteblocks_products&lt;\/reload_param_name&gt;                     &lt;\/action&gt;                     &lt;action method=&quot;addColumnInputName&quot;&gt;                         &lt;input_name&gt;position&lt;\/input_name&gt;                     &lt;\/action&gt;                 &lt;\/reference&gt;             &lt;\/block&gt;         &lt;\/block&gt;     &lt;\/adminhtml_siteblocks_products&gt;  &lt;!-- \u0422\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0445\u0442\u043c\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u043e\u0432\u0430\u0440\u043e\u0432 --&gt;     &lt;adminhtml_siteblocks_productsgrid&gt;         &lt;block type=&quot;core\/text_list&quot; name=&quot;root&quot; output=&quot;toHtml&quot;&gt;             &lt;block type=&quot;siteblocks\/adminhtml_siteblocks_edit_tab_products_grid&quot; name=&quot;block_products&quot;\/&gt;         &lt;\/block&gt;     &lt;\/adminhtml_siteblocks_productsgrid&gt;  &lt;\/layout&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u043b\u043e\u043a\u043e\u0432. \u0414\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0439\u0442\u0435 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0432\u043e \u0432\u0441\u0435\u0445 \u043c\u0435\u0441\u0442\u0430\u0445.<\/p>\n<p>  \u0417\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0432 admin \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/Adminhtml\/Siteblocks\/Edit\/Tab\/Products\/Grid.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\"> &lt;?php class IGN_Siteblocks_Block_Adminhtml_Siteblocks_Edit_Tab_Products_Grid extends Mage_Adminhtml_Block_Widget_Grid {      protected $_block;     \/**      * Set grid params      *      *\/     public function __construct()     {         parent::__construct();         $this-&gt;setId('siteblocks_product_grid');         $this-&gt;setDefaultSort('entity_id');         $this-&gt;setUseAjax(true);         if ($this-&gt;_getBlock()-&gt;getId()) {             $this-&gt;setDefaultFilter(array('in_products'=&gt;1));         }         if ($this-&gt;isReadonly()) {             $this-&gt;setFilterVisibility(false);         }     }      protected function _getBlock()     {         if(!$this-&gt;_block) {             $this-&gt;_block = Mage::getModel('siteblocks\/block')-&gt;load($this-&gt;getRequest()-&gt;getParam('block_id'));         }         return $this-&gt;_block;     }       protected function _addColumnFilterToCollection($column)     {         \/\/ Set custom filter for in product flag         if ($column-&gt;getId() == 'in_products') {             $productIds = $this-&gt;_getSelectedProducts();             if (empty($productIds)) {                 $productIds = 0;             }             if ($column-&gt;getFilter()-&gt;getValue()) {                 $this-&gt;getCollection()-&gt;addFieldToFilter('entity_id', array('in'=&gt;$productIds));             } else {                 if($productIds) {                     $this-&gt;getCollection()-&gt;addFieldToFilter('entity_id', array('nin'=&gt;$productIds));                 }             }         } else {             parent::_addColumnFilterToCollection($column);         }         return $this;     }      \/**      * Checks when this block is readonly      *      * @return boolean      *\/     public function isReadonly()     {         return $this-&gt;_getBlock()-&gt;getUpsellReadonly();     }      protected function _prepareCollection()     { #\u0442\u0443\u0442 \u043c\u043e\u0436\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b         $collection = Mage::getResourceModel('catalog\/product_collection')             -&gt;addAttributeToSelect('*');          if ($this-&gt;isReadonly()) {             $productIds = $this-&gt;_getSelectedProducts();             if (empty($productIds)) {                 $productIds = array(0);             }             $collection-&gt;addFieldToFilter('entity_id', array('in'=&gt;$productIds));         }          $this-&gt;setCollection($collection);         return parent::_prepareCollection();     }      \/**      * Add columns to grid      *      * @return Mage_Adminhtml_Block_Widget_Grid      *\/     protected function _prepareColumns()     { #\u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0432 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435         if (!$this-&gt;_getBlock()-&gt;getUpsellReadonly()) {             $this-&gt;addColumn('in_products', array(                 'header_css_class' =&gt; 'a-center',                 'type'      =&gt; 'checkbox',                 'name'      =&gt; 'in_products',                 'values'    =&gt; $this-&gt;_getSelectedProducts(),                 'align'     =&gt; 'center',                 'index'     =&gt; 'entity_id'             ));         }          $this-&gt;addColumn('entity_id', array(             'header'    =&gt; Mage::helper('catalog')-&gt;__('ID'),             'sortable'  =&gt; true,             'width'     =&gt; 60,             'index'     =&gt; 'entity_id'         ));         $this-&gt;addColumn('name', array(             'header'    =&gt; Mage::helper('catalog')-&gt;__('Name'),             'index'     =&gt; 'name'         ));          $this-&gt;addColumn('type', array(             'header'    =&gt; Mage::helper('catalog')-&gt;__('Type'),             'width'     =&gt; 100,             'index'     =&gt; 'type_id',             'type'      =&gt; 'options',             'options'   =&gt; Mage::getSingleton('catalog\/product_type')-&gt;getOptionArray(),         ));          $sets = Mage::getResourceModel('eav\/entity_attribute_set_collection')             -&gt;setEntityTypeFilter(Mage::getModel('catalog\/product')-&gt;getResource()-&gt;getTypeId())             -&gt;load()             -&gt;toOptionHash();          $this-&gt;addColumn('set_name', array(             'header'    =&gt; Mage::helper('catalog')-&gt;__('Attrib. Set Name'),             'width'     =&gt; 130,             'index'     =&gt; 'attribute_set_id',             'type'      =&gt; 'options',             'options'   =&gt; $sets,         ));          $this-&gt;addColumn('status', array(             'header'    =&gt; Mage::helper('catalog')-&gt;__('Status'),             'width'     =&gt; 90,             'index'     =&gt; 'status',             'type'      =&gt; 'options',             'options'   =&gt; Mage::getSingleton('catalog\/product_status')-&gt;getOptionArray(),         ));          $this-&gt;addColumn('visibility', array(             'header'    =&gt; Mage::helper('catalog')-&gt;__('Visibility'),             'width'     =&gt; 90,             'index'     =&gt; 'visibility',             'type'      =&gt; 'options',             'options'   =&gt; Mage::getSingleton('catalog\/product_visibility')-&gt;getOptionArray(),         ));          $this-&gt;addColumn('sku', array(             'header'    =&gt; Mage::helper('catalog')-&gt;__('SKU'),             'width'     =&gt; 80,             'index'     =&gt; 'sku'         ));          $this-&gt;addColumn('price', array(             'header'        =&gt; Mage::helper('catalog')-&gt;__('Price'),             'type'          =&gt; 'currency',             'currency_code' =&gt; (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),             'index'         =&gt; 'price'         ));          $this-&gt;addColumn('position', array(             'header'            =&gt; Mage::helper('catalog')-&gt;__('Position'),             'name'              =&gt; 'position',             'type'              =&gt; 'number',             'width'             =&gt; 60,             'validate_class'    =&gt; 'validate-number',             'index'             =&gt; 'position',             'editable'          =&gt; true         ));          return parent::_prepareColumns();     }  #\u044d\u0442\u043e\u0442 URL \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438     public function getGridUrl()     {         return $this-&gt;_getData('grid_url') ? $this-&gt;_getData('grid_url') : $this-&gt;getUrl('*\/*\/productsgrid', array('_current'=&gt;true));     }      protected function _getSelectedProducts()     {        return array_keys($this-&gt;getSelectedBlockProducts());     }      public function getSelectedBlockProducts()     {         $selected = $this-&gt;getRequest()-&gt;getParam('siteblocks_products');          $products = array();         foreach ($this-&gt;_getBlock()-&gt;getProducts() as $product =&gt; $position) {             $products[$product] = array('position' =&gt; $position);         }         foreach ($selected as $product) {             if(!isset($products[$product])) {                 $products[$product] = array('position'=&gt;$product);             }         }         return $products;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0427\u0442\u043e \u0431\u044b \u0443 \u043d\u0430\u0441 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u0438\u0441\u044c \u0442\u043e\u0432\u0430\u0440\u044b, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0430\u043f\u0433\u0440\u0435\u0439\u0434 \u0441\u043a\u0440\u0438\u043f\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/sql\/siteblocks_setup\/upgrade-1.0.2-1.0.3.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php \/** @var Mage_Core_Model_Resource_Setup $installer *\/ $installer = $this; $installer-&gt;startSetup(); $installer-&gt;run(&quot; ALTER TABLE `{$this-&gt;getTable('siteblocks\/block')}` ADD `products` TEXT NOT NULL; &quot;); $installer-&gt;endSetup(); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Model\/Block.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  \/**  * Class IGN_Siteblocks_Model_Block  * @method getBlockStatus()  * @method getContent()  * @method getImage()  *\/ class IGN_Siteblocks_Model_Block extends Mage_Rule_Model_Abstract {      protected $_eventPrefix = 'siteblocks_block';      public function getActionsInstance()     {         return Mage::getModel('catalogrule\/rule_action_collection');     }      public function getConditionsInstance()     {         return Mage::getModel('catalogrule\/rule_condition_combine');     }      public function _construct()     {         parent::_construct();         $this-&gt;_init('siteblocks\/block');      }      public function getImageSrc()     {         return Mage::getBaseUrl('media') . 'siteblocks' . DS . $this-&gt;getImage();     }  #\u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0443     protected function _beforeSave()     {         parent::_beforeSave();         if(is_array($this-&gt;getData('products'))) {             $this-&gt;setData('products',json_encode($this-&gt;getData('products')));         }     } #\u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432     protected function _afterLoad()     {         parent::_beforeSave();         if(!empty($this-&gt;getData('products'))) {             $this-&gt;setData('products',(array)json_decode($this-&gt;getData('products')));         }     }  #\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0440\u043d\u0435\u0442 \u043d\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u0441\u0435\u0433\u0434\u0430     public function getProducts()     {         if(!is_array($this-&gt;getData('products'))) {             $this-&gt;setData('products',(array)json_decode($this-&gt;getData('products')));         }         return $this-&gt;getData('products');     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u043e\u0432\u0430\u0440\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0445 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0430 frontend&#8217;e.<br \/>  \u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043d\u043e\u0432\u044b\u0439 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0437 upsell&#8217;\u043e\u0432 \u0438 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/frontend\/base\/default\/template\/siteblocks\/product\/list.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php if(count($this-&gt;getLoadedProductCollection()-&gt;getItems())): ?&gt;     &lt;div class=&quot;box-collateral box-up-sell&quot;&gt;         &lt;h2&gt;&lt;?php echo $this-&gt;__('You may also like') ?&gt;&lt;\/h2&gt;         &lt;ul class=&quot;products-grid products-grid--max-4-col&quot; id=&quot;upsell-product-table&quot;&gt;             &lt;?php foreach ($this-&gt;getLoadedProductCollection()-&gt;getItems() as $_link): ?&gt;                 &lt;li&gt;                     &lt;a href=&quot;&lt;?php echo $_link-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;escapeHtml($_link-&gt;getName()) ?&gt;&quot; class=&quot;product-image&quot;&gt;                         &lt;img src=&quot;&lt;?php echo $this-&gt;helper('catalog\/image')-&gt;init($_link, 'small_image')-&gt;resize(280) ?&gt;&quot; alt=&quot;&lt;?php echo $this-&gt;escapeHtml($_link-&gt;getName()) ?&gt;&quot; \/&gt;                     &lt;\/a&gt;                     &lt;h3 class=&quot;product-name&quot;&gt;&lt;a href=&quot;&lt;?php echo $_link-&gt;getProductUrl() ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;escapeHtml($_link-&gt;getName()) ?&gt;&quot;&gt;&lt;?php echo $this-&gt;escapeHtml($_link-&gt;getName()) ?&gt;&lt;\/a&gt;&lt;\/h3&gt;                     &lt;?php echo $this-&gt;getPriceHtml($_link, true, '-upsell') ?&gt;                 &lt;\/li&gt;             &lt;?php endforeach; ?&gt;         &lt;\/ul&gt;     &lt;\/div&gt; &lt;?php endif ?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u043c \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u0432\u044b\u0432\u043e\u0434\u0430 \u0431\u043b\u043e\u043a\u043e\u0432 list.phtml:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/frontend\/base\/default\/template\/siteblocks\/list.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php foreach($this-&gt;getBlocks() as $block):?&gt;     &lt;div class=&quot;siteblock&quot;&gt;         &lt;div class=&quot;block-title&quot;&gt;&lt;?php echo $block-&gt;getTitle()?&gt;&lt;\/div&gt;         &lt;div class=&quot;block-image&quot;&gt;             &lt;?php if($block-&gt;getImage()):?&gt;                 &lt;img src=&quot;&lt;?php echo $block-&gt;getImageSrc()?&gt;&quot; height=&quot;150&quot; width=&quot;auto&quot; alt=&quot;&lt;?php $block-&gt;getTitle()?&gt;&quot; title=&quot;&lt;?php $block-&gt;getTitle()?&gt;&quot;&gt;             &lt;?php endif;?&gt;         &lt;\/div&gt;         &lt;div class=&quot;block-content&quot;&gt;&lt;?php echo $this-&gt;getBlockContent($block)?&gt;&lt;\/div&gt;          &lt;div class=&quot;block-product-list&quot;&gt;             &lt;?php echo $this-&gt;getProductsList($block)?&gt;         &lt;\/div&gt;     &lt;\/div&gt; &lt;?php endforeach;?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0431\u043b\u043e\u043a\u0435 List.php:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/local\/IGN\/Siteblocks\/Block\/List.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Siteblocks_Block_List extends Mage_Core_Block_Template {      public function getBlocks()     {         \/\/return Mage::getResourceModel('siteblocks\/block_collection');         $items = Mage::getModel('siteblocks\/block')-&gt;getCollection()             -&gt;addFieldToFilter('block_status',array('eq'=&gt;IGN_Siteblocks_Model_Source_Status::ENABLED));         $filteredItems = $items;         if(Mage::registry('current_product') instanceof Mage_Catalog_Model_Product) {             $filteredItems = array();             \/** @var IGN_Siteblocks_Model_Block $item *\/             foreach ($items as $item) {                 if($item-&gt;validate(Mage::registry('current_product'))) {                     $filteredItems[] = $item;                 }             }         }         return $filteredItems;     }      public function getBlockContent($block)     {         $processor = Mage::helper('cms')-&gt;getBlockTemplateProcessor();         $html = $processor-&gt;filter($block-&gt;getContent());         return $html;     } \/\/\u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u043e\u0432\u0430\u0440\u043e\u0432     public function getProductsList($block)     {         $products = $block-&gt;getProducts();         asort($products);         $collection = Mage::getResourceModel('catalog\/product_collection')             -&gt;addFieldToFilter('entity_id',array('in'=&gt;array_keys($products)))             -&gt;addAttributeToSelect('*');         \/** @var Mage_Catalog_Block_Product_List $list *\/         $list = $this-&gt;getLayout()-&gt;createBlock('catalog\/product_list');         $list-&gt;setCollection($collection);         $list-&gt;setTemplate('siteblocks\/product\/list.phtml');         return $list-&gt;toHtml();     }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041c\u044b \u0431\u044b \u043c\u043e\u0433\u043b\u0438 \u0438 \u0441\u0432\u043e\u0439 \u0431\u043b\u043e\u043a \u0434\u043b\u044f \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0442\u044c, \u043d\u043e \u043f\u043e\u0434 \u043d\u0430\u0448\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0431\u043b\u043e\u043a\u0438 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0441\u0430\u0439\u0442\u0430. \u0412\u044b\u0432\u043e\u0434 \u0431\u043b\u043e\u043a\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0442\u043e\u0432\u0430\u0440\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 (Rule Conditions).<br \/>  \u0414\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0443 \u043d\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u0439 WYSIWYG \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440.<br \/>  \u0410 \u0442\u0430\u043a \u0436\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0431\u043b\u043e\u043a\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0432\u0430\u0440\u043e\u0432.<br \/>  \u041c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438 \u043f\u043e\u0434 \u0441\u0435\u0431\u044f.<br \/>  \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c: <a href=\"https:\/\/bitbucket.org\/dvman8bit\/ign_siteblocks\/\">bitbucket.org\/dvman8bit\/ign_siteblocks<\/a><br \/>  \u0418 \u044d\u0442\u043e\u0442 \u0433\u0430\u0439\u0434 \u043d\u0435 \u0431\u044b\u043b \u0431\u044b \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u043c, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u043f\u043b\u0430\u0442\u044b \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438.<\/p>\n<p>  <a name=\"payment_method\"><\/a>  <\/p>\n<h5><b>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u043f\u043b\u0430\u0442\u044b (Payment Method)<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043b\u044f Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/WMQ_LNfGODg?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: <a href=\"https:\/\/bitbucket.org\/dvman8bit\/ign_payment\">bitbucket.org\/dvman8bit\/ign_payment<\/a><\/p>\n<p>  \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0437\u0430\u043a\u0430\u0437, \u0432\u0432\u0435\u0434\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043e\u0434.<br \/>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u0432\u043e\u0434 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u043f\u043b\u0430\u0442\u044b \u0437\u0430\u043a\u0430\u0437\u0430. \u0422\u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u044c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443. \u041d\u0430\u0448\u0430 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u043f\u043e\u043d\u044f\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u044b \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u043f\u043b\u0430\u0442\u044b.<br \/>  \u0421\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u043b\u0430\u0442\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432: 2 \u0431\u043b\u043e\u043a\u0430, 2 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u0430, 2 xml \u0444\u0430\u0439\u043b\u0430 \u0438 1 \u043c\u043e\u0434\u0435\u043b\u044c.<br \/>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 system.xml, \u0432 \u043d\u0435\u043c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0435\u043a\u0446\u0438\u044e \u0432 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Payment Methods.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/community\/IGN\/Payment\/etc\/system.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;config&gt;    &lt;sections&gt;         &lt;payment&gt;             &lt;groups&gt;                 &lt;ignpayment translate=&quot;label&quot;&gt;                     &lt;label&gt;IGN Payment&lt;\/label&gt;                     &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                     &lt;sort_order&gt;30&lt;\/sort_order&gt;                     &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                     &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                     &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                     &lt;fields&gt;                         &lt;active translate=&quot;label&quot;&gt;                             &lt;label&gt;Enabled&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt;                             &lt;source_model&gt;adminhtml\/system_config_source_yesno&lt;\/source_model&gt;                             &lt;sort_order&gt;1&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/active&gt;                         &lt;order_status translate=&quot;label&quot;&gt;                             &lt;label&gt;New Order Status&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt;                             &lt;source_model&gt;adminhtml\/system_config_source_order_status_newprocessing&lt;\/source_model&gt;                             &lt;sort_order&gt;2&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/order_status&gt;                         &lt;payment_action translate=&quot;label&quot;&gt;                             &lt;label&gt;Automatically Invoice All Items&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt;                             &lt;source_model&gt;payment\/source_invoice&lt;\/source_model&gt;                             &lt;sort_order&gt;3&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                             &lt;depends&gt;                                 &lt;order_status separator=&quot;,&quot;&gt;processing,processed_ogone&lt;\/order_status&gt;                             &lt;\/depends&gt;                         &lt;\/payment_action&gt;                         &lt;sort_order translate=&quot;label&quot;&gt;                             &lt;label&gt;Sort Order&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;100&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                             &lt;frontend_class&gt;validate-number&lt;\/frontend_class&gt;                         &lt;\/sort_order&gt;                         &lt;title translate=&quot;label&quot;&gt;                             &lt;label&gt;Title&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;1&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                         &lt;\/title&gt;                         &lt;allowspecific translate=&quot;label&quot;&gt;                             &lt;label&gt;Payment from Applicable Countries&lt;\/label&gt;                             &lt;frontend_type&gt;allowspecific&lt;\/frontend_type&gt;                             &lt;sort_order&gt;50&lt;\/sort_order&gt;                             &lt;source_model&gt;adminhtml\/system_config_source_payment_allspecificcountries&lt;\/source_model&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/allowspecific&gt;                         &lt;specificcountry translate=&quot;label&quot;&gt;                             &lt;label&gt;Payment from Specific Countries&lt;\/label&gt;                             &lt;frontend_type&gt;multiselect&lt;\/frontend_type&gt;                             &lt;sort_order&gt;51&lt;\/sort_order&gt;                             &lt;source_model&gt;adminhtml\/system_config_source_country&lt;\/source_model&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                             &lt;can_be_empty&gt;1&lt;\/can_be_empty&gt;                         &lt;\/specificcountry&gt;                         &lt;min_order_total translate=&quot;label&quot;&gt;                             &lt;label&gt;Minimum Order Total&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;98&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/min_order_total&gt;                         &lt;max_order_total translate=&quot;label&quot;&gt;                             &lt;label&gt;Maximum Order Total&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;99&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/max_order_total&gt;                         &lt;secret_code translate=&quot;label&quot;&gt;                             &lt;label&gt;Secret Code&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;99&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/secret_code&gt;                     &lt;\/fields&gt;                 &lt;\/ignpayment&gt;             &lt;\/groups&gt;         &lt;\/payment&gt;     &lt;\/sections&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 system.xml \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b. \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e 1 \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u043a\u0443\u0434\u0430 \u043c\u044b \u0432\u0432\u0435\u0434\u0435\u043c \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043e\u0434.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/community\/IGN\/Payment\/etc\/config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;config&gt;     &lt;modules&gt;         &lt;IGN_Payment&gt;             &lt;version&gt;1.0.0&lt;\/version&gt;         &lt;\/IGN_Payment&gt;     &lt;\/modules&gt;     &lt;global&gt;         &lt;models&gt;             &lt;ignpayment&gt;                 &lt;class&gt;IGN_Payment_Model&lt;\/class&gt;             &lt;\/ignpayment&gt;         &lt;\/models&gt;         &lt;resources&gt;             &lt;payment_setup&gt;                 &lt;setup&gt;                     &lt;module&gt;IGN_Payment&lt;\/module&gt;                 &lt;\/setup&gt;             &lt;\/payment_setup&gt;         &lt;\/resources&gt;         &lt;blocks&gt;             &lt;ignpayment&gt;                 &lt;class&gt;IGN_Payment_Block&lt;\/class&gt;             &lt;\/ignpayment&gt;         &lt;\/blocks&gt;         &lt;helpers&gt;             &lt;ignpayment&gt;                 &lt;class&gt;IGN_Payment_Helper&lt;\/class&gt;             &lt;\/ignpayment&gt;         &lt;\/helpers&gt;     &lt;\/global&gt;     &lt;frontend&gt;         &lt;translate&gt;             &lt;modules&gt;                 &lt;IGN_Payment&gt;                     &lt;files&gt;                         &lt;default&gt;IGN_Payment.csv&lt;\/default&gt;                     &lt;\/files&gt;                 &lt;\/IGN_Payment&gt;             &lt;\/modules&gt;         &lt;\/translate&gt;     &lt;\/frontend&gt;     &lt;adminhtml&gt;         &lt;translate&gt;             &lt;modules&gt;                 &lt;IGN_Payment&gt;                     &lt;files&gt;                         &lt;default&gt;IGN_Payment.csv&lt;\/default&gt;                     &lt;\/files&gt;                 &lt;\/IGN_Payment&gt;             &lt;\/modules&gt;         &lt;\/translate&gt;     &lt;\/adminhtml&gt;     &lt;default&gt;         &lt;payment&gt;             &lt;ignpayment&gt;                 &lt;active&gt;1&lt;\/active&gt;                 &lt;model&gt;ignpayment\/method&lt;\/model&gt; &lt;!-- \u0421\u0430\u043c\u044b\u0439 \u0432\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 --&gt;                 &lt;order_status&gt;pending&lt;\/order_status&gt;                 &lt;title&gt;Secret Code&lt;\/title&gt;                 &lt;allowspecific&gt;0&lt;\/allowspecific&gt;                 &lt;sort_order&gt;1&lt;\/sort_order&gt;                 &lt;group&gt;offline&lt;\/group&gt;             &lt;\/ignpayment&gt;         &lt;\/payment&gt;     &lt;\/default&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u0430\u043c\u043e\u0439 \u0432\u0430\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438: \u043c\u043e\u0434\u0435\u043b\u0438 Method.php.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/community\/IGN\/Payment\/Model\/Method.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Payment_Model_Method extends Mage_Payment_Model_Method_Abstract {  \/\/\u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u0434 \u043c\u0435\u0442\u043e\u0434\u0430     protected $_code = 'ignpayment';  \/\/\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c block type     protected $_formBlockType = 'ignpayment\/form';     protected $_infoBlockType = 'ignpayment\/info';  \/\/\u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043b\u044e\u0431\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445 \u043d\u0430\u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u044b     public function validate()     {         $code = Mage::app()-&gt;getRequest()-&gt;getParam('secret_code');         if($code != $this-&gt;getConfigData('secret_code')) {             Mage::throwException(Mage::helper('ignpayment')-&gt;__(&quot;This code doesn't work!&quot;));         }         return parent::validate();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <b>Mage_Payment_Model_Method_Abstract <\/b><br \/>  \u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u044c \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u0442\u0430\u043c \u043a\u0443\u0447\u0443 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0441 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435\u0441\u0443\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u0447\u0442\u043e-\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u043d\u043e, \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432 \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0443\u044e\u0449\u0435\u0435 \u043d\u0443\u0436\u0434\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<br \/>  \u0417\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b:<br \/>  order(), capture(), void(), refund() \u0438 \u0442\u0434. \u0418 \u0435\u0441\u043b\u0438 \u043d\u0430\u0448 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u043b\u0436\u0435\u043d \u00ab\u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f\u00bb \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0442\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u0441\u0432\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043c\u0441\u044f \u043e \u0432\u044b\u0432\u043e\u0434\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0430 frontend \u0447\u0430\u0441\u0442\u0438.<br \/>  \u0418 \u0442\u0443\u0442 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c 2 \u043a\u043b\u0430\u0441\u0441\u0430.<br \/>  Form.php \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0432 \u0431\u043b\u043e\u043a\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043a\u0430\u0437\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/community\/IGN\/Payment\/Block\/Form.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  \/**  * Payment method form base block  *\/ class IGN_Payment_Block_Form extends Mage_Payment_Block_Form {     public function _construct()     {         parent::_construct(); \/\/\u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u043c\u044b \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043e\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430         $this-&gt;setTemplate('ignpayment\/form.phtml');     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u042d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0438\u043d\u0444\u043e \u0431\u043b\u043e\u043a\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0437\u0430\u043a\u0430\u0437\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/community\/IGN\/Payment\/Block\/Info.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Payment_Block_Info extends Mage_Payment_Block_Info {     protected function _construct()     {         parent::_construct();         $this-&gt;setTemplate('ignpayment\/info.phtml');     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u043b\u043e\u043a\u0430\u043c \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u044b:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/frontend\/base\/default\/template\/ignpayment\/form.phtml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;!-- \u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 id, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0435\u0444\u0444\u0438\u043a\u0441\u0430 payment_form_, \u0430 \u0441\u0430\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e-\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u043a\u0440\u044b\u0442 --&gt; &lt;div id=&quot;payment_form_ignpayment&quot; style=&quot;display: none&quot;&gt;     &lt;input type=&quot;text&quot; name=&quot;secret_code&quot; autocomplete=&quot;off&quot;&gt; &lt;!-- \u0422\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0444\u043e\u0440\u043c\u0430 \u0432\u0432\u043e\u0434\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u043e\u0432 --&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 info.phtml \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e, \u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/design\/frontend\/base\/default\/template\/ignpayment\/info.phtml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;p&gt;&lt;strong&gt;&lt;?php echo $this-&gt;escapeHtml($this-&gt;getMethod()-&gt;getTitle()) ?&gt;&lt;\/strong&gt;&lt;\/p&gt;  &lt;?php if ($_specificInfo = $this-&gt;getSpecificInformation()):?&gt; &lt;table&gt;     &lt;tbody&gt;     &lt;?php foreach ($_specificInfo as $_label =&gt; $_value):?&gt;         &lt;tr&gt;             &lt;th&gt;&lt;strong&gt;&lt;?php echo $this-&gt;escapeHtml($_label)?&gt;:&lt;\/strong&gt;&lt;\/th&gt;         &lt;\/tr&gt;         &lt;tr&gt;             &lt;td&gt;&lt;?php echo nl2br(implode($this-&gt;getValueAsArray($_value, true), &quot;\\n&quot;))?&gt;&lt;\/td&gt;         &lt;\/tr&gt;     &lt;?php endforeach; ?&gt;     &lt;\/tbody&gt; &lt;\/table&gt; &lt;?php endif;?&gt; &lt;?php echo $this-&gt;getChildHtml()?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u043e\u0442 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043f\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0412\u0430\u043c, \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u00ab\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u00bb \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0434\u0435\u0442\u0430\u043b\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u0410 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u043a\u0430\u043a \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0445\u0435\u043b\u043f\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0442\u0443\u0442 \u043e\u043f\u0443\u0441\u0442\u0438\u043b.<br \/>  <a name=\"shipping_method\"><\/a>  <\/p>\n<h5><b>\u041c\u043e\u0434\u0443\u043b\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 (Shipping Method)<\/b><\/h5>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0438\u0434\u0435\u043e: \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 (Shipping Method) \u0434\u043b\u044f Magento<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0px; width: 100%; height: 0px; position: relative; padding-bottom: 56.2493%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/SdL4IoClImg?rel=0&amp;showinfo=1\" frameborder=\"0\" allowfullscreen=\"true\" webkitallowfullscreen=\"true\" mozallowfullscreen=\"true\" style=\"top: 0px; left: 0px; width: 100%; height: 100%; position: absolute;\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439: <a href=\"https:\/\/bitbucket.org\/dvman8bit\/ign_shipment\">bitbucket.org\/dvman8bit\/ign_shipment<\/a><\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438.<br \/>  \u041d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0411\u0435\u043b\u043f\u043e\u0447\u0442\u043e\u0439. \u0422.\u043a. \u044f \u0441\u0430\u043c \u0438\u0437 \u0420\u0411 \u0438 \u043c\u043d\u0435 \u044d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e. \u0423 \u0411\u0435\u043b\u043f\u043e\u0447\u0442\u044b \u043d\u0435\u0442 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e API. \u0418 \u043d\u0435\u0442 \u043a\u0430\u043f\u0442\u0447\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0446\u0435\u043d\u0443.<\/p>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043c\u0438\u043d\u0438\u043c\u0443\u043c 3 \u0444\u0430\u0439\u043b\u0430.<br \/>  2 xml \u0438 \u043e\u0434\u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044c, \u043c\u044b \u0436\u0435 \u0435\u0449\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0445\u0435\u043b\u043f\u0435\u0440\u043e\u043c. \u0418\u0442\u043e\u0433\u043e 4.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/community\/IGN\/Shipment\/etc\/config.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;config&gt;     &lt;modules&gt;         &lt;IGN_Shipment&gt;             &lt;version&gt;1.0.0&lt;\/version&gt;         &lt;\/IGN_Shipment&gt;     &lt;\/modules&gt;     &lt;global&gt;         &lt;models&gt;             &lt;ignshipment&gt;                 &lt;class&gt;IGN_Shipment_Model&lt;\/class&gt;             &lt;\/ignshipment&gt;         &lt;\/models&gt;         &lt;helpers&gt;             &lt;ignshipment&gt;                 &lt;class&gt;IGN_Shipment_Helper&lt;\/class&gt;             &lt;\/ignshipment&gt;         &lt;\/helpers&gt;     &lt;\/global&gt;     &lt;adminhtml&gt;         &lt;translate&gt;             &lt;modules&gt;                 &lt;IGN_Shipment&gt;                     &lt;files&gt;                         &lt;default&gt;IGN_Shipment.csv&lt;\/default&gt;                     &lt;\/files&gt;                 &lt;\/IGN_Shipment&gt;             &lt;\/modules&gt;         &lt;\/translate&gt;     &lt;\/adminhtml&gt;     &lt;frontend&gt;         &lt;translate&gt;             &lt;modules&gt;                 &lt;IGN_Shipment&gt;                     &lt;files&gt;                         &lt;default&gt;IGN_Shipment.csv&lt;\/default&gt;                     &lt;\/files&gt;                 &lt;\/IGN_Shipment&gt;             &lt;\/modules&gt;         &lt;\/translate&gt;     &lt;\/frontend&gt;     &lt;default&gt;         &lt;carriers&gt;             &lt;ignshipment&gt;                 &lt;active&gt;1&lt;\/active&gt;                 &lt;sallowspecific&gt;0&lt;\/sallowspecific&gt;                 &lt;model&gt;ignshipment\/carrier&lt;\/model&gt; &lt;!-- \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c --&gt;                 &lt;name&gt;IGN Shipment&lt;\/name&gt;                 &lt;price&gt;5.00&lt;\/price&gt;                 &lt;title&gt;IGN Shipment&lt;\/title&gt;                 &lt;type&gt;I&lt;\/type&gt;                 &lt;specificerrmsg&gt;This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.&lt;\/specificerrmsg&gt;                 &lt;handling_type&gt;F&lt;\/handling_type&gt;                 &lt;packet_max_weight&gt;2000&lt;\/packet_max_weight&gt;             &lt;\/ignshipment&gt;         &lt;\/carriers&gt;     &lt;\/default&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/community\/IGN\/Shipment\/etc\/system.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;config&gt;     &lt;sections&gt;         &lt;carriers&gt;             &lt;groups&gt;                 &lt;ignshipment translate=&quot;label&quot;&gt;                     &lt;label&gt;IGN Shipping&lt;\/label&gt;                     &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                     &lt;sort_order&gt;2&lt;\/sort_order&gt;                     &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                     &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                     &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                     &lt;fields&gt;                         &lt;active translate=&quot;label&quot;&gt;                             &lt;label&gt;Enabled&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt;                             &lt;source_model&gt;adminhtml\/system_config_source_yesno&lt;\/source_model&gt;                             &lt;sort_order&gt;1&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/active&gt;                         &lt;name translate=&quot;label&quot;&gt;                             &lt;label&gt;Method Name&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;3&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                         &lt;\/name&gt;                         &lt;price translate=&quot;label&quot;&gt;                             &lt;label&gt;Price&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;validate&gt;validate-number validate-zero-or-greater&lt;\/validate&gt;                             &lt;sort_order&gt;5&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/price&gt;                         &lt;handling_type translate=&quot;label&quot;&gt;                             &lt;label&gt;Calculate Handling Fee&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt;                             &lt;source_model&gt;shipping\/source_handlingType&lt;\/source_model&gt;                             &lt;sort_order&gt;7&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/handling_type&gt;                         &lt;handling_fee translate=&quot;label&quot;&gt;                             &lt;label&gt;Handling Fee&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;validate&gt;validate-number validate-zero-or-greater&lt;\/validate&gt;                             &lt;sort_order&gt;8&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/handling_fee&gt;                         &lt;sort_order translate=&quot;label&quot;&gt;                             &lt;label&gt;Sort Order&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;100&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/sort_order&gt;                         &lt;title translate=&quot;label&quot;&gt;                             &lt;label&gt;Title&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;2&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                         &lt;\/title&gt;                         &lt;type translate=&quot;label&quot;&gt;                             &lt;label&gt;Type&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt;                             &lt;source_model&gt;adminhtml\/system_config_source_shipping_flatrate&lt;\/source_model&gt;                             &lt;sort_order&gt;4&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/type&gt;                         &lt;sallowspecific translate=&quot;label&quot;&gt;                             &lt;label&gt;Ship to Applicable Countries&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt;                             &lt;sort_order&gt;90&lt;\/sort_order&gt;                             &lt;frontend_class&gt;shipping-applicable-country&lt;\/frontend_class&gt;                             &lt;source_model&gt;adminhtml\/system_config_source_shipping_allspecificcountries&lt;\/source_model&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/sallowspecific&gt;                         &lt;specificcountry translate=&quot;label&quot;&gt;                             &lt;label&gt;Ship to Specific Countries&lt;\/label&gt;                             &lt;frontend_type&gt;multiselect&lt;\/frontend_type&gt;                             &lt;sort_order&gt;91&lt;\/sort_order&gt;                             &lt;source_model&gt;adminhtml\/system_config_source_country&lt;\/source_model&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                             &lt;can_be_empty&gt;1&lt;\/can_be_empty&gt;                         &lt;\/specificcountry&gt;                         &lt;showmethod translate=&quot;label&quot;&gt;                             &lt;label&gt;Show Method if Not Applicable&lt;\/label&gt;                             &lt;frontend_type&gt;select&lt;\/frontend_type&gt;                             &lt;sort_order&gt;92&lt;\/sort_order&gt;                             &lt;source_model&gt;adminhtml\/system_config_source_yesno&lt;\/source_model&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;0&lt;\/show_in_store&gt;                         &lt;\/showmethod&gt;                         &lt;specificerrmsg translate=&quot;label&quot;&gt;                             &lt;label&gt;Displayed Error Message&lt;\/label&gt;                             &lt;frontend_type&gt;textarea&lt;\/frontend_type&gt;                             &lt;sort_order&gt;80&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                         &lt;\/specificerrmsg&gt;                         &lt;packet_max_weight&gt;                             &lt;label&gt;Packet Max Weight&lt;\/label&gt;                             &lt;frontend_type&gt;text&lt;\/frontend_type&gt;                             &lt;sort_order&gt;80&lt;\/sort_order&gt;                             &lt;show_in_default&gt;1&lt;\/show_in_default&gt;                             &lt;show_in_website&gt;1&lt;\/show_in_website&gt;                             &lt;show_in_store&gt;1&lt;\/show_in_store&gt;                         &lt;\/packet_max_weight&gt;                     &lt;\/fields&gt;                 &lt;\/ignshipment&gt;             &lt;\/groups&gt;         &lt;\/carriers&gt;     &lt;\/sections&gt; &lt;\/config&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c Carrier.php<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/community\/IGN\/Shipment\/Model\/Carrier.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Shipment_Model_Carrier extends Mage_Shipping_Model_Carrier_Abstract implements Mage_Shipping_Model_Carrier_Interface {      protected $_code = 'ignshipment';      public function collectRates(Mage_Shipping_Model_Rate_Request $request)     {         \/** @var Mage_Shipping_Model_Rate_Result $result *\/         $result = Mage::getModel('shipping\/rate_result');          $weight = $request-&gt;getPackageWeight();          \/** @var Mage_Shipping_Model_Rate_Result_Method $method *\/         $method = Mage::getModel('shipping\/rate_result_method');          $method-&gt;setCarrier($this-&gt;_code);         $method-&gt;setCarrierTitle($this-&gt;getConfigData('title'));  \/\/\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u0432\u0435\u0441\u0430 \u0443\u0437\u043d\u0430\u0435\u043c \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438         if($weight &gt; $this-&gt;getConfigData('packet_max_weight')) {             $this-&gt;_getBoxMethod($weight,$method);         } else {             $this-&gt;_getPacketMethod($weight,$method);         }          $result-&gt;append($method);          return $result;     }      protected function _getPacketMethod($weight,$method)     {         $method-&gt;setMethod('packet');         $method-&gt;setMethodTitle('Packet belpost');         $sum = Mage::helper('ignshipment')-&gt;getPacketCost($weight);         $method-&gt;setPrice($sum\/19050);     }      protected function _getBoxMethod($weight,$method)     {         $method-&gt;setMethod('box');         $method-&gt;setMethodTitle('Box belpost');         $sum = Mage::helper('ignshipment')-&gt;getBoxCost($weight);         $method-&gt;setPrice($sum\/19050);     }  \/\/\u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f API     public function isTrackingAvailable()     {         return false;     }      public function getAllowedMethods()     { \/\/\u043f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u0443 \u043d\u0430\u0441 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438. \u041f\u0430\u043a\u0435\u0442 \u0434\u043e 2000 \u0433\u0440\u0430\u043c\u043c\u043e\u0432, \u0438 \u043f\u043e\u0441\u044b\u043b\u043a\u0430         return array(             'packet' =&gt; 'Packet belpost',             'box'  =&gt; 'Box belpost'         );     }  } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 <b>Mage_Shipping_Model_Carrier_Abstract <\/b>. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0438\u0442\u044c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e. \u0412 \u043d\u0430\u0448\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0435 \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0440\u043e\u0431\u043e\u043a, \u0447\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0441\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438. \u041d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u043a\u043e\u0440\u043e\u0431\u043a\u0443 \u043f\u043e \u0435\u0435 \u0432\u0435\u0441\u0443 \u0438 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c. \u041c\u044b \u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0442\u043e\u0432\u0430\u0440\u044b \u0443\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u0443 \u043e\u0431\u0449\u0443\u044e \u043a\u043e\u0440\u043e\u0431\u043a\u0443.<\/p>\n<p>  \u041b\u043e\u0433\u0438\u043a\u0443 \u00ab\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u00bb \u0441 \u0431\u0435\u043b\u043f\u043e\u0447\u0442\u043e\u0439 \u044f \u0432\u044b\u043d\u0435\u0441 \u0432 \u0445\u0435\u043b\u043f\u0435\u0440. \u0412 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0432\u0435\u0434\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f HTTP \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0440\u0430\u0441\u043f\u0430\u0440\u0448\u0438\u0432\u0430\u043d\u0438\u0435 \u0446\u0435\u043d\u044b, \u0438 \u043d\u0435\u0447\u0435\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">app\/code\/community\/IGN\/Shipment\/Helper\/Data.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php class IGN_Shipment_Helper_Data extends Mage_Core_Helper_Abstract {       public function getPacketCost($weight)     {         $request = new Zend_Http_Client();         $request-&gt;setUri('http:\/\/tarifikator.belpost.by\/forms\/international\/packet.php');         $request-&gt;setParameterPost(array(             'who'=&gt;'ur',             'type'=&gt;'registered',             'priority'=&gt;'priority',             'to'=&gt;'other',             'weight'=&gt;$weight                                          ));         $response = $request-&gt;request(Zend_Http_Client::POST);          $html = $response-&gt;getBody();          $tag_regex = &quot;\/&lt;blockquote&gt;(.*)&lt;\\\/blockquote&gt;\/im&quot;;         $sum_reqex = &quot;\/(\\d+)\/is&quot;;         preg_match_all($tag_regex,             $html,             $matches,             PREG_PATTERN_ORDER);         if(isset($matches[1]) && isset($matches[1][0])) {             preg_match($sum_reqex,$matches[1][0],$matches);             if(isset($matches[0])) {                 return (float)$matches[0];             }         } \t\t\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0446\u0435\u043d\u044b, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \t\t\/\/\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f         return Mage::getStoreConfig('carriers\/ignshipment\/price');     }      public function getBoxCost($weight)     {         $request = new Zend_Http_Client();         $request-&gt;setUri('http:\/\/tarifikator.belpost.by\/forms\/international\/ems.php');         $request-&gt;setParameterPost(array(             'who'=&gt;'ur',             'type'=&gt;'goods',             'to'=&gt;'n10', \/\/\u0442\u0443\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0437\u0430\u0442\u044b\u0447\u043a\u0430. \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0442\u0430\u043a\u0438\u0445 \u043a\u043e\u0434\u043e\u0432 \u0441 \u0441\u0430\u0439\u0442\u0430 \u0438 \u043a\u043e\u0434\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u044b, \u0442.\u043a. \u0432 Magento \u044d\u0442\u043e US, NZ, AU, \u0430 \u043d\u0430 \u0431\u0435\u043b\u043f\u043e\u0447\u0442\u0435 \u044d\u0442\u043e n1,n2,n3 \u0438 \u0442\u0434.             'weight'=&gt;$weight         ));         $response = $request-&gt;request(Zend_Http_Client::POST);          $html = $response-&gt;getBody();          $tag_regex = &quot;\/&lt;blockquote&gt;(.*)&lt;\\\/blockquote&gt;\/im&quot;;         $sum_reqex = &quot;\/(\\d+)\/is&quot;;         preg_match_all($tag_regex,             $html,             $matches,             PREG_PATTERN_ORDER);         if(isset($matches[1]) && isset($matches[1][0])) {             preg_match($sum_reqex,$matches[1][0],$matches);             if(isset($matches[0])) {                 return $matches[0];             }         } \t\t\t\t\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0446\u0435\u043d\u044b, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \t\t\/\/\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f         return Mage::getStoreConfig('carriers\/ignshipment\/price');     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043a \u043c\u043e\u0438\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0430\u043c. \u0423 \u043c\u0435\u043d\u044f \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043a \u043d\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u00ab\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u2014 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0439\u00bb.<br \/>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435 \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u00ab\u0443\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f\u00bb \u0446\u0435\u043d\u044b. \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0412 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d \u0432\u0435\u0440\u0441\u0438\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043d\u0435 \u0441\u0433\u043e\u0434\u0438\u0442\u0441\u044f. \u0418 \u0432\u043e\u043e\u0431\u0449\u0435, \u0442\u0430\u043a\u043e\u0435 \u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u043b\u044e\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0430 \u0435\u0449\u0435, \u0431\u044b\u043b\u043e \u0431\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0432\u044b\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0440\u0430\u0441\u0441\u0447\u0435\u0442\u0430 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438. \u0418\u043d\u0430\u0447\u0435, \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0435\u043b\u043f\u043e\u0447\u0442\u044b \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043e\u0431\u043d\u043e\u0432\u044f\u0442 \u0434\u0438\u0437\u0430\u0439\u043d. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0440\u0430\u0441\u0441\u0447\u0435\u0442\u0430 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u0433\u0434\u0435-\u0442\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0438\u043b\u0438 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430 \u043f\u043e\u0447\u0442\u0435 \u0443 \u043a\u0430\u043a\u043e\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u043e\u0433\u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430 \u043f\u043e\u0447\u0442\u044b. <br \/>  \u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u0438\u0442\u043e\u0433. \u041c\u0435\u0442\u043e\u0434 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043e\u0431\u0449\u0435\u0433\u043e \u0432\u0435\u0441\u0430. \u0412\u0435\u0441 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0442\u043e\u0432\u0430\u0440\u043e\u0432. \u0418 \u0435\u0441\u043b\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u043d\u0435 \u043f\u043e\u043b\u0435\u043d\u0438\u043b\u0441\u044f \u0435\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0442\u043e\u0432\u0430\u0440\u0443, \u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u043e\u0436\u0435\u043b\u0430\u044e \u0432\u0441\u0435\u043c \u0443\u0441\u043f\u0435\u0445\u043e\u0432. \u0410 \u043f\u043e \u043e\u0448\u0438\u0431\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0445, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043c\u043d\u043e\u0433\u043e, \u043f\u0438\u0448\u0438\u0442\u0435 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u041b\u0421.<br \/>  p.s. \u041d\u0435 \u043c\u043e\u0433\u0443 \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u0438 \u043d\u0435 \u043f\u043e\u043f\u0438\u0430\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 <a href=\"https:\/\/www.youtube.com\/channel\/UCycRcR9PlS1hprTJwc9GkpQ\">youtube \u043a\u0430\u043d\u0430\u043b\u044c\u0447\u0438\u043a<\/a>. \u0417\u0430\u0445\u043e\u0434\u0438\u0442\u0435, \u0442\u0430\u043c \u0443 \u0441\u0442\u0440\u0438\u043c\u0447\u0438\u043a\u0438 \u0431\u044b\u0432\u0430\u044e\u0442 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e Magento. \u0410 \u0441\u043a\u043e\u0440\u043e \u0438 \u0437\u0430 \u0440\u0430\u0437\u0431\u043e\u0440 Magento 2 \u0432\u043e\u0437\u044c\u043c\u0435\u043c\u0441\u044f.<br \/>  \u0412\u0441\u0435\u043c \u0431\u043b\u0430\u0433!<br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/312322\/\"> https:\/\/habrahabr.ru\/post\/312322\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/214\/54f\/16b\/21454f16b8cd4adb938c1e34c2103838.jpg\"\/><br \/>  <b>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/b><br \/>  \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0434\u0430\u0432\u043d\u043e \u0443\u0436\u0435 \u0432\u044b\u043f\u0443\u0449\u0435\u043d\u0443\u044e Magento 2, Magento \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0435\u0449\u0435 \u0436\u0438\u0432\u0435\u0435 \u0432\u0441\u0435\u0445 \u0436\u0438\u0432\u044b\u0445 \u0438 \u043f\u043e\u043a\u0430 \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0441 \u043f\u043e\u043a\u0438\u0434\u0430\u0442\u044c. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 Magento \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430 3 \u0433\u043e\u0434\u0430 \u0441 \u0434\u0430\u0442\u044b \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 2, \u0442.\u0435. \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0434\u043e \u043d\u043e\u044f\u0431\u0440\u044f 2018. \u0420\u044b\u043d\u043e\u043a \u043f\u0435\u0441\u0442\u0440\u0438\u0442 \u0448\u0438\u0440\u043e\u0447\u0430\u0439\u0448\u0438\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0442\u0435\u043c, \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u044b\u0445 \u043f\u043e\u0434 Magento 1.x \u0432\u0435\u0440\u0441\u0438\u0438. \u0418 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0430\u0439\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 Magento 1.x, \u043d\u0435 \u0442\u043e\u0440\u043e\u043f\u044f\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f. \u0420\u0430\u0431\u043e\u0442\u044b \u043c\u043d\u043e\u0433\u043e \u2014 \u0432\u044b\u0445\u043b\u043e\u043f\u0430 \u043c\u0430\u043b\u043e. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0434 Magento \u043f\u0435\u0440\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0435\u0449\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430 \u0438 \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442.<\/p>\n<p>  \u041d\u043e \u043d\u0435 \u043e \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0430\u0445 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f e-commerce \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0422\u0443\u0442 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439 \u0433\u0430\u0439\u0434 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f Magento 1.x (\u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e Magento). \u041d\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0433\u0430\u0439\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0434\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c, \u0430 \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u00ab\u043f\u043e\u0447\u0435\u043c\u0443 \u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043a, \u0430 \u043d\u0435 \u0438\u043d\u0430\u0447\u0435\u00bb. \u042f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430\u0439\u0442\u0438 \u0437\u043e\u043b\u043e\u0442\u0443\u044e \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443 \u043c\u0435\u0436\u0434\u0443 \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u044c\u044e \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e. \u0418 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0433\u0430\u0439\u0434 \u043d\u0435\u0441\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u0443 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c \u0432 \u0434\u0435\u043b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f Magento. \u041d\u043e \u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u043f\u043e\u043b\u044c\u0437\u0443.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-280734","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=280734"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/280734\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}