Add comment to form input in admin
$afterElementHtml = '<p class="nm"><small>' . ' this is the hint! ' . '</small></p>';
$linkFieldset->addField('field_name', 'text', array(
'after_element_html' => $afterElementHtml,
));
Related cards:
Product Attribute Addition
This code shows all possible configuration options for an attribute that I know of, you need not include all of these when adding an attribute (although it won't hurt)
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
...
Adding Attributes To Other Entities With getDefaultEntities()
Don't do it!! I did the below:
public function getDefaultEntities()
{
return array(
'catalog_product' => array(
'attributes' => array(
'size_guide_id' => array(
...
Set Next Increment ID For Orders, Quotes, Invoices, Shipments or Credit Memos
BIG NOTE! I'm not totally sure that all these entity types increment ID's are stored here any more. Check
The last order increment ID issued for all these entity types is stored in eav_entity_store
, in the increment_last_id
column. Note that ...
Add A Tab To The Admin Product Screen
Declare an admin layout XML file for your module in your config.xml
:
<config>
<adminhtml>
<layout>
<updates>
<your_module>
<file>your-module.xml</file>
...
Non-Required Category Attribute Not Set in Global Scope
When a category is created whilst in a store scope, and a value is set against an attribute which has is_required
set to false
, and has a scope more specific than global
, then a value is not set against the global scope, resulting in the sto...
Add A Tab To The Admin Product Screen
Adding A Tab To The Product Screen
-
Declare an admin layout XML file for your module in your config.xml:
Add Category Attributes Through SQL Updates
This is creating a module which will update categories to include new attributes.
-
inside app/etc/modules/yourmodule.xml put the following:
<?xml version="1.0"?> <config> <modules> <Yourmodule_Sql>...
Reindex Via Code
An example of code qhich allows you to reindex:
$indexer = Mage::getSingleton('index/indexer');
$process = $indexer->getProcessByCode('catalog_product_price');
$process->reindexEverything();
The following are indexer codes which you ...
Paypal Express Flow
The PayPal Express Checkout Integration Guide is a great
source of well-written information for anything relating to the Express
checkout, including information regarding all of the API calls. Also, the PayPal
Express Checko...
Adding A Column to a Flat Table
Handy to add attributes to sales_flat_order:
$installer->getConnection()->addColumn(
$this->getTable('sales/order'),
'some_attribute',
[
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'length' => ...