type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
<?php | |
/** | |
* @file | |
* Demo module, Basic Ajax form submit (Ajax framework). | |
*/ | |
/** | |
* Implements hook_menu(). | |
*/ |
$product_array = array(); | |
foreach ($vars['field_product'] as $product) { | |
$product_array[] = $product['product_id']; | |
} | |
$products = commerce_product_load_multiple( | |
$product_array, | |
array("status"=>1) | |
); | |
// testing... | |
echo "<pre>"; |
<?php | |
foreach ($node->field_product['und'] as $key => $product_array) { | |
if ( !empty($product_array) ) { | |
$product = commerce_product_load($product_array['product_id']); | |
$largeimg = image_style_url('large', $product->field_image['und'][0]['uri']); | |
echo $largeimg; | |
} | |
} | |
?> |
/* | |
* Bootstrap override | |
* make dropdown menus do dropdown on hover, | |
* and allow parent link to be clickable | |
*/ | |
// place this in your styles | |
ul.nav li.dropdown:hover > ul.dropdown-menu{ | |
display: block !important; | |
} |
<?php | |
// order. | |
$order_wrapper = entity_metadata_wrapper('commerce_order', $order); | |
// Order id. | |
$order_id = order_wrapper->order_id->value(); | |
// User detils. |
<?php | |
/** | |
* Creates an order for the given user containing the product with the given id. | |
* This example may be extended easily to create an order containing several | |
* products, a shipping and so far. | |
* | |
* Returns a commerce order that's now saved in the database with the status | |
* "processing and can be finished by an administrator in the UI. | |
* Throws an exception, if something is wrong. |
<?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() | |
*/ |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
Find MAMP's installed PHP version(s) you want to use the PHP CLI for:
$ ls -l /Applications/MAMP/bin/php/
.bash_profile
in edit mode, in order to add aliases for accessing the PHP CLI locally$ pico ~/.bash_profile
source_index=source_index | |
target_index=target_index | |
elastic_search_server=elasticsearch:9200 | |
# Make sure the source index is actually open | |
curl -X POST "${elastic_search_server}/${source_index}/_open" | |
# Put the source index in read-only mode | |
curl -X PUT "${elastic_search_server}/${source_index}/_settings" \ |