Mysql in NodeJs > pools, select, insert, update, delete and question marks

mysql node

Here some notes on how I do connect node and mysql Note: those note are based on the mysql packageMore info here: https://www.npmjs.com/package/mysqlInstallation: $ npm install mysqlI’m not using mysql2 nor sequelize. Disclaimer:This page contains note to how to connect node to mysql, is not meant for production and could have performance and security issues. … Read more

Git bash commands, installation and visual studio code

There are a lot of guides to use git and GitHub, link below.In this page I just put some commands and reminders. Git download and installation Download (win) : https://git-scm.com/download/win Initialize a folder directly and in visual studio code Initializing a folder means make it ready to work with git, when a folder got initialized … Read more

github SSH Keys setup on Windows 10

How to connect your git to github using ssh keys Generate the id_rsa (default) key on windows 10 Add the public key to the github website Start the agent on a git bash session Pass the key to the agent Test the connection in github Auto-log in visual studio code with your key (.ssh\config file) … Read more

Plugin Woocommerce direct logout

WooCommerce request to click on a confirmation link once click “logout”.There are two ways to bypass and remove the “Are you sure you want to log out?” link. Via Plugin I made a small plugin called Direct Logout.This plugin bypasses the WooCommerce logout confirmation link and lets you choose where to redirect the now logged-out … Read more

Hide some products form google on woocommerce

The code below hide from google a product that have a value “b2b” on a custom field.Note #1: I used a ACF function to call the custom field, but you can use get_post_metaNote#2: Required Yoast seo Will return <meta name=”robots” content=”noindex, nofollow” /> if true.If false <meta name=”robots” content=”index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1″ /> This … Read more

Duplicate the customer user roles in woocommerce via code

In particular cases, it can be useful to add a user roles group cloned.As you know the default groups in Worpress are Administrator, Editor, Author, Contributor, Subscriber.Woocommerce adds the following: Shop manager and Customer.The following code lets you create a new User Roles group base on cloning the customer roles: Questions? Suggestions? Please leave a … Read more

Remove, not hide, options from variables dropdown menu in wooCommerece’s product pages

Yesterday I had to find a way to show or remove specific options from the product variables dropdown menu.My first thought was hiding using javascript or CSS, but in the end, some browsers (like the iPhone’s safari) keep show those.If you looking at how to hide there are some interesting articles like this oneAnyway, the … Read more

Add custom fields to variation in wooCommerce admin panel

Tested on php 7.4 wp 5.5.1 wooCommerce 4.5.2 The following code add a select box on each product variation It can be called on the product page by:var_dump(get_post_meta( $available_variations[$key][‘variation_id’], ‘licence_ppl’, true )); Note that in this case i’m in a foreach [foreach ($available_variations as $key => $value) ] You can add the following type of … Read more