- Add Product brick
- Add donation Brick for each product that you want user can choose price for
- Add JavScript brick with code (you need to correct map array to map products to donation bricks)
- Add Code to site.php
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 | |
Am_Di::getInstance()->hook->add(Am_Event::USER_MENU, function(Am_Event $e) { | |
$menu = $e->getMenu(); | |
$url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
if ($_ = $e->getDi()->linkTable->findFirstByUrl($url)) { | |
$menu->findOneById("link-{$_->pk()}")->setActive(true); | |
} | |
}); |
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 | |
Am_Di::getInstance()->hook->add(Am_Event::BEFORE_RENDER, function (Am_Event $e) { | |
if (stripos($e->getTemplateName(), 'blocks/member-main-resources.phtml') !== false) { | |
usort($e->getView()->resources, function ($a, $b) {return strtolower($a->title) <=> strtolower($b->title);}); | |
} | |
}); |
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 | |
class Am_Plugin_Dashboard extends Am_Plugin | |
{ | |
const PLUGIN_STATUS = self::STATUS_PRODUCTION; | |
const PLUGIN_COMM = self::COMM_COMMERCIAL; | |
const PLUGIN_REVISION = '@@VERSION@@'; | |
protected $_configPrefix = 'misc.'; |
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
jQuery(function(){ | |
jQuery('.am-list-subscriptions-date_expires_date, .am-list-subscriptions-date_rebill_date, .am-list-subscriptions-date_future_date').each(function(){ | |
if (jQuery(this).data('date') == '2037-12-31') return; | |
const today = new Date().toISOString().slice(0, 10) | |
const diffInDays = 1 + (new Date(jQuery(this).data('date')) - new Date(today)) / (1000 * 60 * 60 * 24); | |
jQuery(this).attr('title', jQuery(this).html()); | |
jQuery(this).html(`in ${diffInDays} ${diffInDays == 1 ? 'day' : 'days'}`); | |
}); | |
}); |
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 | |
Am_Di::getInstance()->blocks->add('login/form/before', new Am_Block_Base(null, 'og-login', null, function(Am_View $v) { | |
$meta = [ | |
'og:image' => '/path/to/image.png', | |
]; | |
$out = ''; | |
foreach ($meta as $property => $content) { | |
$out .= sprintf( |
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
.am-google-button-wrapper.am-google-login-form-after::before { | |
content: none; | |
} | |
.am-google-button-wrapper.am-google-login-form-after { | |
border: none; | |
margin:0; | |
padding:0; | |
} | |
.am-fb-signup-button-wrapper { |
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 | |
Am_Di::getInstance()->hook->add('gridPaymentInitGrid', function(Am_Event_Grid $e) { | |
$e->getGrid()->setFilter(new Am_Grid_Filter_PaymentsAdv); | |
}); | |
class Am_Grid_Filter_PaymentsAdv extends Am_Grid_Filter_Payments | |
{ | |
public function renderInputs() | |
{ |
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 | |
Am_Di::getInstance()->productTable->customFields() | |
->add(new Am_CustomFieldSingle_Checkbox('remove_sidebar', 'Remove Sidebar?')); | |
Am_Di::getInstance()->front->registerPlugin(new class extends Zend_Controller_Plugin_Abstract { | |
public function preDispatch(Zend_Controller_Request_Abstract $request) | |
{ | |
if ($request->getModuleName() == 'cart' | |
&& $request->getControllerName() == 'index' |
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 | |
function _csrf_hash($tm) | |
{ | |
$sesid = Am_Di::getInstance()->session->getId(); | |
$id = 'login'; | |
return Am_Di::getInstance()->security->hash("{$tm}:{$id}:{$sesid}", 10); | |
} | |
function _csrf_token() |
NewerOlder