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
* Plugin URI: https://woocommerce.com/products/product-bundles/
* Description: Use this snippet to change the bundle sells layout to tabular
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Developer: Jason Kytros
*
* Requires at least: 2.6.0
* Tested up to: 5.7
*
<?php
/**
* Plugin Name: WooCommerce Product Bundles.
* Plugin URI: https://woocommerce.com/products/product-bundles/
* Description: Use this snippet to change the bundle sells layout to grid
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Developer: Jason Kytros
*
<?php
/**
* Plugin Name: WooCommerce Product Bundles.
* Plugin URI: https://woocommerce.com/products/product-bundles/
* Description: Use this snippet to hide the bundled sells short description
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Developer: Jason Kytros
*
<?php
/**
* Plugin Name: WooCommerce Product Bundles.
* Plugin URI: https://woocommerce.com/products/product-bundles/
* Description: Use this snippet to hide the remaining stock of the parent item
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Developer: Jason Kytros
*
<?php
/**
* WC_CSP_Condition_Day_of_Week class -- This is an example of a custom condition.
*
* @author WooCommerce
* @package WooCommerce Conditional Shipping and Payments
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
<?php
/**
* Plugin Name: WooCommerce Conditional Shipping and Payments - Custom Condition loader.
* Plugin URI: https://woocommerce.com/products/conditional-shipping-and-payments/
* Description: Use this plugin to load a custom condition.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Developer: Jason Kytros
*
curl -X PUT https://somewherewarm.test/support/wp-json/wc/v3/orders/68 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"gift_cards": [
{
"code": "EEEE-EEEE-EEEE-EEEE",
"amount": 40 // Gift card cannot be applied, process stops here
},
{
curl -X PUT https://somewherewarm.test/support/wp-json/wc/v3/orders/68 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"gift_cards": [
{
"code": "KKKK-KKKK-KKKK-KKKK",
"amount": 0 // Deletes gift card, remaining order total becomes 70
},
{
curl -X PUT https://somewherewarm.test/support/wp-json/wc/v3/orders/68 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"gift_cards": [
{
"code": "KKKK-KKKK-KKKK-KKKK",
"amount":60
}
]
curl -X PUT https://somewherewarm.test/support/wp-json/wc/v3/orders/68 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"gift_cards": [
{
"code": "ΧΧΧΧ-ΧΧΧΧ-ΧΧΧΧ-ΧΧΧΧ",
"amount":30 // Remaining order total becomes $70
},
{