18 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
46 'type' =>
'serialise',
50 'gateway_assetid' => Array(
54 'description' =>
'Gateway Asset that will process the e-commerce transaction',
56 'confirm_button_name' => Array(
59 'default' =>
'Confirm and proceed to payment',
60 'description' =>
'Name of the button for confirming the order',
61 'is_contextable' => TRUE,
63 'cancel_button_name' => Array(
66 'default' =>
'Go back to form',
67 'description' =>
'Name of the button for cancellig the order',
68 'is_contextable' => TRUE,
74 'parameters' => Array(
83 'is_contextable' => TRUE,
85 'taxable_rules' => Array(
87 'type' =>
'serialise',
90 'item_format' => Array(
93 'default' =>
'<div>%item_name% -- %currency_sign%%item_price%</div>',
95 'item_taxable_string' => Array(
100 'currency_sign' => Array(
105 'asset_price_source' => Array(
110 'asset_taxable_source' => Array(
115 'asset_name_source' => Array(
118 'default' =>
'%asset_name%',
120 'asset_multiple_source' => Array(
125 'form_assets_format' => Array(
128 'default' =>
'%item_format%',
130 'form_assets_empty_str' => Array(
135 'log_to_file' => Array(
139 'parameters' => Array(
140 'allow_empty' => FALSE,
143 'log_asset_item_format' => Array(
146 'default' =>
'<asset><id>%asset_assetid%</id><price>%item_price%</price></asset>',
148 'log_question_item_format' => Array(
151 'default' =>
'<item><id>%item_id%</id><price>%item_price%</price></item>',
153 'log_item_block_format' => Array(
156 'default' =>
'%asset_item_list%'.
"\n".
'%question_item_list%',
158 'log_entry_format' => Array(
161 'default' =>
'<order>%item_block%<id>%order_id%</id><other>%form_summary%</other>',
163 'form_asset_format' => Array(
166 'default' =>
'<div>%item_name% -- %currency_sign%%item_price%</div>',
168 'form_asset_list_format' => Array(
173 'item_req_var' => Array(
176 'default' =>
'add_to_cart',
178 'item_quantity_req_var' => Array(
183 'custom_reference_id' => Array(
188 'key_val_rules' => Array(
190 'type' =>
'serialise',
191 'default' => Array(),
193 'item_promo_code_req_var' => Array(
198 'asset_promotable_source' => Array(
218 'event_name' =>
'requestKeywords',
219 'broadcast_type_code' =>
'content_type',
220 'broadcast_strict_type_code' => FALSE,
222 'side_of_link' =>
'major',
224 'is_exclusive' => NULL,
227 'link_type' => SQ_LINK_TYPE_2 | SQ_LINK_TYPE_1,
246 $res = parent::_upgrade($current_version);
248 if (version_compare($current_version,
'0.2',
'<')) {
249 pre_echo(
'UPGRADING Ecom FORM TO v0.2');
250 $assetid_list = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids(
'form_ecommerce', FALSE);
251 foreach ($assetid_list as $assetid) {
252 $ecom =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
253 if (!$ecom->_createBodycopies()) {
254 trigger_error(
'Error creating bodycopies for Ecom Form #'.$assetid, E_USER_WARNING);
260 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($ecom);
262 pre_echo(count($assetid_list).
' Ecom FORMS UPDATED');