Woocommerce snippets

For SINGLE PRODUCTS– Skip Cart WooCommerce shopping cart altogether and send your buyers straight to the checkout page and Increase Conversions Instantly! The more steps you put your buyer through, the lower your conversions. Here are the 2 code snippets:

WooCommerce Skip Cart Code

This snippet allows the user to skip to the cart directly.

 

Change WooCommerce Add to Cart Button Text to BUY NOW!

 

Both snippet will work on WooCommerce 4 and newer.

Once you add these codes to your WooCommerce store, you’ll see that your customers will be redirected to the checkout once they click on the Buy Now button.

 

Adding ACF Options page via a plugin

Because of the possibility of plugin loading order error, it is best to use the init hook to search for acf existence and adding the options page. i.e:

 

 

Max Mega Menu – adding a custom divider

I wanted to add a “|” character in-between elements but the only option in Max Mega Menu (MMM) is to enable a divider or not but not specify a custom divider – it only uses the border-right/left settings.

Their support suggested this but stated it could cause icon alignment issues – under custom CSS in MMM:

I ended up using a javascript hack to get it done:

 

 

Npm tips

To update all dependencies in a package.json to their latest versions.. can install this globally first(just once):

and then run below which will update the versions of each dependency to the latest

finally run below to update all of the scripts to their latest. Note, this could be code breaking depending on version updates for your dependencies.