-
Notifications
You must be signed in to change notification settings - Fork 2
02. Configuration
Nathaniel Hammond edited this page Jan 19, 2017
·
2 revisions
-
Bundle ID Handle (bundleIdHandle)- This is the handle used in the item options array in the cart to group bundle items togetherDefault: bundleId -
Bundle ID Salt (bundleIdSalt)- Salt used to encrypt the bundle ID for slight obscurityDefault: appId -
Bundle SKU Handle (bundleSkuHandle)- The field handle to use for the bundle SKU. If left blank Bundle item SKUs will be combinedDefault: e.g. ITEM1SKU-ITEM2SKU-ITEM3SKU
-
cartBundleIdEncrypt- Used to encrypt the bundle ID for use in the cartUsage: bundleEntry.id | cartBundleIdEncrypt -
cartBundle- The main function, when passed the cart lineItems it iterates through all the items to bundle products together. It then returns the lineItems with the new bundle products and removes individual products that are part of a bundleUsage: cart.lineItems | cartBundle
-
cartItemsCount- Returns the number of items in the cart after bundling appropriate itemsUsage: craft.cartBundle.cartItemsCount
-
modifyCartBundles- allow manipulation of the bundles before they are added into lineItems
// Arbitrary example of removing first bundle
public function modifyCartBundles( &$bundles ) {
if ( count( $bundles ) ) {
unset( $bundles[ 0 ] );
}
}