WordPress Archives - Elvin Lee https://elvinlee.my/category/wordpress/ Learning is the discovery that something is possible. Thu, 21 Jul 2016 03:39:57 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 WooCommerce Change Currency Symbol https://elvinlee.my/woocommerce-change-currency-symbol/ https://elvinlee.my/woocommerce-change-currency-symbol/#respond Wed, 15 Jun 2016 03:20:31 +0000 https://elvinlee.my/?p=284 Currency Symbol Quite a lot country currency is $ (Dollar). When setup WooCommerce, some business owners will setup the currency which is $, it’s quite complicated when customer confuse about $ is belong to United States Dollar, Australian Dollar, Hong Kong Dollar, Singapore Dollar or others? HTML Number According ASCII-CODE website, HTML Number of $ […]

The post WooCommerce Change Currency Symbol appeared first on Elvin Lee.

]]>
Currency Symbol

Quite a lot country currency is $ (Dollar). When setup WooCommerce, some business owners will setup the currency which is $, it’s quite complicated when customer confuse about $ is belong to United States Dollar, Australian Dollar, Hong Kong Dollar, Singapore Dollar or others?

HTML Number

According ASCII-CODE website, HTML Number of $ is [ $ ]. So we need use $ for the symbol of dollar.
Dollar Symbol HTML Number

WooCommerce Change Currency Symbol

For example, we want change the currency symbol of Singapore Dollar $ to S$, what we need is add the coding below to functions.php

// Change Currency Symbol
add_filter( 'woocommerce_currency_symbol', 'change_currency_symbol', 10, 2 );
function change_currency_symbol( $symbols, $currency ) {
	if ( 'SGD' === $currency ) {
		return 'S$';
	}
        return $symbols;
}

Result:
Cart After Change Currency Symbol

WooCommerce Change Currency Symbol
Please do hesitate to contact me if you found out any mistake or typo.

The post WooCommerce Change Currency Symbol appeared first on Elvin Lee.

]]>
https://elvinlee.my/woocommerce-change-currency-symbol/feed/ 0
WooCommerce Remove Sidebar https://elvinlee.my/woocommerce-remove-sidebar/ https://elvinlee.my/woocommerce-remove-sidebar/#respond Wed, 13 May 2015 07:58:30 +0000 https://elvinlee.my/?p=250 Remove Sidebar This is a snippet to remove all WooCommerce page sidebar. By this snippet, it will only remove the sidebar. You still need to edit style.css to set the width of main to 100%. This is a method using hook instead of edit the template file. Paste below coding at your theme’s function.php //WooCommerce […]

The post WooCommerce Remove Sidebar appeared first on Elvin Lee.

]]>
Remove Sidebar

This is a snippet to remove all WooCommerce page sidebar. By this snippet, it will only remove the sidebar. You still need to edit style.css to set the width of main to 100%. This is a method using hook instead of edit the template file.

Paste below coding at your theme’s function.php

//WooCommerce Remove Sidebar 
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );

Now, sidebar at all WooCommerce is been removed. You also need to add this coding to your child theme style.css. Some themes are not working. You need to find out the div class or id to set.

Paste below coding at your theme’s style.css

/* WooCommerce Remove Sidebar, Main Width 100% */
.tax-product_cat #main {
	width: 100%;
} 

For sure, you may leave a comment so that we could discuss about how to edit the css of your WordPress theme if you can’t set the main width successful.

WooCommerce Remove Sidebar
Please do hesitate to contact me if you found out any mistake or typo.

The post WooCommerce Remove Sidebar appeared first on Elvin Lee.

]]>
https://elvinlee.my/woocommerce-remove-sidebar/feed/ 0
WooCommerce Show Product Total Quantity https://elvinlee.my/woocommerce-show-product-total-quantity/ https://elvinlee.my/woocommerce-show-product-total-quantity/#comments Wed, 21 Jan 2015 02:19:27 +0000 https://elvinlee.my/?p=237 Product Total Quantity If customers add quite a lot products to cart, when they view the cart, they are difficult to find out total how many they added to cart. Or, if there is a situation: Purchase any product, get 20% discount if more than 100 pieces. Customers need to know how many they have […]

The post WooCommerce Show Product Total Quantity appeared first on Elvin Lee.

]]>
Product Total Quantity

If customers add quite a lot products to cart, when they view the cart, they are difficult to find out total how many they added to cart.

Or, if there is a situation: Purchase any product, get 20% discount if more than 100 pieces. Customers need to know how many they have added to cart.

Here is the coding to show total how many products added to cart:

<?php global $woocommerce; ?>
<?php echo sprintf(_n('%d', '%d', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?>

I added the coding before Cart Subtotal, you may add to any place you want.

<tr class="cart-subtotal">
	<th><?php _e( 'Product Quantity', 'woocommerce' ); ?></th>
	<td><?php global $woocommerce; ?><?php echo sprintf(_n('%d', '%d', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?></td>
</tr>

Show in Cart Page

To show the total quantity in cart page, you need to copy /plugins/woocommerce/templates/cart/cart-totals.php to your child theme /woocommerce/cart/ to prevent any error.

Result:
WooCommerce Show Product Total Quantity

Show in Checkout Page

To show the total quantity in checkout page, you need to copy /plugins/woocommerce/templates/checkout/review-order.php to your child theme /woocommerce/checkout/ to prevent any error.

Result:
WooCommerce Show Product Total Quantity Checkout Page

External Link: WooCommerce – Show number of items in cart and total

WooCommerce Show Product Total Quantity
Please do hesitate to contact me if you found out any mistake or typo.

The post WooCommerce Show Product Total Quantity appeared first on Elvin Lee.

]]>
https://elvinlee.my/woocommerce-show-product-total-quantity/feed/ 2
WooCommerce Show Save How Many Percentage https://elvinlee.my/woocommerce-show-save-how-many-percentage/ https://elvinlee.my/woocommerce-show-save-how-many-percentage/#respond Thu, 13 Nov 2014 02:33:18 +0000 https://elvinlee.my/?p=222 With WooCommerce Snippet When using WooCommerce, some users would like to set the item with a sale price. Default WooCommerce just strikethrough the regular price and show only sale price. Customers don’t know how many actually they save. With this WooCommerce snippet, it will show how many percentage they sale from a regular price. Paste […]

The post WooCommerce Show Save How Many Percentage appeared first on Elvin Lee.

]]>
With WooCommerce Snippet

