Skip to main content

Posts

How to create Guest Wishlist For Magento

Add to wishlist without customer login Add three tables CREATE TABLE `wishlist` ( `wishlist_id` INT(11) NOT NULL AUTO_INCREMENT, `customer_id` INT(11) NULL DEFAULT NULL, `shared` INT(11) NULL DEFAULT NULL, `sharing_code` VARCHAR(50) NULL DEFAULT NULL, `updated_at` TIMESTAMP NULL DEFAULT NULL, `cookie` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`wishlist_id`) ) COLLATE='latin1_swedish_ci' ENGINE=InnoDB AUTO_INCREMENT=0 ; CREATE TABLE `wishlist_item` ( `wishlist_item_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Wishlist item ID', `wishlist_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Wishlist ID', `product_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Product ID', `store_id` SMALLINT(5) UNSIGNED NULL DEFAULT NULL COMMENT 'Store ID', `added_at` TIMESTAMP NULL DEFAULT NULL COMMENT 'Add date and time', `description` TEXT NULL COMMENT '

Add Dynamic data on magento admin form

<?php class Ankur_Banners_Block_Adminhtml_Banners_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form { protected function _prepareForm() { $form = new Varien_Data_Form(); $this->setForm($form); $fieldset = $form->addFieldset("banners_form", array("legend"=>Mage::helper("banners")->__("Item information"))); $fieldset->addField('lable', 'hidden', array( 'label'     => Mage::helper('megamenu')->__('Add Images'), 'name' => 'label', 'after_element_html' => '<div id="add_more"></div><button id="add" class="add_field_button"  type="button" >Add Images</button>' )); if (Mage::getSingleton("adminhtml/session")->getBannersData()) { $form->setValues(Mage::getSingleton("adm

Get Attribute Value , type by attribute id

 $attribute = Mage::getModel('eav/entity_attribute')->load($attr); $type=$attribute->getFrontendInput(); $attrLabel=$attribute->getFrontendLabel(); $attrName=$attribute->getAttributeCode(); //echo $attribute->getData($attrName);die;  if($type=='multiselect'){ $html.='<div class="field"><label for='.$attrName.'"  class="required">'.$attrLabel.': </label><div class="input-box"><select multiple id="'.$attrName.'"  name="product['.$attrName.'][]" >'; //$values=$attribute->getSource()->getAllOptions(true, true); $values=$attribute->getAttributeText($attrName); $attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product',$attrName); $collection =Mage::getResourceModel('eav/entity_attribute_option_collection

Magento Update product status programmatically

public function updateproductstausAction(){ $productid=$this->getRequest()->getParam("product_id"); if($this->getRequest()->getParam("val")==0){ // product id which you want to change status; $storeid=0 ;// your store id 0 is for default store id Mage::getModel('catalog/product_status')->updateProductStatus($productid, $storeId, Mage_Catalog_Model_Product_Status::STATUS_DISABLED); } elseif($this->getRequest()->getParam("val") =='1'){ $storeid=0 ;// your store id 0 is for default store id Mage::getModel('catalog/product_status')->updateProductStatus($productid, $storeid, Mage_Catalog_Model_Product_Status::STATUS_ENABLED); } }

Step by Step validating jquery-steps form with bootstrap validator

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <link rel="stylesheet" href="http://formvalidation.io/vendor/formvalidation/css/formValidation.min.css" /> <link rel="stylesheet" href="http://formvalidation.io/vendor/jquery.steps/css/jquery.steps.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script src="http://formvalidation.io/vendor/formvalidation/js/formValidation.min.js"></script> <script src="http://formvalidation.io/vendor/formvalidation/js/framework/bootstrap.min.js"></script> <s