Home / 2016

Yearly Archives: 2016

An error occurred while saving the URL rewrite magento

Error when reindexing Catalog URL Rewrites in magento admin

[tblock anim=”swing” tcuscolor=”#0022ff” title=”Error when reindexing Catalog URL Rewrites in magento admin” tag=”h2″/] [tblock anim=”bounceOutDown” tcuscolor=”#962e2e” title=” Follow the following steps for the reindexing Catalog URL Rewrites in magento:” tag=”h4″/] [accordiongroup type=”1″ anim=”rubberBand” ][accordion title=”Open CMD or Xampp Shell Command window.”]see image given below[/accordion][accordion title=” Connect with database phpmyadmin MySQL.”] …

Read More »

How to Secure Your WordPress Admin to Restrict Access to Specific IP Address with HTACCESS?

[tblock anim=”swing” tcuscolor=”#7700ff” title=”How to Secure Your WordPress Admin to Restrict Access to Specific IP Address with HTACCESS?” tag=”h2″/] Copy and paste the code in .htaccess file. ErrorDocument 401 /path-to-your-site/index.php?error=404 ErrorDocument 403 /path-to-your-site/index.php?error=404 <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR] RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$ RewriteCond %{REMOTE_ADDR} !^IP Address One$ RewriteCond …

Read More »

How to Secure Your Magento Admin to Restrict Access to Specific IP Address with HTACCESS?

[tblock anim=”pulse” tcuscolor=”#005eff” title=”How to Secure Your Magento Admin to Restrict Access to Specific IP Address with HTACCESS?” tag=”h1″/] Copy the code and past in .htaccess file and change the ip with you. RewriteCond %{REQUEST_URI} ^/(index.php/)?admin/ [NC] RewriteCond %{REMOTE_ADDR} !^196.196.196.196 RewriteRule ^(.*)$ http://%{HTTP_HOST}/ [R=302,L] Example: RewriteCond %{REQUEST_URI} ^/(index.php/)?youradminname/ [NC] RewriteCond …

Read More »
custom_post_type

How to Creating a Custom Post Type for product, slider, portfolio or News Sections in wordpress or Woocommerce

Copy and paste the code in functions.php function my_custom_post_product() { $args = array(); register_post_type( 'product', $args ); } add_action( 'init', 'my_custom_post_product' ); <?php function my_custom_post_product() { $labels = array( 'name' => _x( 'Products', 'post type general name' ), 'singular_name' => _x( 'Product', 'post type singular name' ), 'add_new' => _x( …

Read More »

WooCommerce All Shortcodes List here

[woocommerce_cart] – shows the cart page [woocommerce_checkout] – shows the checkout page [woocommerce_order_tracking] – shows the order tracking form [woocommerce_my_account] – shows the user account page [woocommerce_edit_account] – Edit account pages [woocommerce_change_password] – shows the change password page [woocommerce_view_order] – shows the user account view order page [woocommerce_logout] – shows …

Read More »

How to Display Product specific category with WooCommerce ?

[tblock tcuscolor="#444" title="How to Display Product specific category with WooCommerce ?" tag="h3"/] <?php $cate = get_queried_object(); $cateID = $cate->term_id; $args = array( 'hierarchical' => 1, 'show_option_none' => '', 'hide_empty' => 0, 'parent' => $cateID, 'taxonomy' => 'product_cat' ); $subcats = get_categories($args); foreach ($subcats as $sc) { $link = get_term_link( $sc->slug, …

Read More »
woocommerce-product-variation-grid-table

WooCommerce Product Variations Grid or Table form with add to cart button

[tblock anim=”rubberBand” tcuscolor=”#9900ff” title=”WooCommerce Product Variations Grid or Table form with add to cart button” tag=”h3″/] Copy and Paste the code in your theme function.php function find_valid_variations() { global $product; $variations = $product->get_available_variations(); $attributes = $product->get_attributes(); $new_variants = array(); // Loop through all variations foreach( $variations as $variation ) { …

Read More »

Create swtch color on product list page in Magento

Copy and past the code . where you want to display color  below the name or above the name. follow the following steps: images updated in configurable simple product  acording to color . Change Visibility *: catalog search  List.phtml <? if($_product->getTypeId() == "configurable"): $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product); $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions(); foreach($simple_collection …

Read More »

Magento: How to check if current page is homepage?

1.) // Put your homepage-only code in here. 2.) if($this->getIsHomePage()) { echo 'You are in Homepage!'; } else { echo 'You are NOT in Homepage!'; } 3.) $routeName = Mage::app()->getRequest()->getRouteName(); $identifier = Mage::getSingleton('cms/page')->getIdentifier(); if($routeName == 'cms' && $identifier == 'home') { echo 'You are in Homepage!'; } else { echo …

Read More »