Skip to main content

Posts

Limit the number of cart Items in Woocommerce

There is 2 actions to check and to control if you want to limit cart items: Add to basket - When product  is added to cart Update Basket - When quantities are updated in cart page Add a custom function hooked in woocommerce_add_to_cart_validation filter hook in function.php file of your active child theme (or theme), will allow customer to restrict the cart items to 'n' max and to display a custom message when this limit is exceeded: Checking and validating when products are added to cart: Restrict Total Transaction Items: add_filter( 'woocommerce_add_to_cart_validation', 'only_n_items_allowed_add_to_cart', 10, 3 ); function only_n_items_allowed_add_to_cart( $passed, $product_id, $quantity ) { $cart_items_count = WC()->cart->get_cart_contents_count(); $total_count = $cart_items_count + $quantity; if( $cart_items_count >= n || $total_count > n ){ // Set to false $passed = false; // Display a...

Wordpress - How to do a plugin/theme conflict test?

Sometimes when you find an issue on your wordpress site with Plugin, it will be caused by a plugin or theme conflict. This can range from a simple CSS styling issue to a more complex issue where one Plugin/Theme is stopping another plugin/Theme from functioning properly. do following Steps to a conflict test: Deactivate all plugins and switch to default Twenty Fifteen theme (this will ensure site is as close to a clean install as possible). Check the site to see if issue still exists. If issue goes away after deactivating other plugins and switching theme then this means that either the theme or one of the plugins was conflicting with another plugin. If the issue still exists then it is not a plugin or theme conflict. If it turns out to be a plugin/theme conflict, then you need to activate the plugins/theme one by one until you find the plugin/theme that causes the issue to come back. Once you have identified the conflict you can report the conflict to the developers of the plu...

SEO Tips

Avoid Image: Always avoid the images.   If you absolutely MUST use Java script drop down menus, image maps or image links, be sure to put text links somewhere on the page for the spiders to follow.   Use the words "image" or "picture" in your photo ALT descriptions and captions. A lot of searches are for a keyword plus one of those words.   Content is king: Be sure to have good, well-written, and unique content that will focus on your primary keyword or keyword phrase.   Don’t try to stuff your text with keywords. It won’t work. Search engines look at how many times a term is in your content and if it is abnormally high, will count this against you rather than for you.   Proper linking: If content is king, then links are queen. Build a network of quality backlinks. Remember, if there is no good, logical reason for a site to link to you, you don’t want the link.   Make sure your site is easy to use, proper linking   Check the link...

create Instagram application, Steps to add Instagram username to sandbox, Steps to accept Instagram invitation And verification of account

Steps to create Instagram Application Log into the developer portal - Go to the Instagram Developer portal and log in with your Instagram credentials And complete the Developer Signup. Register your app - On next page that follows step 1, click Register Your Application. Fill up all the form details and Get your Client ID and Client Secret We have created the app successfully and integrated. Right now this application is in sandbox account. So if you wants to test this application in sandbox account, you need to add the Instagram username to https://www.instagram.com/developer/. Steps to add Instagram username to sandbox: Login to Instagram app using URL https://www.instagram.com/developer/ . Click on “Manage Clients”. Click on “Manage” of particular app. Go to “Sandbox” and add your username or developers username. Steps to accept  Sandbox invitation: Login to Instagram from the users account and go to https://www.instagram.com/developer/clients/sandbox_...

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.(System.Data)

This happens only for Office 2007 or higher as it requires use of OLEDB ACE drivers for connection which do not come by default in Windows and hence we need to install them in order to get rid of this error. You can solve this issue , by installing the drivers. for more information, you can visit the links below: https://blog.sqlauthority.com/2015/06/24/sql-server-fix-export-error-microsoft-ace-oledb-12-0-provider-is-not-registered-on-the-local-machine/ https://www.aspsnippets.com/Articles/The-MicrosoftACEOLEDB120-provider-is-not-registered-on-the-local-machine.aspx

Error 1061 : service cannot accept control messages at this time

This error occurred when we try to stop /reboot the service. There is a temporary mismatch between the requested control and the state of the service to be controlled. The service may be in a state of start-pending, stop-pending, or stopped. There are two ways to stop the service. 1. Go to task Manager and kill the process and try now, it will work 2. Disable the startup type and restart the server. this will disable the service.

What is the difference between smalldatetime and datetime?

DateTime SmallDateTime Storage Size 8 Bytes 4 Bytes FORMAT YYYY-MM-DD hh:mm:ss.nnn YYYY-MM-DD hh:mm:ss MIN Value 1753-01-01 00:00:00 1900-01-01 00:00:00 MAX Value 9999-12-31 23:59:59.997 2079-06-06 23:59:00 Accuracy Rounded to increments of .000, .003, or .007 second It means: If time part in the date is 23:59:58.990 or 23:59:58.991, it will be stored as 23:59:58.990. 1 Minute Second’s values that are 29.998 seconds or less are rounded down to the nearest minute. And second’s values of 29.999 seconds or more are rounded up to the nearest minute. So seconds part value is always 00.