Hot answers tagged

82

I've managed to stabalize the issue as follows: Step 1: Rewrite the Catalog URL model (Using your own module: How To) Note: If you overwrite the core file without using a rewrite this will render your instance of Magento incapable of future upgrades. As per Jahnni's solution on the MagentoCommerce boards (no longer active with new board), app/code/...


44

While I hope someone here comes up with an answer, I don't know that you'll find one. This table gets bulky for a lot of different reasons. Bugs in earlier (and possibly current) versions of Magento is one. Another is there's logic in this table that tries to track changes to the URL key value so that 301/302 rewrites are setup for old products. Because ...


24

I would like to add a fix for this url rewrite indexer bug which has been developed at the bugathon in March 2013 and which has been further improved afterwards. It should solve this issue. As a reference, here is the patch file from the link: diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php --- ...


18

As requested on Twitter and discussed on Meta I'll start here a debugging tutorial for non-devs. First I think (even thou magento tries to engage this) Magento is too complex for a merchant without developer/development team. But if you are brave and want to try it, we are giving our best here to help you. I think for some questions is the border between "...


15

You Cannot Override Admin Files Directly In Your Theme. You Need Custom Module For Overriding Admin Files OR Use Existing Custom Module. 1) Copy vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml to app/code/Vendor/Module/view/adminhtml/templates/order/view/info.phtml 2) Create sales_order_view.xml at app/code/Vendor/Module/view/...


14

Despite being late with an answer I would like to answer the question You gain even more performance if you physically remove the files. Simply all of them, except Mage_Core ;-) But to disable tight couple modules you need to install another module which takes care that nothing will break. Therefore I've developed: https://github.com/Zookal/magento-mock ...


14

After you applied the patch posted by Simon, you can use the following query to remove junk data: DELETE FROM core_url_rewrite WHERE is_system <> 1 AND id_path REGEXP "^[0-9]+_[0-9]+$" AND (request_path REGEXP ".*-[0-9]*\.html" OR target_path = request_path); In contrast to Ashish Hira's query, this only effects URLs which have an ...


13

Maybe it's a little bit late, but for anyone who is searching for the correct answer here it is Mage::getSingleton('core/resource')->getTableName('customer_entity'); It will returns "yourtableprefix_customer_entity"


10

See Marius' answer regarding a simple and quick XML way of disabling modules. Create a single file zzz_Disabled_Modules.xml with the contents <?xml version="1.0"?> <config> <modules> <Mage_Rss> <active>false</active> </Mage_Rss> <Mage_PaypalUk> <active>...


10

Here is the order in which you should customize core features. Start from the top and if one option is not possible go to the next one. Observers Class rewrites Copy class to local folder. Edit the core - Do this only if you want the universe to implode on itself. The observers approach is the safest. Observers usually don't disappear on an upgrade and ...


10

You can try this simple module to override \Magento\Catalog\Model\Product class. It 100% works on my local Magento 2 test environment. Base folder: app\code Directory tree: └── Example └── OverrideModel ├── composer.json ├── etc │   ├── frontend │   │   └── di.xml │   └── module.xml ├── Model │   ...


10

