17 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
41 $this->vars[
'go_to_confirmation_button_text'] = Array(
44 'default' =>
'Go To Confirmation',
45 'description' =>
'Go To Confirmation Button Text',
46 'is_contextable' => TRUE,
49 $this->vars[
'confirm_order_button_text'] = Array(
52 'default' =>
'Confirm Order',
53 'description' =>
'Confirm Order Button Text',
54 'is_contextable' => TRUE,
57 $this->vars[
'return_to_checkout_button_text'] = Array(
60 'default' =>
'Return To Checkout',
61 'description' =>
'Return To Checkout Button Text',
62 'is_contextable' => TRUE,
66 $this->vars[
'taxation_name'] = Array(
70 'description' =>
'Taxation Name',
71 'is_contextable' => TRUE,
74 $this->vars[
'taxation_rate'] = Array(
78 'parameters' => Array(
84 $this->vars[
'flat_charge_assetid'] = Array(
86 'type' =>
'serialise',
90 $this->vars[
'tax_charge_assetid'] = Array(
92 'type' =>
'serialise',
96 $this->vars[
'quantity_selector'] = Array(
98 'type' =>
'selection',
99 'default' =>
'metadata',
100 'parameters' => Array(
102 'allow_empty' => FALSE,
104 'metadata' =>
'Metadata Text Field',
105 'attribute' =>
'Asset Attribute',
110 $this->vars[
'quantity_attribute'] = Array(
116 $this->vars[
'quantity_field'] = Array(
122 $this->vars[
'enforce_quantities'] = Array(
125 'default' =>
'FALSE',
126 'parameters' => Array(
127 'allow_empty' => FALSE,
131 $this->vars[
'quantity_message_cart'] = Array(
134 'default' =>
'There is an insufficient amount of items in stock to proceed with your order. Your order quantities have been altered to reflect the amount available. Items which are currently not in stock have been deleted from your cart. These items with insufficient quantities are listed below:',
135 'is_contextable' => TRUE,
138 $this->vars[
'quantity_message_checkout'] = Array(
141 'default' =>
'There is an insufficient amount of items in stock to proceed with your order. Your order has not been processed. The items with insufficient quantities are listed below:',
142 'is_contextable' => TRUE,
145 $this->vars[
'country_question'] = Array(
149 'is_admin' =>
'TRUE',
152 $this->vars[
'accept_empty_country_question'] = Array(
157 'description' =>
'This attribute indicates whether delivery prices per weight metric are applied even without a country question specified',
158 'parameters' => Array(
159 'allow_empty' => FALSE,
163 $this->vars[
'taxable_countries'] = Array(
165 'type' =>
'serialise',
166 'default' => Array(),
167 'is_admin' =>
'TRUE',
170 $this->vars[
'item_weight_selector'] = Array(
172 'type' =>
'selection',
173 'default' =>
'metadata',
174 'parameters' => Array(
176 'allow_empty' => FALSE,
178 'metadata' =>
'Metadata Text Field',
179 'attribute' =>
'Asset Attribute',
184 $this->vars[
'item_weight_metadata_source'] = Array(
191 $this->vars[
'item_weight_attribute_source'] = Array(
198 $this->vars[
'delivery_weight_fee_mapping'] = Array(
200 'type' =>
'serialise',
201 'default' => Array(),
205 $this->vars[
'default_delivery_weight_fee'] = Array(
212 $this->vars[
'default_max_product_quantity'] = Array(
217 'parameters' => Array(
218 'allow_negative' => FALSE,
219 'allow_empty' => TRUE,
224 $this->vars[
'international_delivery_fee_exempt_countries'] = Array(
226 'type' =>
'serialise',
227 'default' => Array(),
228 'is_admin' =>
'TRUE',
231 $this->vars[
'international_delivery_fee'] = Array(
238 $this->vars[
'conditional_delivery_fees'] = Array(
240 'type' =>
'serialise',
241 'default' => Array(),
245 $this->vars[
'customise_receipt'] = Array(
252 $this->vars[
'currency_symbol'] = Array(
259 $this->vars[
'float_precision'] = Array(
266 $this->vars[
'max_delivery_fee'] = Array(
273 $this->vars[
'refund_info_text'] = Array(
277 'description' =>
'Text to display if some products in cart are non-refundable',
279 $this->vars[
'actions'] = Array(
281 'type' =>
'serialise',
282 'default' => Array(),
283 'description' =>
'Actions that needs to be executed at the end of checkout',
301 'event_name' =>
'requestKeywords',
302 'broadcast_type_code' =>
'content_type',
303 'broadcast_strict_type_code' => FALSE,
305 'side_of_link' =>
'major',
307 'is_exclusive' => NULL,
310 'link_type' => SQ_LINK_TYPE_2,
331 if (version_compare($current_version,
'0.3',
'<=')) {
332 pre_echo(
'STARTING ECOMMERCE CHECKOUT UPGRADE - VERSION 0.4');
335 $sql =
'SELECT assetid
337 WHERE type_code = '.MatrixDAL::quote(
'ecommerce_checkout');
340 }
catch (Exception $e) {
341 throw new Exception(
'Unable to locate Ecommerce_Checkout assets due to database error: '.$e->getMessage());
345 'pending_orders' =>
'folder',
346 'orders_to_review' =>
'folder',
349 foreach ($checkout_assetids as $row => $info) {
350 $checkout = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($info[
'assetid']);
353 foreach ($sub_assets as $link_value => $type) {
354 $asset =
new $type();
356 'asset' => $checkout,
357 'value' => $link_value,
358 'link_type' => SQ_LINK_TYPE_2,
363 $asset->setAttrValue(
'name', ucwords(str_replace(
'_',
' ', $link_value)));
364 if (!$asset->create($copy_link))
return FALSE;
368 $order_folder_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($checkout->id, SQ_LINK_TYPE_2,
'folder', TRUE,
'orders');
369 if (!$GLOBALS[
'SQ_SYSTEM']->am->updateLink($order_folder_link[
'linkid'], SQ_LINK_TYPE_2,
'completed_orders'))
return FALSE;
371 $order_folder = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($order_folder_link[
'minorid']);
372 $order_folder->setAttrValue(
'name',
'Completed Orders');
373 $order_folder->saveAttributes();
376 pre_echo(
'COMPLETED ECOMMERCE CHECKOUT UPGRADE - VERSION 0.4');
381 $res = parent::_upgrade($current_version);