Tag: HTML

30
Sep

Active Menu

Active Menu Java Script <script> function selected(obj){ var lilist = document.getElementById(‘menu’); var alist = lilist.getElementsByTagName(‘a’); for (i=0; i<alist.length; i++ ) { alist[i].className=””; } obj.className=”red”; } </script> Style <style> .red { color:red; background:#F39; width:150px; } HTML <ul id=”menu”> <li><a href=”#” onClick=”selected(this)”>Home</a></li> <li><a href=”#”  onClick=”selected(this)”>About Us</a></li> <li><a href=”#”  onClick=”selected(this)”>Our Products</a></li> <li><a href=”#” onClick=”selected(this)”>Trade Offers</a></li> <li><a href=”#”  onClick=”selected(this)”>Contact Us</a></li> </ul>

12
Jul

How to change shipping rate in Percent

How to change shipping rate in Percent app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php find line $method->setPrice($shippingPrice); and put following code above that line      $session        = Mage::getSingleton(‘checkout/session’);             $quote_id       = $session->getQuoteId();             $item_quote     = Mage::getModel(‘sales/quote’)->load($quote_id);             $shippingPrice  = $item_quote->getSubtotal()*($this->getConfigData(‘price’)/100);  

12
Jul

To Show Custom Option , configuration option , quantity in list page.

To Show Custom Option , configuration option , quantity in list page. Put the code in place of where add to cart is now: <?php echo $this->helper(‘checkout’)->formatPrice($_product->getFinalPrice()) ?> <form action=”<?php echo Mage::getBaseUrl(); ?>checkout/cart/add/” method=”post” style=”display:block; clear:both;”> <?php $product = Mage::getModel(‘catalog/product’); $product->load($_product->getId()); //print_r($product); //exit(); $xml = “”; $hasAtts = 0; // configurable products $productType = $product->getTypeId(); if($productType == “configurable”) { //

Read more

11
Jul

Making default of product attributes like is_active,tax class, weight,status,stock,qty in magento

UPDATE `eav_attribute` SET `default_value` = ‘container1′ WHERE `eav_attribute`.`attribute_code`=’options_container’; UPDATE `eav_attribute` SET `default_value` = ‘1’ WHERE `eav_attribute`.`attribute_code`=’is_active’; UPDATE `eav_attribute` SET `default_value` = ‘1’ WHERE `eav_attribute`.`attribute_code`=’is_anchor’; UPDATE `eav_attribute` SET `default_value` = ‘1’ WHERE `eav_attribute`.`attribute_code`=’status’; UPDATE `eav_attribute` SET `default_value` = ‘0’ WHERE `eav_attribute`.`attribute_code`=’weight’; UPDATE `eav_attribute` SET `default_value` = ‘2’ WHERE `eav_attribute`.`attribute_code`=’tax_class_id’; insert into core_config_data values ( null, ‘default’, 0, ‘cataloginventory/item_options/is_in_stock’, 1 ); insert

Read more

11
Jul

How To Get Special Price in magento Product

How To Get Special Price in magento Product <?php Mage::app(); Mage::getSingleton(‘core/session’, array( ‘name’ => ‘frontend’ )); $_productCollection = Mage::getResourceModel(‘catalogsearch/advanced_collection’)-> addAttributeToSelect(Mage::getSingleton(‘catalog/config’)-> getProductAttributes())->addMinimalPrice()->setPageSize(1)->addStoreFilter(); Mage::getSingleton(‘catalog/product_status’)->addVisibleFilterToCollection ($_productCollection); Mage::getSingleton(‘catalog/product_visibility’)->addVisibleInSearchFilterToCollection ($_productCollection); $todayDate    = date(‘m/d/y’); $tomorrow     = mktime(0, 0, 0, date(‘m’), date(‘d’) + 1, date(‘y’)); $tomorrowDate = date(‘m/d/y’, $tomorrow); $_productCollection->addAttributeToFilter(‘special_from_date’, array( ‘date’ => true, ‘to’ => $todayDate ))->addAttributeToFilter(‘special_to_date’, array( ‘or’ => array( 0 => array( ‘date’ =>

Read more

11
Jul

Custom Menu In Magento

Custom Menu In Magento <?php         $root_category = Mage::getModel(‘catalog/category’)->load(3); // Put your root category ID here.         $subcategories = $root_category->getChildren();   foreach(explode(‘,’,$subcategories) as $subcategory) {         $category = Mage::getModel(‘catalog/category’)->load($subcategory);         echo ‘<a href=”‘.$category->getURL() .’” />’.$category->getName().'</a><br/>’;   }   ?>

11
Jul

Add Page In Navigation Menu

Add Page In Navigation Menu 1 Go To CatalogèManage Categories=> Add Sub Categories====note the categories ID 2 Go to CMS èPage => add New Page=====note the the url  key 3 Got To CatalogèURL Rewrite Management=> find Category Id and open store ==note the Request Path and delete this category 4Go toè add url Rewrite => select custom=>ID path– categories ID(1

Read more

28
May

How To Disable Right Click and Ctrl Key

<script type=”text/javascript”> var isNS = (navigator.appName == “Netscape”) ? 1 : 0; if(navigator.appName == “Netscape”) document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP); function mischandler(){ return false; } function mousehandler(e){ var myevent = (isNS) ? e : event; var eventbutton = (isNS) ? myevent.which : myevent.button; if((eventbutton==2)||(eventbutton==3)) return false; } document.oncontextmenu = mischandler; document.onmousedown = mousehandler; document.onmouseup = mousehandler; var isCtrl = false; document.onkeyup=function(e) { if(e.which ==

Read more

25
May

Upload Image & Compress Image Size

Upload Image & Compress Image Size HTML Code For File Uploading <form action=”upload.php” method=”post” name=”video_upload” enctype=”multipart/form-data”> <input name=”new_image” id=”new_image” size=”30″ type=”file” multiple=”true” /> <input type=”submit” value=”submit” name=”submit” /> </form>   File Name upload.php <?php if (isset ($_FILES[‘new_image’])){ $imagename = $_FILES[‘new_image’][‘name’]; $source = $_FILES[‘new_image’][‘tmp_name’]; $type=$_FILES[‘new_image’][‘type’]; $idate=$_REQUEST[‘idate’]; if(($_FILES[‘new_image’][‘type’]==’image/jpeg’) || ($_FILES[‘new_image’][‘type’]==’image/png’)|| ($_FILES[‘new_image’][‘type’]==’image/bmp’)|| ($_FILES[‘new_image’][‘type’]==’image/tiff’)|| ($_FILES[‘new_image’][‘type’]==’image/gif’)) { $target = “../upload/”.$imagename; move_uploaded_file($source, $target); $imagepath = $imagename;

Read more

22
May

PHP Interview Quesition & Answer

1.Explain how to submit form without a submit button in PHP? A form can be submitted in various ways without using submit button. Submitting a form by selecting an option from drop down box with the invocation of onChange event Using java script : document.form.submit(); Using header(“location:page.php”); 2.How can we increase the execution time of a php script? Default time

Read more