Skip to content

Instantly share code, notes, and snippets.

View somewherewarm-snippets's full-sized avatar

SomewhereWarm Support somewherewarm-snippets

  • WooCommerce
  • Athens
View GitHub Profile
curl -X PUT https://example.com/wp-json/wc/v3/products/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"addons": [
{
"id": 1719406272
},
{
"id": 1719406273
curl -X PUT https://example.com/wp-json/wc/v3/products/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"addons": [
{
"id": 1719406272
},
{
"id": 1719406273
curl -X PUT https://example.com/wp-json/wc/v3/products/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"addons": [
{
"id": 1719406272,
"name": "Handmade Engraving",
"price": "120",
"max": 12
curl -X POST https://example.com/wp-json/wc/v3/products \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"name": "Happiness Ring",
"type": "simple",
"regular_price": "21.99",
"description": "Beautiful ring that will make you happy.",
"exclude_global_add_ons": true,
"addons": [
curl -X PUT https://example.com/wp-json/wc-product-add-ons/v2/global-add-ons/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"fields": [
{
"id": 1719406272
},
{
"id": 1719406273
curl -X PUT https://example.com/wp-json/wc-product-add-ons/v2/global-add-ons/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"fields": [
{
"id": 1719406272
},
{
"id": 1719406273
curl -X PUT https://example.com/wp-json/wc-product-add-ons/v2/global-add-ons/123 \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"name": "Personalization Options for rings",
"restrict_to_category_ids": [
22
],
"fields": [
{
curl -X POST https://example.com/wp-json/wc-product-add-ons/v2/global-add-ons \
-u customer_key:customer_secret \
-H "Content-Type: application/json" \
-d '{
"name": "Personalization Options",
"priority": 5,
"restrict_to_category_ids": [],
"fields": [
{
"name": "Engraving",
@somewherewarm-snippets
somewherewarm-snippets / class-wc-calypso-bridge-my-custom-fix.php
Last active February 20, 2023 11:25
Boilerplate of a singleton controller for adding custom fixes into the WooCommerce Calypso Bridge plugin
<?php
/**
* Custom fix controller class.
*
* @package WC_Calypso_Bridge/Classes
* @since x.x.x
* @version x.x.x
*/
defined( 'ABSPATH' ) || exit;
<?php
/**
* Plugin Name: WooCommerce Min/Max Quantities - Do not count product quantity/value in Order quantity/value rules.
* Plugin URI: https://woocommerce.com/products/minmax-quantities/
* Description: Use this plugin to ignore the quantity/price of a product when checking the Order quantity/value rules.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Developer: Jason Kytros
*