- 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()->router->addRoute('aff-autocomplete', new Am_Mvc_Router_Route('aff/admin/autocomplete', [ | |
| 'module' => 'default', | |
| 'controller' => 'admin-aff-autocomplete', | |
| 'action' => 'index', | |
| ])); | |
| class AdminAffAutocompleteController extends Am_Mvc_Controller | |
| { |
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 | |
| //replace standard menu with affiliate specific if currently logged in user is affiliate | |
| $di = Am_Di::getInstance(); | |
| if ($di->auth->getUserId() && $di->auth->getUser()->is_affiliate) { | |
| $n = new Am_Navigation_User(); | |
| $n->addMenuPages('_aff'); | |
| $di->setService('navigationUser', $n); | |
| } |
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 | |
| // Add Filter {Active|Expired|All} for invoices on payment history page | |
| Am_Di::getInstance()->blocks->add( | |
| 'member/payment-history/top', | |
| new Am_Block_Base(null, 'inv-filter', null, function(Am_View $v) { | |
| $user = $v->di->user; | |
| $ids = $v->di->db->selectCol(<<<CUT |
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() |
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 | |
| 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
| .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()->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
| 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'}`); | |
| }); | |
| }); |