When using WooCommerce, some users would like to set the item with a sale price. Default WooCommerce just strikethrough the regular price and show only sale price. Customers don’t know how many actually they save. With this WooCommerce snippet, it will show how many percentage they sale from a regular price.

Paste below coding at your theme’s function.php

<?php
add_filter( 'woocommerce_sale_price_html', 'woocommerce_sales_price_percentage', 10, 2 );
function woocommerce_sales_price_percentage( $price, $product ) {
	$percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 );
	return $price . sprintf( __(' - Save %s', 'woocommerce' ), $percentage . '%' );
}
?>

Result:
WooCommerce Show Save How Many Percentage

Show Percentage Is More Attractive

Now, the percentage of discount is displayed next to sale price. Customers able to know how many actually they save from a regular price. With percentage of discount, it’s more attractive!

External Link: WooCommerce Percentage Saved Sale Price

WooCommerce Show Save How Many Percentage
Please do hesitate to contact me if you found out any mistake or typo.

The post WooCommerce Show Save How Many Percentage appeared first on Elvin Lee.

]]>
https://elvinlee.my/woocommerce-show-save-how-many-percentage/feed/ 0
What is WordPress Child Theme? Why We Need Child Theme? https://elvinlee.my/wordpress-child-theme-need-child-theme/ https://elvinlee.my/wordpress-child-theme-need-child-theme/#respond Mon, 09 Sep 2013 08:15:49 +0000 https://elvinlee.my/?p=126 What is WordPress Child Theme? A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of the parent theme. WordPress Child Theme is a WordPress theme that inherits its functionality from another WordPress theme (mostly parent theme). […]

The post What is WordPress Child Theme? Why We Need Child Theme? appeared first on Elvin Lee.

]]>
WordPress Child Theme

What is WordPress Child Theme?

A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of the parent theme.

WordPress Child Theme is a WordPress theme that inherits its functionality from another WordPress theme (mostly parent theme). A child theme allows us change the functionality of the theme without edit the original theme template files. With this, we won’t be losing the ability to update the theme.

Why We Need WordPress Child Theme?

Developers like to use child theme to speed up their development. A good parent theme usually contains its own action hooks and filters. This allows developers to create a robust custom WordPress site using child theme in a short time.

Most DIY users create a child theme to tweak an existing theme without losing the ability to update the parent them if needed. They can modify the styles of elements by editing the style.css in child theme.

There are few advantages to use a WordPress Child Theme:

1. Updates
By using a child theme, users can update the parent theme safely because all of the modifications are saved in the child theme.

2. Extend
Users can add new functionality and much more by using a child theme. Users able to tweak a parent theme based on their requirement.

External Link: How to Create a Child Theme

Please do hesitate to contact me if you found out any mistake.

The post What is WordPress Child Theme? Why We Need Child Theme? appeared first on Elvin Lee.

]]>
https://elvinlee.my/wordpress-child-theme-need-child-theme/feed/ 0
Why WordPress? https://elvinlee.my/why-wordpress/ https://elvinlee.my/why-wordpress/#respond Mon, 26 Aug 2013 03:51:50 +0000 https://elvinlee.my/?p=91 Sometimes, people will ask, why we want use WordPress to build up a content management system (CMS), official website or blog. Why we need it? WordPress is web software that can use to create a beautiful website or blog. People like to say that WordPress is both free and priceless at the same time. WordPress […]

The post Why WordPress? appeared first on Elvin Lee.

]]>
Why-WordPress

Sometimes, people will ask, why we want use WordPress to build up a content management system (CMS), official website or blog. Why we need it? WordPress is web software that can use to create a beautiful website or blog. People like to say that WordPress is both free and priceless at the same time. WordPress started as just a blogging system, but has evolved to be used as full content management system (CMS) and so much more through the thousands of plugins and widgets and themes. WordPress is limited only by your imagination, the customization opportunities are endless.

1. Free and Open Source
WordPress is completely free. It can be used on any personal or commercial projects without any restrictions.

2. User Friendly
WordPress designed for anyone, not just developers. There are written and recorded manuals available for users to easily learn how to use WordPress. “If you can do it in Word, you can do it in WordPress”, that’s true! Paste from Word too, the statement is more true than you would imagine. The Visual Editor also called WYSIWYG, is a system which content (text and images) displayed onscreen during editing appears in a form closely corresponding to its appearance when displayed as a finished post.

3. Plugins
Plugins allow users to add awesome photo galleries, sliders, shopping carts, forums, maps, and more great functionality. Those plugins can make users’ dreams come true. Most of the plugins are just clicked and installed.

4. Themes
There are a lot of themes available for WordPress, free or premium. Users will never have a problem finding a right theme for themes.

The post Why WordPress? appeared first on Elvin Lee.

]]>
https://elvinlee.my/why-wordpress/feed/ 0