Download - Top 10 problems supporting Magento customers
![Page 1: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/1.jpg)
Топ-10 проблем в магазине вашего клиента
с которыми вы обязательно столкнётесь
Вячеслав КостюковичaheadWorks.com
![Page 2: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/2.jpg)
Код в целом ведет себя крайне странно, однако не похоже, чтобы на сторе были установлены какие-либо сторонние расширения.
![Page 3: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/3.jpg)
diff -qrbB coreReferenceFolder coreCientFolder-qReport only when files differ-rRecursively compare any subdirectories found-bIgnore white spaces-BIgnore blank lines
![Page 4: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/4.jpg)
Предположим, что у нас есть экст, который должен аяксом обновлять боковую корзину при добавлении продукта из категории.
При нажатии на кнопку “add to cart” ajax-запрос вместо результатов возвращает ошибку вида:
unknown function showName
![Page 5: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/5.jpg)
header.phtml: 1. <? /** 2. * @var Mage_Page_Block_Html_Header $this 3. */ ?> 4. <?php 5. function showName($name) 6. { 7. echo '<strong><span>'.$name.'</span></strong>'; 8. } 9. ?>10. <div class="header-container">11. <div class="header"> ...
sidebar.phtml: 1. <?php /** 2. * Shoping cart sidebar 3. * @see Mage_Checkout_Block_Cart_Sidebar 4. */ ?> 5. 6. <?php if ($this->getIsNeedToDisplaySideBar()):?> 7.<div class="block block-cart"> 8. <?php $_cartQty = $this->getSummaryCount() ?> 9. <div class="block-title">10. <?php showName($this->__('My Cart')); ?>11. </div> ...
![Page 6: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/6.jpg)
fixed sidebar.phtml:
1. <?php /** 2. * Shoping cart sidebar 3. * @see Mage_Checkout_Block_Cart_Sidebar 4. */ ?> 5. <?php 6. if (!function_exists('showName')) { 7. function showName($name) { 8. echo '<strong><span>'.$name.'</span></strong>'; 9. }10. }11. ?>12. <?php if ($this->getIsNeedToDisplaySideBar()):?>13. <div class="block block-cart">14. <?php $_cartQty = $this->getSummaryCount() ?>15. <div class="block-title">16. <?php showName($this->__('My Cart')); ?>17. </div> ...
![Page 7: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/7.jpg)
ERR (3): Warning: include(): Failed opening '/home/vhosts/Magento/app/design/frontend/default/default/template/ajaxcartpro/init.phtml' for inclusion (include_path= '/home/vhosts/Magento/app/code/local:/home/vhosts/Magento/app/code/community:/home/vhosts/Magento/app/code/core:/home/vhosts/Magento/lib:/usr/share/php: /usr/share/pear')in /home/vhosts/Magento/app/code/core/Mage/Core/Block/Template.php on line 241
![Page 8: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/8.jpg)
chmod 755 /home/vhosts/Magento/app/design/ frontend/default/default/template/ajaxcartpro/ init.phtml
![Page 9: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/9.jpg)
Установил расширение, все настроил, но все равно не вижу его на фронтэнде, только в админке.
![Page 10: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/10.jpg)
app/design/frontend/default/default/skin/frontend/default/default/
app/design/frontend/customPackage/customTheme/skin/frontend/customPackage/customTheme/
![Page 11: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/11.jpg)
![Page 12: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/12.jpg)
public function __construct(){ ini_set('memory_limit', '1024M'); ...}
![Page 13: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/13.jpg)
Расширения, использующие крон, работают неверно.
![Page 14: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/14.jpg)
1. const L_CACHE = 'aw_hdu_lock'; 2. const L_TIMEOUT = 300; 3. 4. public function runJobs() { 5. if (self::checkLock()) { 6. $this->processJobs(); 7. Mage::app()->removeCache(self::L_CACHE); 8. } 9. }10.11. public static function checkLock() {12. $_lastExecutionTime = Mage::app()->loadCache(self::L_CACHE);13. if (self::L_TIMEOUT > (time() - $_lastExecutionTime)) {14. return false;15. }16. Mage::app()->saveCache(time(),self::L_CACHE,array(),self::L_TIMEOUT);17. return true;18. }
![Page 15: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/15.jpg)
Валидный код, вместо того, чтобы выполняться, возвращает ошибки.
![Page 16: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/16.jpg)
1. abstract class AWAS_Model_Indexer_Abstract 2. { 3. public function getIndexTableModel() { 4. return new AWAS_Model_Zend_Db_Table(array( 5. Zend_Db_Table_Abstract::PRIMARY => static::PRIMARY 6. )); 7. } 8. } 9. class AWAS_Model_Indexer_Catalog extends AWAS_Model_Indexer_Abstract10. {11. const PRIMARY = 'entity_id';12.13. protected function _fillData() {14. $table = $this->getIndexTableModel();15. }16. }
![Page 17: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/17.jpg)
1. abstract class AWAS_Model_Indexer_Abstract 2. { 3. abstract protected function _getPrimary(); 4. public function getIndexTableModel() { 5. return new AWAS_Model_Zend_Db_Table(array( 6. Zend_Db_Table_Abstract::PRIMARY => $this->_getPrimary() 7. )); 8. } 9. }10. class AWAS_Model_Indexer_Catalog extends AWAS_Model_Indexer_Abstract11. {12. const PRIMARY = 'entity_id';13. protected function _fillData() {14. $table = $this->getIndexTableModel();15. }16. protected function _getPrimary(){17. return self::PRIMARY;18. }19. }
![Page 18: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/18.jpg)
После установки расширения не могу войти в админку.
![Page 19: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/19.jpg)
По SSHЗайти на сервер в папку <Magento_store>/shell/ и выполнить следующие команды:
php -f compiler.php clearphp -f compiler.php disable
По FTPСоздать в корневом каталоге Magento php файл следующего содержания и запустить:<?php
echo exec('php -f shell/compiler.php clear');echo exec('php -f shell/compiler.php
disable');?>
![Page 20: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/20.jpg)
Вы, в рамках какой-либо задачи, кастомизировали клиенту стор, добавили функционал, изменили шаблоны и стили темы, а спустя пару недель клиент возвращается и жалуется на то, что все ваши изменения перестали работать.
![Page 21: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/21.jpg)
app/code/local/AW/Ext/Block/Filename.phpapp/code/local/AW/Ext/Block/Filename.php.ORIGINALapp/code/local/AW/Ext/Block/Filename.php.MODIFIED
![Page 22: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/22.jpg)
Клиент поставил перед вами задачу, но не предоставляет необходимый доступ.
![Page 23: Top 10 problems supporting Magento customers](https://reader036.vdocuments.pub/reader036/viewer/2022070302/5480afb8b4af9f98028b4679/html5/thumbnails/23.jpg)
app/code/app/design/js/var/skin/