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 | |
| /** | |
| * Default shipping during checkout | |
| * This snippet when added to the pre_action will allow you to default shipping selection. | |
| * | |
| * This is mostly useful when there is only one shipping option, this allows you to skip | |
| * the shipping step of checkout entirely, simplifying things for your customers. | |
| * | |
| * This has been updated to use a dynamic method of pulling the first available shipping | |
| * option from your list of available shipping options. |
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 | |
| if(!Phpr::$security->getUser()) | |
| { | |
| Phpr::$response->redirect(root_url('/')); | |
| }else | |
| { | |
| $cache = Phpr::$config->get('CACHING',array()); | |
| if(isset($cache['PARAMS']) && isset($cache['PARAMS']['CACHE_DIR'])) |
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
| g_LastCtrlKeyDownTime := 0 | |
| g_AbortSendEsc := false | |
| g_ControlRepeatDetected := false | |
| *CapsLock:: | |
| if (g_ControlRepeatDetected) | |
| { | |
| return | |
| } |
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
| <textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea> | |
| ... | |
| <textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea> | |
| ... | |
| <script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script> | |
| <script> | |
| // Hook up ACE editor to all textareas with data-editor attribute | |
| $(function () { |
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 | |
| print_r( Phpr_SecurityFramework::create()->get_config_content() ); | |
| ?> |
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
| arrogance: | |
| inbox: feedback | |
| conversation: arrogance | |
| sender: hater (Contact) | |
| subject: Less arrogance! | |
| excerpt: You guys really shouldn't be so arrogant! | |
| bug: | |
| inbox: security | |
| conversation: bug |
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
| <form action="/cart/add" method="post"> | |
| {% if product.variants.size > 1 %} | |
| {% if product.options[0] %} | |
| {% assign used = '' %} | |
| <label for="select-one">{{ product.options[0] }}</label> | |
| <select id='select-one' onchange="letsDoThis()"> | |
| {% for variant in product.variants %} | |
| {% unless used contains variant.option1 %} | |
| <option value="{{ variant.option1 }}">{{ variant.option1 }}</option> | |
| {% capture used %}{{ used }} {{ variant.option1 }}{% endcapture %} |
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 | |
| $obj = new Shop_Product(); | |
| $obj->select('shop_products.id, sum(shop_order_items.quantity) AS "sold"'); | |
| $obj->join('shop_order_items', 'shop_products.id = shop_order_items.shop_product_id'); | |
| $obj->join('shop_orders', 'shop_order_items.shop_order_id = shop_orders.id'); | |
| $best_selling = $obj->where('shop_orders.payment_processed IS NOT NULL')->group('shop_products.id')->find_all(); |
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 | |
| /********************************************************************************************* | |
| * Example usage (In view) | |
| * <div class="welcome"> | |
| <?php echo Form::open(array('route'=>'process','class'=>'form-horizontal'))?> | |
| <?php echo Form::textField('first_name')?> | |
| <?php echo Form::textField('last_name')?> | |
| <?php echo Form::emailField('email')?> | |
| <?php echo Form::passwordField('password')?> | |
| <?php echo Form::selectField('select_one', array('1'=>'abc', '2'=>'def'))?> |
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
| // config -> settings.html | |
| // Make sure you have the same number of quantity breaks as product variants | |
| <fieldset> | |
| <legend>Quantity Breaks</legend> | |
| <table class="standard-table"> | |
| <tr><td>Enter quantity breaks in ascending order separated by a comma (e.g. 5, 10, 20, 50)</td><td><input type="text" name="breaks" size="50" /></td></tr> | |
| </table> | |
| </fieldset> | |