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 | |
// Get the "Add to cart" array ready for rendering. | |
$add_to_cart = array( | |
'#theme' => 'uc_product_add_to_cart', | |
'#form' => drupal_get_form('uc_product_add_to_cart_form_' . $node->nid, $node), | |
); | |
/* | |
* Check the database to see the Stock availability of the product. | |
*/ | |
if(uc_stock_is_active($node->model)){ |
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 | |
/* | |
* This gist utilizes Yahoo's Weather API to snag the current | |
* weather conditions for any country given it's WOEID. | |
* | |
* - by Carwin Young | |
*/ | |
/* Set up some location WOEIDs */ | |
$Cambodia = 1020985; /* Phnom Pneh */ |
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 | |
/* | |
* Implementation of hook_webform_submission_presave() | |
* | |
* For a particular Webform node, use the submitted | |
* value of a component to determine whether or not | |
* the submitter will be subscribed to a Simplenews | |
* newsletter. | |
* | |
* Subscribe the user to the Simplenews newsletter |
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 | |
function modulename_form_alter(&$form, $form_state, $form_id) { | |
switch ( $form_id ) { | |
case 'uc_cart_view_form': | |
/* | |
* This is how you can remove the "remove" | |
* button for each item. | |
*/ | |
foreach($form['items'] as $k => $v ) { | |
if(is_integer($k) && isset($v['remove'])) { |
NewerOlder