Tag: NG Softech

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>

10
Sep

WordPress Function

WordPress Function Jquery Include     <?php wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); ?> 2. Thumbnail Image <?php the_post_thumbnail();?> <?php  the_post_thumbnail(‘thumbnail’);  ?> <?php  the_post_thumbnail(‘medium’);   ?> <?php the_post_thumbnail(‘large’);      ?> <?php the_post_thumbnail(‘full’);?> <?php the_post_thumbnail( array(100,100) );?> 3. Get Template Url      <?php get_template_directory(); ?> <?php get_template_directory_uri(); ?>

1
Aug

How to Prevent Your WordPress Website from Being Hacked

How to Prevent Your WordPress Website from Being Hacked Keep your WordPress website updated with the latest version of WordPress.  Wordpress is regularly upgraded with new functionality and wity security measures that help stop hackers. Use complex usernames and passwords as described above. Install security plugins such as Better WP Security.  It covers most of the wordpress vulnerabilities mentioned earlier in this

Read more

27
Jul

Woocommerce Category, Image , Description Display

<?php $all_categories = get_categories( ‘taxonomy=product_cat&hide_empty=0&hierarchical=1’ ); foreach ($all_categories as $cat) { //print_r($cat); if($cat->category_parent == 13) { $category_id = $cat->term_id; $thumbnail_id     = get_woocommerce_term_meta( $cat->term_id, ‘thumbnail_id’, true ); $image = wp_get_attachment_url( $thumbnail_id ); /*echo ‘<a href=”‘. get_term_link($cat->slug, ‘product_cat’) .’”><div>’. “Read more” .'</div></a>’;*/ ?> <li style=”width: 183px;”> <div> <h3><?php  echo $cat->name; ?></h3> <div><img src=”<?php echo $image; ?>” alt=”<?php $cat->name; ?>” width=”120″ height=”120″

Read more

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

Auto generated SKU when add product in magento

Auto generated SKU when add product in magento Open /app/design/adminhtml/default/default/template/catalog/product/edit.phtml and add the following code to the bottom of the file: <?php $dbread = Mage::getSingleton(‘core/resource’)->getConnection(‘core_read’); $sql = $dbread->query(“SELECT * FROM catalog_product_entity ORDER BY created_at DESC LIMIT 1″); $res = $sql->fetch(); ?> <script type=”text/javascript”> if(document.getElementById(‘sku’).value == “”){ document.getElementById(‘sku’).value = <?php echo (int)$res[“sku”] + 1; ?>; } </script> Note:Read the SKU (must

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