Use \Magento\Framework\View\Asset\Repository class to get view file url in block file protected $_assetRepo; public function __construct( ... \Magento\Framework\View\Asset\Repository $assetRepo, ... ) { ... $this->_assetRepo = $assetRepo; ... } Now, you can get image URL by echo $this->_assetRepo->getUrl("Vendor_Module::...


9

When you rewrite a helper class, it will only take effect when you use Mage::helper('...'). However, most helper classes extend from Mage_Core_Helper_Data directly and then, the original class is used :( For example: class My_Custom_Helper_Class extends Mage_Core_Helper_Data { } If you want to rewrite such a class in all cases, you can use the ugly ...


9

Decided to implement Go! AOP framework in Magento. See Danslo_Aop on github.


9

You can try with app/design/frontend/{Vendor}/{Theme}/web/css/source/lib/_navigation.less Read more: How to override gallery.css


8

You can use Bootstrap to run Application which will return you response object. Here is official example from index.php file: <?php require __DIR__ . '/app/bootstrap.php'; $params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2'; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website'; $bootstrap = \...


7

I've implemented the accepted answer with success. On another Magento install I needed to preserve some custom rewrites so I deleted all entries that ended in a - and then a number up to 5 digits long with: DELETE FROM `core_url_rewrite` WHERE `request_path` REGEXP '\\-[0-9]{1,5}$'; This mostly worked but I still get 2 more rows on each re-index. Not sure ...


7

It's used by some Magento modules like Authorizenet as a fallback page for iframes. Other uses I have't found for it yet. The actual URL will be set with javascript most likely, the blank html page is just to give it something to initially load.


6

Since this is not yet mentioned in this thread, I wanted to share the cool news that this issue is fixed in Magento 1.9.3.9 and later. See the related release notes: Magento no longer performs unnecessary write operations on the core_url_rewrite table. So all fixes for this issue mentioned here are not necessary when using a version of Magento greater or ...


6

In Magento Enterprise the is a new module for storing url rewrite Enterprise_UrlRewrite. This module contains new tables for storing the rewrites, some layout files for the admin section, a new admin html controller and a new url matcher to name but a few items. To understand when the enterprise system uses the new tables for saving rewrites we can first ...


6

First of all, it's better to have custom helpers than to override core classes. If you use your helper in templates and you don't want to get errors if you disable your module, you should handle your helper calls like this. Let's say your extension is called MyNamespace_MyExtension and you call your helper like this: Mage::helper('myextension')->...


6

Probably the first rule in Magento development : never touch the core You can either: create your own module in app/code/local and add the library in the module folder if that library is already Magento code or if it's pure PHP and not Magento code still create your own module in app/code/local and add the library under the lib folder In both case you ...


6

1) You have to copy _navigation.less from your parent theme to app\design\frontend\vendor\theme\web\css\source(your custom theme) and override your css after .lib-main-navigation(); and .lib-main-navigation-desktop(); this lib navigation style. OR 2) you can override navigation variable's value in custom theme's _theme.less, you can find variable name ...


5

The core change that you mentioned only seems to be needed if you have products without url_keys, however Magento should always create url_keys for you. If you have some importer which is creating products without url_keys, then this problem will crop up for those products. Try running the following query to find such products: SELECT cpe.entity_id, cpe.sku,...


5

The classname should be [Namespace]_[Module]_Model_Observer, to make sure the right class is used in your config.xml you can specify the whole classname in the <class> tag. <class>[Namespace]_[Module]_Model_Observer</class> It might be helpful to also post the system.xml contents to see if the admin_system_config_changed_section_[...


5

I had this same problem while installing an instance of Magento within our testing environment. Because I downloaded Magento Enterprise on my local machine and pushed the code to the test environment using GIT, my .gitignore file left out the enterprise.xml and config.xml. Because these files were missing it generated the error message described by the OP. ...


5

This might be late but I think very short & sweet solution :- The file is this - app/code/core/Mage/Directory/Block/Data.php and the function is this - getCountryHtmlSelect If you want to remove the very top blank entry from country drop down....just put false in toOptionArray(false); Don't forget that you put this file in app/code/local/Mage this ...


5

First of all you should enable Developer mode You may also enable to display errors in index.php:ini_set('display_errors', 1); Compile xDebug extension with any smart IDE(PhpStrom/eclipse) Disable the custom and 3rd parties module Review your exception and error log, resolve listed errors on exception log Check the curl and mcrypt extension must be loaded on ...


5

That is an easy one: you should never use core, but always local. Or did I misunderstand the question? Update: Reasons are simple as well. If you overwrite files in core and then update your shop (i.e. update the core folder) to a new version, all your modifications will be lost and you will need to search all the files if you have modifications. In ...


5

You did not define your own model: Your app/code/local/Myname/Catalog/etc/config.xml should look like this (note the <myname_catalog> section): <?xml version="1.0"?> <config> <modules> <Myname_Catalog> <version>0.1.0</version> </Myname_Catalog> </modules> &...


Only top voted, non community-wiki answers of a minimum length are eligible