This file contains hidden or 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
# Note: VAT identification numbers for Greece use "EL", not "GR". | |
COUNTRY_CODES_EU = %w[ | |
AT BE BG CY CZ DK EE FI FR DE GR HU IE IT | |
LV LT LU MT NL PL PT RO SK SI ES SE GB | |
] |
This file contains hidden or 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
I was just recently trying to figure this problem out and I realized that the issue might be that we need a different kind of action for applying a percentage coupon against an order total. Here is my rough code... | |
<?php | |
function hook_rules_action_info() { | |
$actions['commerce_coupon_pct_apply_to_total'] = array( | |
'label' => t('Apply a percentage coupon to the order total'), | |
'parameter' => array( | |
'coupon' => array( | |
'type' => 'commerce_coupon', | |
'label' => t('Coupon'), |
This file contains hidden or 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
global $user; | |
$cart_order = commerce_cart_order_load($user->uid); | |
dpm($cart_order); | |
$order_wrapper = entity_metadata_wrapper('commerce_line_item', $cart_order); |
This file contains hidden or 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
use Behat\Mink\Exception\ElementNotFoundException; | |
/** | |
* @Given /^I select "([^"]*)" from "([^"]*)" chosen\.js select box$/ | |
*/ | |
public function iSelectFromChosenJsSelectBox($option, $select) { | |
$select = $this->fixStepArgument($select); | |
$option = $this->fixStepArgument($option); | |
$page = $this->getSession()->getPage(); |
This file contains hidden or 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
<?php | |
use Behat\Mink\Exception\ElementNotFoundException; | |
/** | |
* @Given /^I select "([^"]*)" from "([^"]*)" chosen\.js autoselect box$/ | |
*/ | |
public function iSelectFromChosenJAutoselectBox($option, $select) { | |
$select = $this->fixStepArgument($select); | |
$option = $this->fixStepArgument($option); |