In this post you’ll learn how to create a WooCommerce product addon checkbox for single and variable products – from scratch, without a plugin!
Add a Product Addon Checkbox to WooCommerce Single & Variable Products – Tutorial

In this post you’ll learn how to create a WooCommerce product addon checkbox for single and variable products – from scratch, without a plugin!
Normally when you create copies of objects in JS you end up with a shallow copy, where nested objects are copied by reference. Here’s how to make a deep clone.
It’s pretty easy to make an object in JavaScript once you know the syntax, but if you want to make more than one of the same type of object, it’s better to do it from some kind of blueprint. This post is all about factory functions!
In Javascript, assigning an object to another variable won’t create a copy of that object. Here are 3 methods that will successfully clone a JS object.