Skip to content

Instantly share code, notes, and snippets.

@aryeharmon
Created November 10, 2015 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aryeharmon/701ef64d7061c4b88379 to your computer and use it in GitHub Desktop.
Save aryeharmon/701ef64d7061c4b88379 to your computer and use it in GitHub Desktop.
function add_index() {
$_SESSION["box"] = $_POST['value'];
}
if(isset($_SESSION["box"])){
switch ($output) {
case 1:
$boxcolor = "silver";
break;
case 2:
$boxcolor = "pink";
break;
case 3:
$boxcolor = "blue";
break;
}
global $woocommerce;
$woocommerce->cart->add_fee( __('Box Color : '.$boxcolor.'' , 'woocommerce'), 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment