If you wont confirmation page on the finish Spree checkout flow you need override confirmation_required? as in example.
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 | |
| /* | |
| Plugin Name: Remove admin bar | |
| Author: Denis Gukov | |
| Version: 1.0 | |
| */ | |
| add_action('after_setup_theme', 'remove_admin_bar'); | |
| function remove_admin_bar() { |
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 ends_with($haystack, $needle) | |
| { | |
| $length = strlen($needle); | |
| if ($length == 0) { | |
| return true; | |
| } | |
| return (substr($haystack, -$length) === $needle); |
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
| private class HttpUploadImageTask extends AsyncTask<String, Void, Boolean> { | |
| final Bitmap imageBitmap; | |
| public HttpUploadImageTask(final Bitmap imageBitmap) { | |
| this.imageBitmap = imageBitmap; | |
| } | |
| @Override | |
| protected Boolean doInBackground(String... urls) { | |
| for (final String u : urls) { | |
| try { |
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
| Deface::Override.new(:name => "remove billing address form", | |
| :virtual_path => "spree/checkout/_address", | |
| :remove => "#billing[data-hook]" | |
| ) | |
| Deface::Override.new(:name => "remove use billing address checkbox", | |
| :virtual_path => "spree/checkout/_address", | |
| :remove => "[data-hook='use_billing']" | |
| ) |
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
| Order.class_eval do | |
| checkout_flow do | |
| go_to_state :address | |
| go_to_state :delivery | |
| go_to_state :payment, :if => lambda { payment_required? } | |
| go_to_state :confirm, :if => lambda { confirmation_required? } | |
| go_to_state :complete | |
| remove_transition :from => :delivery, :to => :confirm | |
| end | |
| end |
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
| #!/bin/sh | |
| # Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
| # CREATE block and create them in separate commands _after_ all the INSERTs. | |
| # Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
| # The mysqldump file is traversed only once. | |
| # Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
| # Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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
| #! /bin/sed -f | |
| # add begin transaction | |
| 1s/^SET .*$/END;\nBEGIN;\n/ | |
| 1s/^-- .*$/END;\nBEGIN;\n/ | |
| 1s/^/BEGIN;\n/ | |
| # remove configuration settings | |
| /^SET /d |
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
| class AddBackgroundToSpreeTaxons < ActiveRecord::Migration | |
| def change | |
| add_column :spree_taxons, :background_file_name, :string | |
| add_column :spree_taxons, :background_content_type, :string | |
| add_column :spree_taxons, :background_file_size, :integer | |
| add_column :spree_taxons, :background_updated_at, :timestamp | |
| end | |
| end |
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
| def long_word_wrap(str, options = {}) | |
| opts = { length: 10000, word_length: 10, shy_length: 4 }.merge(options) | |
| ret = '' | |
| offset = 0 | |
| str = truncate(str, length: opts[:length]) if str.length > opts[:length] | |
| m = str.match(/[^\s\n\r]{#{opts[:word_length]},}/, offset) | |
| while m | |
| ret << h(str[offset..m.begin(0)-1]) if offset < m.begin(0) | |
| s = m[0].scan(/[^\s\n\r]{1,#{opts[:shy_length]}}/) | |
| ret << s.map{ |x| h(x) }.join('­') |
OlderNewer