Vic
  • Member for 7 years, 7 months
  • Last seen more than 1 year ago
How can I fix "Item (Mage_Catalog_Model_Product) with the same id "xxx" already exist"?
Accepted answer
36 votes

Adding the distinct as suggested in the accepted answer does fix the problem but it has performance issues. The database might create temporary tables on disk when executing a query with distinct and ...

View answer
How to give custom acces permissions for admin users(roles) to an extension magento
Accepted answer
8 votes

I want to explain a bit what @Sander Mangel said in his answer: make sure the Adminhtml controller of the module has a _isAllowed method Look for files like this: /app/code/community/your/...

View answer
how to redirect user to a custom store after login
5 votes

Use the customer_login event to avoid changing/rewriting/overriding core files. In your config.xml <config> <global> <models> .... </models> <events&...

View answer
Cancelling order placement before order object is created from quote
Accepted answer
4 votes

Just hookup your observer to the sales_order_place_before app/code/local/my/module/etc/config.xml <frontend> <events> <sales_order_place_before> <...

View answer
"A joint field with this alias (bestsellers) is already declared" product sorting Magento
2 votes

What I've done before to avoid these is already declared errors is check the query string to see if it contains the name of the table I'm joining. I find that depending on where you add your join code,...

View answer
Adminhtml - How to create New Admin Form
Accepted answer
2 votes

Sounds like you need a form and a form container. It's similar to what you already did with the grid. You must create these files: /app/code/community/VivasIndustries/SmsNotification/Block/...

View answer
Magento is not saving new field in database even after flush cache storage
Accepted answer
1 votes

Change the name of your field. Magento is parsing ->setImage2(... as image2 instead of image_2. Either change the name of your field or do this: ->setData('image_2', $postData['image_2'])

View answer
how to assign the same value to column of custom grid?
Accepted answer
1 votes

There's a mistake in how you're calling your renderer. Try this: $this->addColumn('Vendor Code', array( 'header'=> Mage::helper('catalog')->__('Vendor Code'), ...

View answer
customer/session isLoggedIn() returns false
Accepted answer
1 votes

So I found out the problem with the customer session was that I was instantiating my own custom session way to early. As I learned from this article by Alan Storm, instantiating sessions too early can ...

View answer
Adminhtml - Blank Edit Form, not showing data in the edit input fields
1 votes

Okay, so for the first issue: In the function addFieldToFieldset take a look at this line protected function _addFieldsToFieldset( Varien_Data_Form_Element_Fieldset $fieldset, $fields) { $...

View answer
Hreflang php code for getstore instead of getwebsite
0 votes

How about: foreach ($collection as $store) { $storeCode = $store->getCode() == 'default' ? 'en' : $store->getCode(); echo '<link rel="alternate" href="' . preg_replace('/\?.*/', '', $...

View answer
Filtering Magento product collection by multiple categories using AND condition
Accepted answer
0 votes

Haven't tested but maybe this will work: $collection->distinct(true) ->joinField('category_id', 'catalog/category_product', null, 'product_id = entity_id', "(".implode(" OR ", $conditions)."...

View answer
Onepage Checkout registration redirects to cart; checkout/onepage/saveMethod returns 404
Accepted answer
0 votes

I ended up checking if customer is logged in before rendering the checkout page in an event observer. If not logged in, I redirect the user to the customer login page after setting a session variable ...

View answer
What changes would need to be made to show posts with future created dates?
Accepted answer
0 votes

This block class isn't doing much of preparing the collection. You can see that it is done in the parent. If you look at your first file, you see that AW_Blog_Block_Blog extends AW_Blog_Block_Abstract....

View answer
addColumn() in setup script TYPE_MEDIUMTEXT how? or text size?
Accepted answer
0 votes

Take a look at this: https://stackoverflow.com/questions/10074358/how-to-increase-maximum-size-of-csv-field-in-magento-where-is-this-located Apparently you have to manually change the type of the ...

View answer