Skip to content

Instantly share code, notes, and snippets.

View imranh654's full-sized avatar

Imran Hossain imranh654

  • NextEvoIT
  • Dhaka, Bangladesh
View GitHub Profile
@imranh654
imranh654 / lenura_empty_cart_before_add.php
Created October 2, 2017 19:12 — forked from viniciusrtf/lenura_empty_cart_before_add.php
WooCommerce Hook: Empty cart before adding a new product to cart WITHOUT throwing woocommerce_cart_is_empty
<?php
/**
* Hook: Empty cart before adding a new product to cart WITHOUT throwing woocommerce_cart_is_empty
*/
add_action ('woocommerce_add_to_cart', 'lenura_empty_cart_before_add', 0);
function lenura_empty_cart_before_add() {
global $woocommerce;
// Get 'product_id' and 'quantity' for the current woocommerce_add_to_cart operation
@imranh654
imranh654 / countries
Created December 21, 2020 10:42 — forked from kalinchernev/countries
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria