Home / Sushil_kumar (page 4)

Sushil_kumar

Compare product button in header in magento.

Compare product button in header in magento. <?php $_helper = $this->helper(‘catalog/product_compare’); $_items = $_helper->getItemCount() > 0 ? $_helper->getItemCollection() : null; ?> <div class=”com”> <strong><span><?php echo $this->__(‘Compare Products’) ?> <?php if($_helper->getItemCount() > 0): ?> <small><?php echo $this->__(‘(%d)’, $_helper->getItemCount()) ?></small> <?php endif; ?> </span></strong> <?php if($_helper->getItemCount() > 0): ?> <script type=”text/javascript”>decorateList(‘compare-items’)</script> <div …

Read More »

WooCommerce Products Custom Fields with Discount price

WooCommerce Products Custom Fields with Discount price. /***********************my custom code******************/ // Add save percent next to sale item prices. add_filter( ‘woocommerce_sale_price_html’, ‘woocommerce_custom_sales_price’, 10, 2 ); function woocommerce_custom_sales_price( $price, $product ) { $percentage = round( ( ( $product->regular_price – $product->sale_price ) / $product->regular_price ) * 100 ); echo $price . sprintf( …

Read More »

Error when reindexing Catalog URL Rewrites in magento admin

An error occurred while saving the URL rewrite magento

Error when reindexing Catalog URL Rewrites in magento admin. Follow the following steps for the reindexing Catalog URL Rewrites in magento. Open CMD or Xampp Shell Command window. see image given below[/accordion][accordion title=” Connect with database phpmyadmin MySQL.”] command is: mysql -u root -p pres enter after asked password then …

Read More »

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

How to Secure Your WordPress Admin to Restrict Access to Specific IP Address with HTACCESS?   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 %{REMOTE_ADDR} !^IP Address …

Read More »

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

How to Secure Your Magento Admin to Restrict Access to Specific IP Address with HTACCESS? 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 %{REMOTE_ADDR} !^ change here …

Read More »

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

custom_post_type

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

– shows the cart page – shows the checkout page – shows the order tracking form – 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 the logout page [woocommerce_pay] …

Read More »

How to Display Product specific category with WooCommerce ?

  How to Display Product specific category with WooCommerce ? <?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, $sc->taxonomy ); …

Read More »

WOO-COMMERCE VARIABLE PRODUCT ADD CUSTOM FIELD IN VARIATIONS FOR VENDOR PRICE AND COMMISSION PRICE ON MRP

WOO-COMMERCE VARIABLE PRODUCT ADD CUSTOM FIELD IN VARIATIONS FOR VENDOR PRICE AND COMMISSION PRICE ON MRP

Code copy and past in them functions.php , its work fine. /*************for variable product**************/ // Add Variation Settings add_action( 'woocommerce_product_after_variable_attributes', 'variation_settings_fields', 10, 3 ); /** * Create new fields for variations * */ function variation_settings_fields( $loop, $variation_data, $variation ) { // Number Field woocommerce_wp_text_input( array( 'id' => '_vendor_price[' . $variation->ID …

Read More »
0

December 9, 2016

Clear all