Skip to content

Instantly share code, notes, and snippets.

// $product - WC_Product
// $qty - pass huge amount to see lowest prcie for bulk
function adpGetMinBulkPriceOfProduct($product, $qty)
{
$processedProduct = adp_functions()->calculateProduct($product, $qty);
if ($processedProduct instanceof \ADP\BaseVersion\Includes\PriceDisplay\ProcessedProductSimple) {
return $processedProduct->getMinDiscountRangePrice();
} else {
class AdpWcOrderEditExtensions
{
public function __construct()
{
}
public function register()
{
add_action('woocommerce_admin_order_item_values', [$this, "printRowItem"], 10, 3);
add_action("woocommerce_admin_order_item_headers", [$this, "addHeader"], 10, 1);
// Export Products as columns
// Format - XLS
// Checked - Output column titles as first line
// Button - Export w/o Progressbar
class Woe_Product_Columns {
var $columns_per_product = 2;
function __construct() {
//add settings, , skip products
add_action("woe_settings_above_buttons", array($this,"draw_options") );
add_filter("woe_settings_validate_defaults",array($this,"skip_products"),10,1);
@alexv66
alexv66 / hide-cod-payment-method-at-front.php
Created February 10, 2021 05:53
hide "cod" payment method at frontend checkout page
// hide "cod" payment method at frontend checkout page
add_filter( 'woocommerce_available_payment_gateways', function( $available_gateways ) {
if ( !is_admin() )
unset($available_gateways['cod']);
return $available_gateways;
});
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* @var string $header_html
* @var array $table_header
* @var array $rows
* @var string $footer_html
<?php // only copy this line if needed!
/**
* Filter the Jilt financial status for the order.
*
* @param string $status the financial status
* @param int $order_id the order's ID
* @return string updated status
*/
@alexv66
alexv66 / woe_product_shipping_taxes.php
Created December 12, 2019 07:23
Export taxes , group by name. You must edit 2nd line!
class WOE_add_product_shipping_taxes{
var $taxes = array("CGST","SGST","IGST");
function __construct() {
add_filter('woe_get_order_fields', array($this,'add_order_fields'), 10, 1);
add_filter('woe_get_order_product_fields', array($this,'add_product_fields'), 10, 2);
add_filter('woe_fetch_order', array($this,'fill_shipping_taxes'), 10, 2);
add_filter('woe_fetch_order_product',array($this,'fill_product_taxes'), 10, 5);
}
// Export Products as columns
// Format - XLS
// Checked - Output column titles as first line
// Button - Export w/o Progressbar
class Woe_Product_Columns {
var $columns_per_product = 3;
function __construct() {
//add settings, , skip products
add_action("woe_settings_above_buttons", array($this,"draw_options") );
@alexv66
alexv66 / woocommerce-email-new-address.php
Last active May 18, 2018 13:09 — forked from BFTrick/woocommerce-email-new-address.php
Email the site admin when a customer changes their address, adapted for Woocommerce 3.3.x
<?php
/**
* Plugin Name: WooCommerce Email Customer Address
* Plugin URI: https://gist.github.com/BFTrick/7891074
* Description: Email the site admin when a customer changes their address
* Author: Patrick Rauland
* Author URI: http://patrickrauland.com/
* Version: 1.0.1
*
* This program is free software: you can redistribute it and/or modify