Thursday, May 16, 2013

Changing or Set Shipping Price on fly from event or observer in Magento

Please check this posted by myself which will explain clearway Set Shipping Price on fly from event or observer in Magento http://www.magentocommerce.com/boards/viewthread/316685/

Calling Form with validation outside magento

Please check this post added by myself which will help you validating form out side magento http://www.magentocommerce.com/boards/viewthread/336023/

Creating xml file of all products fields in magento programmatically

to create xml file of product check below link
www.magentocommerce.com/boards/viewthread/267477/>

Issue:- Custom option load or set price to 0 in SCP Module in Magento

When you select custom option it will set price 0 this issue happens when you use SCP module ( Simple Configurable Products.) to over come from this issue please check below post
http://www.magentocommerce.com/boards/viewthread/297872/

Time Out error in Magento report

Hi If you set server time and memory limit to max and the also facing same issue use below code in controller for example if you want to export any order then in viewedAction funtion use this below code same way in export action also
 ini_set('memory_limit', '-1');
set_time_limit (0); 
this happen in AWS server for load-balancing server http://www.magentocommerce.com/boards/viewthread/378702/

Adding new model for existing or core module in magento

Hi, if you add new model for existing module you have to follow below code that if you extend one core module ex catalog,checkout etc.. and you need to add new model then follow below steps extending catalog module to local folder 1. add resource in config.xml that is
 <global>
        <models>
            <sugarcode_catalog>
                <class>Sugarcode_Catalog_Model</class>
                <resourceModel>sugarcode_catalog_resource</resourceModel>                
            </sugarcode_catalog>            
            <sugarcode_catalog_resource>
                <class>Sugarcode_Catalog_Model_Resource</class>
                <entities>
                    <newmodel>
                        <table>tablename_new</table>
                    </newmodel>                   
                </entities>
            </sugarcode_catalog_resource>
                
        </models>
    </global> 
i extend catalog module and added newmodel as new model 2. create a table tablename_new manually in Db 3. create a model files that is local\Catalog\Model\Newmodel.php local\Catalog\Model\Resource\Newmodel.php local\Catalog\Model\Resource\Newmodel\Collection.php please check attached files in this post http://www.magentocommerce.com/boards/viewthread/387252/ now you can call $obj=Mage::getModel(’sugarcode_catalog/newmodel’)->getCollection(); print_r($obj);

One single field validation or Validate Form Only Certain Fields in Magneto

Hi, If you need to validate one field of form before submitting form that is onchange or on blur one or single field validation in Magento form use below code i took one ex of email validation if you need to validate a email filed while editing field it self use this code so error msg or validation will happen once you change to other field no need for submitting all form
 <script>
jQuery(document).ready(function() {
    jQuery('.input-text-taxvat').blur(
        function() {
            Validation.validate(this);
         }
    );
    });
</script> 
Note:- jQuery(’.email).blur where .email is class of email filed