Load Additional Config in config.mysql4.xml
We can use this file name config.mysql4.xml
to load additional configuration in the module's etc
folder, the folder which contains config.xml
.
Related cards:
nginx config
See production grade nginx and docker config here.
Some notes on this:
- the PCI work was trial and error, we did set up, the external audit did penetration/probe testing, we adjusted settings...
Magento image load error: fileUploadErrorCantWrite
The error is coming from Mage_Catalog_Model_Product_Option_Type_File
but it is not interpreted in _getValidatorErrors()
. The error happens repeatedly for certain users and not other users.
In $fileInfo = $upload->getFileInfo($file);
, the e...
How to use cache in OpenMage / Magento 1.x to speed things up
Mechanism: cache in model
First, save the cache
// app\code\core\Mage\Core\Model\App.php Mage_Core_Model_App
/**
* Saving cache data
*
* @param mixed $data
* @param string $id
* @param array $tags
* @param null|false|int ...
Form Field
A sample of different options to add field in Mage_Adminhtml_Block_Widget_Form
Ref Varien_Data_Form_Element_Abstract
lib\Varien\Data\Form\Element\Abstract.php
Add Suffix to Element Names
$form = new Varien_Data_Form(['field_name_...
Programmaticaly add attributes to attribute group
/**
* Add attributes to attibute_group 'CAUTION!!! System Config'.
*/
if ($attrs) {
$resource = Mage::getResourceSingleton('eav/entity_attribute');
foreach ($customerGroupIds as $groupCode => $groupId) {
/** @var Scx_Exten...
How to Add Guzzle Package Using Composer.
To install, just issue the following PowerShell command at the root of OpenMage:
PS D:\Work\project> composer require guzzlehttp/guzzle:^7.0
**Following is deprecated in the latest OpenMage, which will autoload the vendor folder automa...
Add dynamic block contents in category page
In backend > Catalog > Manage Categories, we can configure a category page and put it on the main menu. The page contents are rendered in
app\design\frontend\base\default\template\catalog\category\view.phtml
If we want to render an HTML tab...
Controller Action Response
json response
public function completeAction()
{
$orderId = $this->getRequest()->getParam('order_id', false);
$info['order_id'] = 0;
if ($orderId) {
$order = Mage::getModel('patron/order')->load($...
Dataflow Import/Export Profiles
Import Sample Actions XML:
<action type="dataflow/convert_adapter_io" method="load">
<var name="type">file</var>
<var name="path">var/import</var>
<var name="filename"><![CDATA[filename.csv]]></var>
<var name="format"><![CDAT...
Magento Stores
Load Store by Store Code
$store = Mage::getModel('core/store')->load('store_code');
// or
$store = Mage::app()->getStore('store_code');
Get Store URL
$store->getBaseUrl();
Get Store Secure URL
$store->getBaseUr...