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
<?php | |
/** | |
* @file | |
* Provides custom inline conditions. | |
*/ | |
/** | |
* Implements hook_inline_conditions_info(). | |
*/ | |
function lf_discounts_inline_conditions_info() { |
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
/** | |
* Coupon Form | |
* | |
* Generate a simple coupon form that accepts a coupon code or allows the user | |
* to remove that coupon code. | |
*/ | |
function MYMODULE_discounts_coupon_form($form, &$form_state) { | |
global $user; | |
$order = commerce_cart_order_load($user->uid); |
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
/** | |
* Implements hook_init() | |
*/ | |
function MYMODULE_discounts_init() { | |
// Grab the query parameters. | |
$query_parameters = drupal_get_query_parameters(); | |
// If we find a coupon code then attempt to redeem it. | |
if (!empty($query_parameters['coupon'])) { | |
_MYMODULE_discounts_redeem_coupon_code($query_parameters['coupon']); |
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
<?php | |
/** | |
* Notes: the project this was taken from attempted to limit a user to one coupon per order. | |
* Some of the logic was taken directly from commerce_coupon 2.x. | |
*/ | |
/** | |
* Implements hook_init() | |
*/ |
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
#!/bin/bash | |
if [ $(id -u) != 0 ]; then | |
printf "This script must be run as root.\n" | |
exit 1 | |
fi | |
drupal_path=${1%/} | |
drupal_user=${2} | |
httpd_group="${3:-www-data}" |
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
# Sensitive information # | |
######################### | |
# Ignore configuration files that may contain sensitive information. | |
# -- Actually going to allow settings files to be committed to git. | |
# sites/*/settings*.php | |
sites/*/settings.local.php | |
# User Generated Content # | |
########################## | |
files |