Skip to content

BoltApp/bolt-magento1

Repository files navigation

Bolt Magento1 Plugin

Release CircleCI

Plugin to integrate Bolt with Magento

See CHANGELOG.md for change history.

Supported Magento versions

  • 1.7
  • 1.9

Supported PHP versions

5.4+

Installation guide

Magento 1 plugin installation guide

Run tests

Run the following from root magento folder:

php tests/unit/phpunit-5.7.9.phar --stderr --report-useless-tests -c tests/unit/phpunit.xml

Run phpunit test with coverage html report:

php tests/unit/phpunit-5.7.9.phar --stderr --report-useless-tests -c tests/unit/phpunit.xml --coverage-html tests/unit/coverage

If you prefer to run test through PHPStorm, please read:

http://devdocs.magento.com/guides/v2.2/test/unit/unit_test_execution_phpstorm.html

Modman guide

Our extension is set up for local development with modman.

To install modman, see the installation instructions here.

Once modman is installed, change directory to your root Magento installation and run:

modman init

This will create an empty .modman folder in the Magento root directory. Then clone the repo by running:

modman clone git@github.com:BoltApp/bolt-magento1.git

This will download the Bolt repository and symlink the modman Bolt files to the symlinked Magento files. If you would like to pull the latest Bolt code from the Git repo and update Magento, simply run:

modman update

Custom Bolt Standard Event Reference

Name Area Description Parameters
bolt_boltpay_order_creation_before global Entry-point for applying any pre-conditions prior to the conversion of a Bolt order to Magento order immutableQuote
Mage_Sales_Model_Quote
the Magento cart copy of the Bolt order

parentQuote
Mage_Sales_Model_Quote
the original Magento cart session

transaction
object
Bolt payload
bolt_boltpay_order_creation_after global Allows for post order creation actions to be applied exclusively to Bolt orders order
Mage_Sales_Model_Order
the converted and saved Magento order

quote
Mage_Sales_Model_Quote
the immutable quote

transaction
object
Bolt payload
bolt_boltpay_validation_pre_order_commit_before global Entry-point for applying any changes to a converted Magento order just prior to the order being saved in Magento. Warning: $order->save() should not be called from this event order
Mage_Sales_Model_Order
the converted Bolt order in Magento format prior to saving it to Magento
bolt_boltpay_validation_pre_order_commit_after global Allows for adjusting the Magento order immediately after it has been validated and just prior to being persisted. Warning: $order->save() should not be called from this event order
Mage_Sales_Model_Order
the converted and saved Magento order
bolt_boltpay_shipping_estimate_before global Performed before all shipping and tax estimates are calculated. Custom environment state initialization logic can be set here. quote
Mage_Sales_Model_Quote
the immutable quote

transaction
object
Bolt payload
bolt_boltpay_shipping_method_applied_before global Executed prior to a specific shipping method is applied to quote for shipping and tax calculation. This is used for setting any shipping method specific conditions. Shipping method can be prevented from being added to Bolt by setting quote->setShouldSkipThisShippingMethod(true). quote
Mage_Sales_Model_Quote
the immutable quote

shippingMethodCode
string Shipping rate code composed of {carrier}_{method}
bolt_boltpay_shipping_method_applied_after global Executed after a specific shipping method is applied to quote for shipping and tax calculation. Shipping method specific cleanup logic is typically performed from here. Shipping method can be prevented from being added to Bolt by setting quote->setShouldSkipThisShippingMethod(true). quote
Mage_Sales_Model_Quote
the immutable quote

shippingMethodCode
string
Shipping rate code composed of {carrier}_{method}
bolt_boltpay_shipping_option_added global Executed after a shipping option is successfully added to what is sent to Bolt quote
Mage_Sales_Model_Quote
the immutable quote

rate
Mage_Sales_Model_Quote_Address_Rate
rate object of the option that was added

