Skip to content

Instantly share code, notes, and snippets.

View manospsyx's full-sized avatar

Manos Psychogyiopoulos manospsyx

View GitHub Profile
@manospsyx
manospsyx / woocommerce-component-props-discount-method.php
Created February 29, 2020 21:10
Calculate discounted Component Option prices on session load.
<?php
/**
* Plugin Name: WooCommerce Composite Products - Early Discount Calculations
* Plugin URI: https://woocommerce.com/products/composite-products/
* Description: Calculate discounted Component Option prices on session load.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: https://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@manospsyx
manospsyx / woocommerce-bundles-props-discount-method.php
Last active February 29, 2020 20:33
Calculate discounted bundled cart item prices on session load.
<?php
/**
* Plugin Name: WooCommerce Product Bundles - Early Discount Calculations
* Plugin URI: https://woocommerce.com/products/product-bundles/
* Description: Calculate discounted bundled cart item prices on session load.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: https://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@manospsyx
manospsyx / woocommerce-bundles-discount-over-regular-prices.php
Last active February 29, 2020 20:33
Use this snippet to apply bundled item discounts on regular prices.
<?php
/**
* Plugin Name: WooCommerce Product Bundles - Discounts over Regular Prices
* Plugin URI: https://woocommerce.com/products/product-bundles/
* Description: Use this snippet to apply bundled item discounts on regular prices.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: https://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@manospsyx
manospsyx / wc_pb_dependency_relationship_and.php
Created December 20, 2017 12:44
Switch on AND dependency relationship in WC Product Dependencies
add_filter( 'wc_pd_dependency_relationship', 'wc_pb_dependency_relationship_and', 10, 2 );
function wc_pb_dependency_relationship_and( $relationship, $product ) {
$relationship = 'and';
return $relationship;
}
@manospsyx
manospsyx / composites_sale_status_tweak.php
Last active February 29, 2020 20:34
Use this snippet to prevent composites with component discounts from appearing as on-sale.
<?php
/**
* Plugin Name: WooCommerce Composite Products - Sale Status Tweak
* Plugin URI: https://woocommerce.com/products/composite-products/
* Description: Prevents Composite Products with component discounts from appearing as on-sale.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: https://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@manospsyx
manospsyx / woocommerce-composites-prevent-subtotals-mods.php
Last active February 29, 2020 20:35
Prevents Composite Products from modifying the appearance of cart/order item subtotals. Requires v3.7+.
<?php
/**
* Plugin Name: WooCommerce Composite Products - Prevent Cart/Order Item Subtotal Modifications
* Plugin URI: https://woocommerce.com/products/composite-products/
* Description: Prevents Composite Products from modifying the appearance of cart/order item subtotals. Requires v3.7+.
* Version: 1.1
* Author: SomewhereWarm
* Author URI: https://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@manospsyx
manospsyx / woocommerce-bundles-prevent-subtotals-mods.php
Last active February 29, 2020 20:31
Prevents Product Bundles from aggregating item subtotals in cart/order templates.
<?php
/**
* Plugin Name: WooCommerce Product Bundles - Prevent Subtotals Aggregation
* Plugin URI: https://woocommerce.com/products/product-bundles/
* Description: Prevents Product Bundles from displaying aggregated item subtotals in cart/order templates. Requires v5.5+.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: https://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@manospsyx
manospsyx / bundles-stock-cache-debug.php
Last active February 29, 2020 20:31
Use this plugin to disable the bundled item stock status caching mechanism introduced in Product Bundles v5.0+.
<?php
/**
* Plugin Name: WooCommerce Product Bundles - Disable Stock Cache
* Plugin URI: https://woocommerce.com/products/product-bundles/
* Description: Use this plugin to disable the bundled item stock status caching mechanism introduced in Product Bundles v5.0+.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: https://somewherewarm.gr/
*
* Requires at least: 4.1
@manospsyx
manospsyx / woocommerce-bundles-optional-checkbox-state.php
Last active February 29, 2020 20:32
Use this plugin to have optional bundled items checked/selected by default.
<?php
/**
* Plugin Name: WooCommerce Product Bundles - Optional Items Checked by Default
* Plugin URI: https://woocommerce.com/products/product-bundles/
* Description: Use this plugin to have optional bundled items checked/selected by default.
* Version: 1.1
* Author: SomewhereWarm
* Author URI: https://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@manospsyx
manospsyx / woocommerce-composites-autotransition.php
Last active October 13, 2020 20:22
Use this snippet to automatically move to the next step after making a valid selection.
<?php
/**
* Plugin Name: WooCommerce Composite Products - Autotransition
* Plugin URI: https://woocommerce.com/products/composite-products/
* Description: Use this snippet to automatically move to the next step after making a valid selection.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: https://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*