Posts Tagged ‘ Magento ’

Saving problem for Large Number of Attribute Option Labels in Magento

I had a problem (POST truncated) today and it comes from a too little POST limit. (or the standard PHP post_max_size)

i solved it with changing php.ini

max_input_var=1000
to
max_input_var=10000

you can try if you have same problem.

thanks
for more info visit mage-people

Advertisements

How to Translate Text in Magento

1. Add the following code inside your custom module config.xml

    
<frontend>
    <translate>
        <modules>
            <Modulename>
                <files>
                    <default>Translation.csv</default>
                </files>
            </Modulename>
        </modules>
    </translate>
</frontend>
        
    

2. Put Your Translation.csv inside app/locale/[your package]/

3. Use following code to translate it in frontend .

	
<?php
echo Mage::helper('modulename')->__('text to translate');
?>

4. This is how your csv file should be .

“test to be translate”,”translating text”

and so on.

thanks

for more info visit mage-people

How to solve Product Flat Data and Category Products (Indexed category/products association) reindex issue

Hello

Getting to this point ultimately lead to the resolution. Below is the process we used to solve the reindexing issue for Product Flat Data:

1) Export all catalog_product_flat _* tables with data and structure with “Disable foreign key checks” enabled.
2) Drop all catalog_product_flat _* tables.
3) Once check in Frontend , that products are categories are visible
4) Login to Magento backend
5) Go to: System -> Index Management
6) Click “Reindex Data” next to “Product Flat Data” index

Below is the process we used to solve the reindexing issue for Category Products (Indexed category/products association):

1) Log into phpMyAdmin
2) Go to `catalog_category_product_index`
3) Click “Export”.
4) Export only structure with “Disable foreign key checks” enabled.
5) Drop the table `catalog_category_product_index`
6) With the SQL that was exported, remove the constraints at the bottom of the export. Be sure to keep the “SET FOREIGN_KEY_CHECKS” statements.
7) Click “SQL”, paste in modified SQL and click “Go”
8) Login to Magento backend
9) Go to: System -> Index Management
10) Click “Reindex Data” next to “Category Products” index

Thanks

for more info visit mage-people

Magento: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘XX-XX’ for key “PRIMARY”

Just Run This code in SQL


<code><code>TRUNCATE `sales_flat_quote`;
 ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
 TRUNCATE `sales_flat_quote_address`;
 ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
 TRUNCATE `sales_flat_quote_address_item`;
 ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
 TRUNCATE `sales_flat_quote_item`;
 ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
 TRUNCATE `sales_flat_quote_item_option`;
 ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
 TRUNCATE `sales_flat_quote_payment`;
 ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;</code></code>

TRUNCATE `log_customer`;
 ALTER TABLE `log_customer` AUTO_INCREMENT=1;
 TRUNCATE `log_quote`;
 ALTER TABLE `log_quote` AUTO_INCREMENT=1;
 TRUNCATE `log_summary`;
<div></div>
ALTER TABLE `log_summary` AUTO_INCREMENT=1;
 TRUNCATE `log_summary_type`;
 ALTER TABLE `log_summary_type` AUTO_INCREMENT=1;
 TRUNCATE `log_url`;
 ALTER TABLE `log_url` AUTO_INCREMENT=1;
 TRUNCATE `log_url_info`;
 ALTER TABLE `log_url_info` AUTO_INCREMENT=1;
 TRUNCATE `log_visitor`;
 ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
 TRUNCATE `log_visitor_info`;
 ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;
 TRUNCATE `report_event`;
 ALTER TABLE `report_event` AUTO_INCREMENT=1;

for more info visit mage-people

How to delete all orders in Magento

Unfortunately, magento default does not have option for delete order in Magento by default. there are over hundred orders leave in backend which make our sales confused. In this case, you can execute following SQL statements to delete the ALL orders in MySQL database:

<pre>TRUNCATE TABLE {prefix}sales_flat_order;
TRUNCATE TABLE {prefix}sales_order_tax;
TRUNCATE TABLE {prefix}downloadable_link_purchased;
DELETE FROM {prefix}eav_entity_store WHERE entity_type_id IN (SELECT entity_type_id FROM {prefix}eav_entity_type WHERE entity_type_code IN ('order', 'invoice', 'creditmemo', 'shipment'));</pre>

for more info visit mage-people

Category listing alphabetically in magento

<?php
$cats = Mage::getModel('catalog/category')->load(7)->getChildren();
$catIds = explode(',',$cats);
?>
<ul>
<?php foreach($catIds as $catId): ?>
<li>
<?php
$category = Mage::getModel('catalog/category')->load($catId);
echo '<a href="' . $category->getUrl() . '">';
echo $category->getName() . '</a>';
?>
</li>
<?php endforeach; ?>
</ul>

for more info visit mage-people