option
array
the actual data that is sent to Bolt for this option
bolt_boltpay_cart_item_inventory_validation_before global Entry for altering the behavior of a cart item's inventory validation prior to standard validation. A cart item validation may be canceled by setting cartItem->shouldNotBeValidated to true cartItem
the current cart item being validated

quote
Mage_Sales_Model_Quote
the Magento cart copy of the Bolt order

transaction
object
Bolt payload
bolt_boltpay_cart_item_total_validation_before global Entry for altering the behavior of a cart item's line total validation prior to standard validation. A cart item validation may be canceled by setting cartItem->shouldNotBeValidated to true cartItem
the current cart item being validated

quote
Mage_Sales_Model_Quote
the Magento cart copy of the Bolt order

transaction
object
Bolt payload
bolt_boltpay_validate_totals_before global Entry for altering the behavior of subtotal validation prior to standard subtotal validation. Each subtotal validation may be canceled by setting to false the respective values for transaction->shouldDoTaxTotalValidation, $transaction->shouldDoDiscountTotalValidation, and $transaction->shouldDoShippingTotalValidation quote
Mage_Sales_Model_Quote
the Magento cart copy of the Bolt order

transaction
object
Bolt payload
bolt_boltpay_validate_totals_after global Entry for adding additional subtotal validation behavior performed after standard subtotal validation quote
Mage_Sales_Model_Quote
the Magento cart copy of the Bolt order

transaction
object
Bolt payload
bolt_boltpay_admin_normalize_order_data_after global Entry for additional normalization of admin order data performed after standard order data normalization request
Zend_Controller_Request_Abstract
request object containing the post data to the order creation controller call

orderCreateModel
Mage_Adminhtml_Model_Sales_Order_Create
order create model
bolt_boltpay_failed_order_removed_after global Execute after deleting the failed order order
Mage_Sales_Model_Order
removed order object
bolt_boltpay_capture_before global Execute before capturing payment payment
Varien_Object
payment object

amount
float

Custom Bolt Filter Event Reference

Name Area Description Parameters Filtered Value
bolt_boltpay_filter_adjusted_shipping_amount global Entry to override the logic for adjusting the shipping totals with the discount and quote data taken into account originalDiscountTotal
float
the original discount amount that was reported to Bolt

quote
Mage_Sales_Model_Quote
the Magento cart copy of the Bolt order

boltOrder
object
The order data sent as reported by Bolt
bolt_boltpay_filter_bolt_order global Filters Bolt order data before sending it to the Bolt server quote
Mage_Sales_Model_Quote
the Magento cart copy of the Bolt order

isMultiPage
boolean
true if the order is from the standard multistore context, otherwise false

isProductPage
true if in the product page checkout context, otherwise false
array
The PHP formatted order data that is to be sent to Bolt
bolt_boltpay_filter_cloned_quote global Entry for filtering the order quote copy after the quote cloning sourceQuote
Mage_Sales_Model_Quote
Original quote that is being cloned

checkoutType
string
The type of the order checkout
Mage_Sales_Model_Quote
resulting quote
bolt_boltpay_filter_discount_amount global Allows changing of individual discount amount that is displayed in Bolt quote
Mage_Sales_Model_Quote
the Magento cart copy of the Bolt order

discount
string
the Magento totals array index/label for the discount
bolt_boltpay_filter_shipping_label global Allows changing of individual shipping labels that are displayed in Bolt rate
Mage_Sales_Model_Quote_Address_Rate
The information for this calculated rate, including method, carrier, and price
string
The label to be displayed in the Bolt order
bolt_boltpay_filter_success_url global Provides means for custom success order urls order
Mage_Sales_Model_Order
The order to be authorized

quoteId
int
The quote id of the order which maps to the Bolt order reference
string
The url that the BoltCheckout modal will forward the customer to on successful order authorization
bolt_boltpay_filter_user_note global Allows changing of the customer user note and user note behavior. To disable default behavior, return a falsy value order
Mage_Sales_Model_Order
The order to which to append the user note
string
The customized user note that will be appended to the order history comments and displayed to the customer