Showing posts with label fixes. Show all posts
Showing posts with label fixes. Show all posts

Friday, 22 May 2015

Configurable Product not adding to cart

Community edition 1.9 and Enterprise edition 1.14 both have this problem. There will be a memory exhausted issue or the browser keeps loading forever.

There is a patch for this fix which is available on github.
More discussion can be found on the magento.stackexchange website.

Tuesday, 1 July 2014

Magento Add to cart not working for new products block

I came across this Add to cart issue after upgrading from version 1.7.2 to 1.8.1.
Then after a long time search, luckly i found the cause.

In Magento version 1.8.1 there was an update to the add to cart feature with the inclusion of "Form keys". Magento has implemented this feature to prevent XSS attacks.

To know more about Form keys click here.

SOLUTION : Change the button type from "button" to "submit"

NOTE : Enabling All cache type may not solve the issue. Disable only "Blocks HTML output", you can enable other cache types.

Saturday, 1 February 2014

Magento import products with custom product type via csv

I was assigned a job to import products with custom product types through CSV

Magento's default product types are
  1. simple
  2. configurable
  3. virtual
  4. grouped
But when you import products with new product type other than the above mentioned. you will get this error

Product Type is invalid or not supported in rows... 

To overcome this error and import products with your custom product type you must follow these two steps.

1. Now am going to assume you have created an extension. On the config.xml file of your extension place this code under <global> tag.

<importexport>
    <import_product_types>
         <YOUR_MODULE>yourModule/import_entity_product_type_
YOUR_MODULE</YOUR_MODULE>
    </import_product_types>

</importexport>

Replace YOUR_MODULE with you module name.

2. Create a new model class to do the import. For this create this folder structure inside your model structure
Import\Entity\Product\Type\NEW-PRODUCT-TYPE

In my case i have a new product type "subscription_simple". so my folder structure will be
Import\Entity\Product\Type\Subscription\

Inside the folder i have a model class Simple.php file extending the magneto import class.\

place this code inside Simple.php file.

class NAMESPACE_MODULE_Model_Import_Entity_Product_Type_Subscription_Simple
    extends Mage_ImportExport_Model_Import_Entity_Product_Type_Abstract
{

}

Now you can do the import with your custom product type.

you can check out one of the inbuilt classes for an example Mage_ImportExport_Model_Import_Entity_Product_Type_Simple

INFO: http://stackoverflow.com/questions/8909405/product-type-is-invalid-or-not-supported-in-rows-for-custom-product-type

Tuesday, 13 August 2013

Allow specific tags in WYSIWYG editor.

By default magento WYSIWYG editor will strip certain tags from the editor. To allow your tags in WYSIWYG editor you must edit the file under the path 

js/adminhtml/wysiwyg/tiny_mice/setup.js

1. Find var settings = { line and 
2. Add extended_valid_elements : 'nav[style|id|class]'.

In my case i have allowed <nav> tag, and am allowing the attributes style, id etc. Now the nav tag wont be stripped when you add it in admin WYSIWYG editor.

Magento Remove secure url from database.

Removing http(s) by editing databse.

If you cant access your magento admin panel and you need to remove your https, go to 
core_config table 
change the value of web/secure/use_in_frontend to '0' and web/secure/use_in_adminhtml to '0' .

If it is set to '1' your site is https enabled.