This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// RapidXml : http://rapidxml.sourceforge.net/ | |
#include <cstddef> | |
#include <cassert> | |
#define RAPIDXML_NO_STDLIB | |
#define RAPIDXML_NO_EXCEPTIONS | |
#include "rapidxml-1.13/rapidxml.hpp" | |
#include <stdio.h> | |
#include <string> | |
#include <vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check for clear-cart get param to clear the cart, append ?clear-cart to any site url to trigger this | |
add_action( 'init', 'woocommerce_clear_cart_url' ); | |
function woocommerce_clear_cart_url() { | |
if ( isset( $_GET['clear-cart'] ) ) { | |
global $woocommerce; | |
$woocommerce->cart->empty_cart(); | |
} | |
} |