SKYBOZ456 - Version 1.2.4

Version Notes

Skybox Checkout enables a Magento ecommerce site to sell instantly to 180 countries & territories and accept payment in 140 local currencies. SkyBOX Checkout is a combination of technology tools & services to help retailers expand overseas while offering a localized full landed cost calculation to international shoppers. SkyBOX Checkout takes on full risk of fraud screening & international payments while providing competitive international shipping with full tracking via its proprietary logistics network.

Download this release

Release Info

Developer Emilio Lizarraga
Extension SKYBOZ456
Version 1.2.4
Comparing to
See all releases


Code changes from version 1.2.3 to 1.2.4

app/code/community/Skybox/Catalog/Block/Product/List.php CHANGED
@@ -1,36 +1,14 @@
1
  <?php
2
  /**
3
- * Magento
4
  *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magento.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magento.com for more information.
20
- *
21
- * @category Mage
22
- * @package Mage_Catalog
23
- * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
 
27
-
28
  /**
29
  * Product list
30
- *
31
- * @category Mage
32
- * @package Mage_Catalog
33
- * @author Magento Core Team <core@magentocommerce.com>
34
  */
35
  class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
36
  {
@@ -149,10 +127,12 @@ class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
149
  $type = $product->getTypeId();
150
  switch ($type) {
151
  case 'simple':
152
- $template = $this->_getApi()->getUrl($product->getId(), null, $product->getFinalPrice(), $product->getTypeId());
 
153
  break;
154
  case 'configurable':
155
- $template = $this->_getApi()->getUrl($product->getId(), null, $product->getFinalPrice(), $product->getTypeId());
 
156
  break;
157
  case 'bundle':
158
  $template = $this->_getApi()->getUrl($product, null, $product->getFinalPrice(), 'simple');
@@ -161,122 +141,80 @@ class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
161
  return $template;
162
  }
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  /**
165
  * Need use as _prepareLayout - but problem in declaring collection from
166
  * another block (was problem with search result)
167
  */
168
  protected function _beforeToHtml()
169
  {
 
 
 
 
 
 
170
 
171
- /*ini Load all product of catalog*/
 
172
 
173
- //var_dump($products); exit;
174
- $session = Mage::getSingleton("core/session", array("name"=>"frontend"));
175
- $sky = $session->getData("skyBox");
176
- /*1 step conexion done*/
177
- $_checkout = Mage::getModel('skyboxcheckout/api_checkout');
178
- $_cartDataURL = "";
179
- $_checkout->InitializeBarSkybox();
180
- $data = $_checkout->getValueAccessService();
181
 
182
  $skyBoxUrlClient = Mage::helper('skyboxinternational/data')->getSkyBoxUrlAPI();
183
  $skyBoxUrlClient = $skyBoxUrlClient . ("multiplecalculate");
184
- //var_dump($skyBoxUrlClient); "https://beta.skyboxcheckout.com/testapi/ApiRest/multiplecalculate"
185
- $products = $this->_getProductCollection();
186
- /*call*/
187
- /*Objeto producto catalogo*/
188
- foreach($products as $prod) {
189
- $product = Mage::getModel('catalog/product')->load($prod->getId());
190
- $data['listproducts'][] = $this->getUrlService($product);
191
- $dataJson = json_encode($data);
192
- }
193
- $this->_getApi()->HtmlTemplateButton();
194
- $template = $this->_getApi()->getHtmlTemplateButton();
195
-
196
- $start = microtime(true);
197
- $resultObjectMultiCurl = $this->file_multi_get_contents_curl($skyBoxUrlClient, $dataJson);
198
 
199
- //var_export($resultObjectMultiCurl);
 
200
 
201
- /**
202
- * Only works to async version start
203
- */
204
- /*
205
- $time_elapsed_secs = microtime(true) - $start;
206
- echo "<div style='position: absolute;
207
- background: lightgreen;
208
- font-weight: bolder;
209
- z-index: 1111;'>Tiempo de respuesta (Multiple): {$time_elapsed_secs}</div>"."<br/>";
210
 
 
 
 
 
 
211
 
212
- $dataMultiCurl = array();
213
- $resultObjectMultiCurl = json_decode($resultObjectMultiCurl);
214
- $resultObjectMultiCurlArray = json_decode(json_encode($resultObjectMultiCurl), true);
215
-
216
- foreach($resultObjectMultiCurlArray['listCalculateResponse'] as $value) {
217
- $dataMultiCurl[$value["HtmlObjectId"]] = $this->getTemplateServicio($value, $template);
218
- }
219
 
220
- $dataMultiCurlVal = array();
221
- $cont = 0;
222
- foreach($products as $key => $prod) {
223
- $dataMultiCurlVal[$prod->getId()] = $dataMultiCurl[$cont];
224
- $cont++;
225
  }
226
- $session->setData("skyBox", $dataMultiCurl);
227
- */
228
- /**
229
- * Only works to async version end
230
- */
231
 
232
- /*end Load all product of catalog*/
233
-
234
-
235
- $toolbar = $this->getToolbarBlock();
236
-
237
- // called prepare sortable parameters
238
- $collection = $this->_getProductCollection();
239
-
240
- // use sortable parameters
241
- if ($orders = $this->getAvailableOrders()) {
242
- $toolbar->setAvailableOrders($orders);
243
- }
244
- if ($sort = $this->getSortBy()) {
245
- $toolbar->setDefaultOrder($sort);
246
- }
247
- if ($dir = $this->getDefaultDirection()) {
248
- $toolbar->setDefaultDirection($dir);
249
- }
250
- if ($modes = $this->getModes()) {
251
- $toolbar->setModes($modes);
252
- }
253
-
254
- // set collection to toolbar and apply sort
255
- $toolbar->setCollection($collection);
256
-
257
- $this->setChild('toolbar', $toolbar);
258
- Mage::dispatchEvent('catalog_block_product_list_collection', array(
259
- 'collection' => $this->_getProductCollection()
260
- ));
261
-
262
- $this->_getProductCollection()->load();
263
 
264
  return parent::_beforeToHtml();
265
  }
266
 
267
- public function getTemplateServicio($objectProduct,$template)
 
 
 
268
  {
269
-
270
-
271
-
272
-
273
-
274
-
275
  /*2step execute get button template*/
276
 
277
- /*var_dump($a->getHtmlTemplateButton());exit;*/
278
-
279
- /*3 step call calculate*/;
280
  if (1) {
281
 
282
  /*$objectProduct = json_decode($objectProduct);
@@ -299,70 +237,32 @@ z-index: 1111;'>Tiempo de respuesta (Multiple): {$time_elapsed_secs}</div>"."<br
299
  //exit("debug si es que llega");
300
  /*var_dump($a); exit;
301
  var_dump(Mage::getSingleton('skyboxcore/session')); exit;--*/
302
-
303
-
304
  }
305
 
306
- function file_multi_get_contents_curl($url, $data)
 
 
 
 
 
 
 
 
307
  {
308
-
309
- /*var_export($data); exit;*/
310
- if (!function_exists("curl_init")) die("cURL extension is not installed");
311
  $ch = curl_init();
312
  curl_setopt($ch, CURLOPT_URL, $url);
313
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
314
  curl_setopt($ch, CURLOPT_POST, 1);
315
- curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
316
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
317
- $response = curl_exec($ch);
318
 
319
- /*var_export($response); exit;*/
320
- // Will dump a beauty json :3
321
- //var_dump(json_decode($result, true));
322
- return $response;
323
- /*
324
- $node_count = count($nodes);
325
- $curl_arr = array();
326
- $master = curl_multi_init();
327
- //curl_setopt($master, CURLOPT_SSL_VERIFYPEER, false);
328
- // Will return the response, if false it print the response
329
- //curl_setopt($master, CURLOPT_RETURNTRANSFER, true);
330
-
331
- for($i = 0; $i < count($nodes); $i++)
332
- {
333
- $start = microtime(true);
334
- $url =$nodes[$i];
335
- $curl_arr[$i] = curl_init($url);
336
- curl_setopt($curl_arr[$i], CURLOPT_RETURNTRANSFER, true);
337
- curl_multi_add_handle($master, $curl_arr[$i]);
338
- $total_time = round(microtime(true)-$start, 4);
339
- echo "Request #".($i+1).": send {$start} ; delay: {$total_time}"."<br/>";
340
- }
341
 
342
- $start = microtime(true);
343
- do
344
- {
345
- $startMultiExec = microtime(true);
346
- $curl_multi_exec = curl_multi_exec($master,$running);
347
- $totalMultiExec = round(microtime(true)-$startMultiExec, 4);
348
- //echo "Request MultiExec: send {$startMultiExec} ; delay: {$totalMultiExec}"."<br/>";
349
- }
350
- while($running > 0);
351
- $total_time = round(microtime(true)-$start, 4);
352
- echo "Request All: send {$start} ; delay: {$total_time}"."<br/>";
353
-
354
- echo 'results: '."<br/>";
355
- $results = array();
356
- for($i = 0; $i < $node_count; $i++)
357
- {
358
- $preresult = curl_multi_getcontent ( $curl_arr[$i] );
359
- $results[] = $preresult;
360
- echo "<pre>".var_export($results)."</pre>";
361
- echo( $i . '\n' . $results . '\n');
362
  }
363
- echo "<pre>".var_dump($results)."</pre>";
364
-
365
- echo 'done'."<br/>";*/
366
  }
367
 
368
  /**
@@ -434,7 +334,8 @@ z-index: 1111;'>Tiempo de respuesta (Multiple): {$time_elapsed_secs}</div>"."<br
434
  * @param Mage_Catalog_Model_Category $category
435
  * @return Mage_Catalog_Block_Product_List
436
  */
437
- public function prepareSortableFieldsByCategory($category) {
 
438
  if (!$this->getAvailableOrders()) {
439
  $this->setAvailableOrders($category->getAvailableSortByOptions());
440
  }
1
  <?php
2
  /**
3
+ * Skybox Checkout
4
  *
5
+ * @category Skybox
6
+ * @package Skybox_Catalog
7
+ * @copyright Copyright (c) 2017 Skybox Checkout. (http://www.skyboxcheckout.com)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  */
9
 
 
10
  /**
11
  * Product list
 
 
 
 
12
  */
13
  class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
14
  {
127
  $type = $product->getTypeId();
128
  switch ($type) {
129
  case 'simple':
130
+ $template = $this->_getApi()->getUrl($product->getId(), null, $product->getFinalPrice(),
131
+ $product->getTypeId());
132
  break;
133
  case 'configurable':
134
+ $template = $this->_getApi()->getUrl($product->getId(), null, $product->getFinalPrice(),
135
+ $product->getTypeId());
136
  break;
137
  case 'bundle':
138
  $template = $this->_getApi()->getUrl($product, null, $product->getFinalPrice(), 'simple');
141
  return $template;
142
  }
143
 
144
+ private function isEnable()
145
+ {
146
+ $isModuleEnable = Mage::getModel('skyboxcore/api_restful')->isModuleEnable();
147
+ if (!$isModuleEnable) {
148
+ return false;
149
+ }
150
+
151
+ /** @var Skybox_Core_Helper_Allow $allowHelper */
152
+ $allowHelper = Mage::helper('skyboxcore/allow');
153
+
154
+ if (!$allowHelper->isPriceEnabled()) {
155
+ return false;
156
+ }
157
+
158
+ return true;
159
+ }
160
+
161
  /**
162
  * Need use as _prepareLayout - but problem in declaring collection from
163
  * another block (was problem with search result)
164
  */
165
  protected function _beforeToHtml()
166
  {
167
+ if (!$this->isEnable()) {
168
+ return parent::_beforeToHtml();
169
+ }
170
+
171
+ $api_checkout = Mage::getModel('skyboxcheckout/api_checkout');
172
+ $api_checkout->InitializeBarSkybox();
173
 
174
+ // $session = Mage::getSingleton("core/session", array("name" => "frontend"));
175
+ // $sky = $session->getData("skyBox");
176
 
177
+ $data = $api_checkout->getValueAccessService();
 
 
 
 
 
 
 
178
 
179
  $skyBoxUrlClient = Mage::helper('skyboxinternational/data')->getSkyBoxUrlAPI();
180
  $skyBoxUrlClient = $skyBoxUrlClient . ("multiplecalculate");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
 
182
+ $dataJson = null;
183
+ $multiCalculate = 1;
184
 
185
+ try {
186
+ $products = $this->_getProductCollection();
 
 
 
 
 
 
 
187
 
188
+ foreach ($products as $prod) {
189
+ $product = Mage::getModel('catalog/product')->load($prod->getId());
190
+ $data['listproducts'][] = $this->getUrlService($product);
191
+ $dataJson = json_encode($data);
192
+ }
193
 
194
+ $response = $this->multiCalculatePrice($skyBoxUrlClient, $dataJson);
195
+ // Mage::log(print_r($response, true), null, 'multicalculate.log', true);
 
 
 
 
 
196
 
197
+ } catch (\Exception $e) {
198
+ $multiCalculate = 0;
199
+ // Mage::log(print_r($dataJson, true), null, 'multicalculate.log', true);
200
+ // Mage::log("[multicalculate] " . $e->getMessage(), null, 'multicalculate.log', true);
 
201
  }
 
 
 
 
 
202
 
203
+ Mage::unregister('skybox_multicalculate');
204
+ Mage::register('skybox_multicalculate', $multiCalculate);
205
+ // Mage::registry('skybox_multicalculate');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
 
207
  return parent::_beforeToHtml();
208
  }
209
 
210
+ /**
211
+ * @deprecated
212
+ */
213
+ public function getTemplateServicio($objectProduct, $template)
214
  {
 
 
 
 
 
 
215
  /*2step execute get button template*/
216
 
217
+ /*var_dump($a->getHtmlTemplateButton());exit;*//*3 step call calculate*/;
 
 
218
  if (1) {
219
 
220
  /*$objectProduct = json_decode($objectProduct);
237
  //exit("debug si es que llega");
238
  /*var_dump($a); exit;
239
  var_dump(Mage::getSingleton('skyboxcore/session')); exit;--*/
 
 
240
  }
241
 
242
+ /**
243
+ * Return Multi CalculatePrice
244
+ *
245
+ * @param $url
246
+ * @param $data
247
+ * @return mixed
248
+ * @throws Exception
249
+ */
250
+ function multiCalculatePrice($url, $data)
251
  {
 
 
 
252
  $ch = curl_init();
253
  curl_setopt($ch, CURLOPT_URL, $url);
254
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
255
  curl_setopt($ch, CURLOPT_POST, 1);
256
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
257
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
258
+ $response = curl_exec($ch);
259
 
260
+ $response = json_decode($response, true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
 
262
+ if ($response['StatusCode'] != 'Success') {
263
+ throw new \Exception('Missing or invalid data send to MultiCalculate');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  }
265
+ return $response;
 
 
266
  }
267
 
268
  /**
334
  * @param Mage_Catalog_Model_Category $category
335
  * @return Mage_Catalog_Block_Product_List
336
  */
337
+ public function prepareSortableFieldsByCategory($category)
338
+ {
339
  if (!$this->getAvailableOrders()) {
340
  $this->setAvailableOrders($category->getAvailableSortByOptions());
341
  }
app/code/community/Skybox/Catalog/Block/Product/Price.php CHANGED
@@ -74,15 +74,17 @@ class Skybox_Catalog_Block_Product_Price extends Mage_Catalog_Block_Product_Pric
74
  */
75
  public function _toHtml()
76
  {
77
- $activation = Mage::getModel('skyboxcore/api_restful')->isModuleEnable();
78
 
79
- if (!$activation) {
80
- return '';
81
  }
82
- //$typeIntegration = Mage::getStoreConfig('settings/typeIntegration');
83
- $typeIntegration = Mage::helper('skyboxinternational/data')->getSkyboxIntegration();
84
- //Mage::log(print_r('product\Price::_toHtml', true), null, 'tracer.log', true);
85
- if ($this->_getApi()->getLocationAllow() && ($typeIntegration != 3)) {
 
 
86
  if ($this->_getApi()->getErrorAuthenticate() && !$this->_getApi()->getLocationAllow() && $this->_getApi()->HasError()) {
87
  return '';
88
  } elseif ($this->_getApi()->HasError()) {
@@ -98,28 +100,22 @@ class Skybox_Catalog_Block_Product_Price extends Mage_Catalog_Block_Product_Pric
98
  return '';
99
  }
100
 
101
- /* @var $product Mage_Catalog_Model_Product */
102
  $product = $this->getProduct();
103
  $type = $product->getTypeId();
104
  $route_name = Mage::app()->getRequest()->getRouteName();
105
 
106
- // Mage::log(print_r('$route_name: '. $route_name, true), null, 'tracer.log', true);
107
-
108
  // Simple Product
109
  if ($type == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE && $this->getTemplate() == 'catalog/product/price.phtml') {
110
  return $this->calculatePrice($product);
111
  }
112
 
113
-
114
  if ($type == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE && $this->getTemplate() == 'catalog/product/view/price_clone.phtml') {
115
  return '';
116
  }
117
 
118
  // Configurable Product
119
  if ($type == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE && $this->getTemplate() == 'catalog/product/price.phtml') {
120
- /*if ($route_name == 'catalog') {
121
- return '';
122
- }*/
123
 
124
  if (Mage::registry('current_product')) {
125
  return "";
@@ -134,7 +130,9 @@ class Skybox_Catalog_Block_Product_Price extends Mage_Catalog_Block_Product_Pric
134
  }
135
  return '';
136
  }
 
137
  }
 
138
  return parent::_toHtml();
139
  }
140
 
@@ -156,7 +154,11 @@ class Skybox_Catalog_Block_Product_Price extends Mage_Catalog_Block_Product_Pric
156
  $type = $product->getTypeId();
157
  //Mage::log(print_r('product\Price: '.$type, true), null, 'tracer.log', true);
158
 
159
- if (Mage::registry('current_category') and (!(Mage::registry('current_product')))) {
 
 
 
 
160
  /**
161
  * Apply multiple calculate start
162
  * When: is different to product detail and you are on catalog category
74
  */
75
  public function _toHtml()
76
  {
77
+ $isModuleEnable = Mage::getModel('skyboxcore/api_restful')->isModuleEnable();
78
 
79
+ if (!$isModuleEnable) {
80
+ return parent::_toHtml();
81
  }
82
+
83
+ /** @var Skybox_Core_Helper_Allow $allowHelper */
84
+ $allowHelper = Mage::helper('skyboxcore/allow');
85
+
86
+ if ($allowHelper->isPriceEnabled()) {
87
+
88
  if ($this->_getApi()->getErrorAuthenticate() && !$this->_getApi()->getLocationAllow() && $this->_getApi()->HasError()) {
89
  return '';
90
  } elseif ($this->_getApi()->HasError()) {
100
  return '';
101
  }
102
 
103
+ /* @var Mage_Catalog_Model_Product $product */
104
  $product = $this->getProduct();
105
  $type = $product->getTypeId();
106
  $route_name = Mage::app()->getRequest()->getRouteName();
107
 
 
 
108
  // Simple Product
109
  if ($type == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE && $this->getTemplate() == 'catalog/product/price.phtml') {
110
  return $this->calculatePrice($product);
111
  }
112
 
 
113
  if ($type == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE && $this->getTemplate() == 'catalog/product/view/price_clone.phtml') {
114
  return '';
115
  }
116
 
117
  // Configurable Product
118
  if ($type == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE && $this->getTemplate() == 'catalog/product/price.phtml') {
 
 
 
119
 
120
  if (Mage::registry('current_product')) {
121
  return "";
130
  }
131
  return '';
132
  }
133
+
134
  }
135
+
136
  return parent::_toHtml();
137
  }
138
 
154
  $type = $product->getTypeId();
155
  //Mage::log(print_r('product\Price: '.$type, true), null, 'tracer.log', true);
156
 
157
+ $multiCalculate = Mage::registry('skybox_multicalculate');
158
+
159
+ // if ($multiCalculate and Mage::registry('current_category') and (!(Mage::registry('current_product')))) {
160
+
161
+ if ($multiCalculate && Mage::registry('current_category')) {
162
  /**
163
  * Apply multiple calculate start
164
  * When: is different to product detail and you are on catalog category
app/code/community/Skybox/Catalog/etc/config.xml CHANGED
@@ -8,7 +8,7 @@
8
  </default>
9
  <modules>
10
  <Skybox_Catalog>
11
- <version>0.1.0</version>
12
  <codePool>community</codePool>
13
  </Skybox_Catalog>
14
  </modules>
@@ -172,4 +172,4 @@
172
  </layout>
173
  </adminhtml>
174
 
175
- </config>
8
  </default>
9
  <modules>
10
  <Skybox_Catalog>
11
+ <version>1.2.4</version>
12
  <codePool>community</codePool>
13
  </Skybox_Catalog>
14
  </modules>
172
  </layout>
173
  </adminhtml>
174
 
175
+ </config>
app/code/community/Skybox/Checkout/Model/Cart.php CHANGED
@@ -10,6 +10,7 @@
10
  class Skybox_Checkout_Model_Cart extends Mage_Checkout_Model_Cart
11
  {
12
  const MESSAGE_FAIL_TO_ADD_PRODUCT = '[sales] Failed to add the product to the cart.';
 
13
  protected $_api = null;
14
  protected $_product = null;
15
  protected $_enable = null;
@@ -23,12 +24,41 @@ class Skybox_Checkout_Model_Cart extends Mage_Checkout_Model_Cart
23
  return $this->_api;
24
  }
25
 
 
 
 
 
 
 
26
  private function isEnable()
27
  {
28
- if (null === $this->_enable) {
29
- // $value = (bool)Mage::getStoreConfig('skyboxinternational/skyboxsettings/skyboxactive', Mage::app()->getStore());
30
- $value = Mage::getModel('skyboxcore/api_restful')->isModuleEnable();
31
- $this->_enable = $value;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  }
33
  return $this->_enable;
34
  }
@@ -263,8 +293,6 @@ class Skybox_Checkout_Model_Cart extends Mage_Checkout_Model_Cart
263
 
264
  try {
265
  $quote = parent::addProduct($productInfo, $requestInfo);
266
- // $lastAddedProductId = $this->getCheckoutSession()->getLastAddedProductId();
267
- // Mage::log("lastAddedProductId :: " . $lastAddedProductId, null, 'bueyada.log', true);
268
  $this->_updateQuoteItem($productId, $productIdSkybox);
269
  } catch (\Exception $e) {
270
  Mage::log($e->getMessage(), null, 'tracer.log', true);
@@ -492,6 +520,8 @@ class Skybox_Checkout_Model_Cart extends Mage_Checkout_Model_Cart
492
  */
493
  public function removeItem($itemId)
494
  {
 
 
495
  /**
496
  * only one time for call to service start - Active
497
  * when do remove
@@ -534,6 +564,8 @@ class Skybox_Checkout_Model_Cart extends Mage_Checkout_Model_Cart
534
  */
535
  public function updateItems($data)
536
  {
 
 
537
  /**
538
  * only one time for call to service start - Active
539
  * when do remove
@@ -549,7 +581,7 @@ class Skybox_Checkout_Model_Cart extends Mage_Checkout_Model_Cart
549
  return $this;
550
  }
551
 
552
- Mage::log('pas x aqui5', null, 'minicars.log', true);
553
  //Mage::log(print_r($data, true), null, 'tracer.log', true);
554
  //Mage::log("Skybox_Checkout_Checkout_Model_Cart updateItem");
555
  //return parent::updateItems($data);
@@ -586,7 +618,7 @@ class Skybox_Checkout_Model_Cart extends Mage_Checkout_Model_Cart
586
 
587
  $idProductSkybox = $item->getIdProductSkybox();
588
 
589
- $this->_getApi()->UpdateProductOfCart($idProductSkybox, $qty);
590
 
591
  $item->setQty($qty);
592
 
@@ -639,6 +671,8 @@ class Skybox_Checkout_Model_Cart extends Mage_Checkout_Model_Cart
639
  */
640
  public function updateItem($itemId, $requestInfo = null, $updatingParams = null)
641
  {
 
 
642
  if (!$this->isEnable()) {
643
  $result = parent::updateItem($itemId, $requestInfo, $updatingParams);
644
  return $result;
10
  class Skybox_Checkout_Model_Cart extends Mage_Checkout_Model_Cart
11
  {
12
  const MESSAGE_FAIL_TO_ADD_PRODUCT = '[sales] Failed to add the product to the cart.';
13
+
14
  protected $_api = null;
15
  protected $_product = null;
16
  protected $_enable = null;
24
  return $this->_api;
25
  }
26
 
27
+ protected function _getAllowHelper()
28
+ {
29
+ return Mage::helper('skyboxcore/allow');
30
+ }
31
+
32
+ // @todo : Move this logic to a helper
33
  private function isEnable()
34
  {
35
+ if ($this->_enable == null) {
36
+
37
+ $isActive = boolval(Mage::helper('skyboxinternational/data')->getActive());
38
+
39
+ if (!$isActive) {
40
+ return false;
41
+ }
42
+
43
+ $isEnable = Mage::getModel('skyboxcore/api_restful')->isModuleEnable();
44
+
45
+ if (!$isEnable) {
46
+ return false;
47
+ }
48
+
49
+ $allowHelper = Mage::helper('skyboxcore/allow');
50
+
51
+ if (!$allowHelper->isOperationCartEnabled()) {
52
+ return false;
53
+ }
54
+
55
+ $api_mproduct = Mage::getModel('skyboxcatalog/api_product');
56
+
57
+ if (!$api_mproduct->getLocationAllow()) {
58
+ return false;
59
+ }
60
+
61
+ $this->_enable = true;
62
  }
63
  return $this->_enable;
64
  }
293
 
294
  try {
295
  $quote = parent::addProduct($productInfo, $requestInfo);
 
 
296
  $this->_updateQuoteItem($productId, $productIdSkybox);
297
  } catch (\Exception $e) {
298
  Mage::log($e->getMessage(), null, 'tracer.log', true);
520
  */
521
  public function removeItem($itemId)
522
  {
523
+ Mage::log('Skybox rulez! - removeItem !!', null, 'bueyada.log', true);
524
+
525
  /**
526
  * only one time for call to service start - Active
527
  * when do remove
564
  */
565
  public function updateItems($data)
566
  {
567
+ Mage::log('Skybox updateItems!!!', null, 'bueyada.log', true);
568
+
569
  /**
570
  * only one time for call to service start - Active
571
  * when do remove
581
  return $this;
582
  }
583
 
584
+ Mage::log('pas x aqui5', null, 'cartdetail.log', true);
585
  //Mage::log(print_r($data, true), null, 'tracer.log', true);
586
  //Mage::log("Skybox_Checkout_Checkout_Model_Cart updateItem");
587
  //return parent::updateItems($data);
618
 
619
  $idProductSkybox = $item->getIdProductSkybox();
620
 
621
+ // $this->_getApi()->UpdateProductOfCart($idProductSkybox, $qty);
622
 
623
  $item->setQty($qty);
624
 
671
  */
672
  public function updateItem($itemId, $requestInfo = null, $updatingParams = null)
673
  {
674
+ Mage::log('Skybox rulez! - updateItem !!', null, 'bueyada.log', true);
675
+
676
  if (!$this->isEnable()) {
677
  $result = parent::updateItem($itemId, $requestInfo, $updatingParams);
678
  return $result;
app/code/community/Skybox/Checkout/Model/Observer.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @category Skybox
7
  * @package Skybox_Checkout
8
- * @copyright Copyright (c) 2014 Skybox Checkout. (http://www.skyboxcheckout.com)
9
  */
10
  class Skybox_Checkout_Model_Observer
11
  {
@@ -19,8 +19,9 @@ class Skybox_Checkout_Model_Observer
19
 
20
  protected function _getApi()
21
  {
22
- if (null === $this->_api)
23
  $this->_api = Mage::getModel($this->_typeApi);
 
24
 
25
  return $this->_api;
26
  }
@@ -31,13 +32,15 @@ class Skybox_Checkout_Model_Observer
31
 
32
  protected function _getProduct()
33
  {
34
- if (null === $this->_product)
35
  $this->_product = Mage::getModel($this->_typeProduct);
 
36
 
37
  return $this->_product;
38
  }
39
 
40
- private function isEnable() {
 
41
  if ($this->_enable === null) {
42
  // $value = (bool)Mage::getStoreConfig('skyboxinternational/skyboxsettings/skyboxactive', Mage::app()->getStore());
43
  $value = Mage::getModel('skyboxcore/api_restful')->isModuleEnable();
@@ -58,7 +61,7 @@ class Skybox_Checkout_Model_Observer
58
 
59
  public function RemoveTax(Varien_Event_Observer $observer)
60
  {
61
- if(!$this->isEnable()) {
62
  return;
63
  }
64
 
@@ -66,11 +69,11 @@ class Skybox_Checkout_Model_Observer
66
  $customer_id = Mage::getSingleton('customer/session')->getId();
67
  $customer = Mage::getModel("customer/customer")->load($customer_id);
68
 
69
- if($customer->getIsTaxExempt() == 1)
70
- {
71
  $items = $observer->getEvent()->getQuote()->getAllVisibleItems();
72
- foreach($items as $item)
73
  $item->getProduct()->setTaxClassId(0);
 
74
  Mage::log('RemoveTax->Tax', null, 'SkyObserver.log', true);
75
  }
76
  Mage::log('RemoveTax->fin', null, 'SkyObserver.log', true);
@@ -78,7 +81,7 @@ class Skybox_Checkout_Model_Observer
78
 
79
  public function CalculatePriceQuoteItem(Varien_Event_Observer $observer)
80
  {
81
- if(!$this->isEnable()) {
82
  return $this;
83
  }
84
  Mage::log('Observer->CalculatePriceQuoteItem->ini', null, 'cart.log', true);
@@ -104,7 +107,7 @@ class Skybox_Checkout_Model_Observer
104
  }*/
105
 
106
  return $this;
107
-
108
  //$product = $quote_item->getProduct();
109
 
110
  /*$quote = Mage::getSingleton('checkout/session');
@@ -174,7 +177,7 @@ class Skybox_Checkout_Model_Observer
174
  * only one time for call to service end - Active
175
  */
176
 
177
- if(!$this->isEnable()) {
178
  return $this;
179
  }
180
 
@@ -184,15 +187,15 @@ class Skybox_Checkout_Model_Observer
184
  $allowRunByIntegration3 = true;
185
  //$typeIntegration = Mage::getStoreConfig('settings/typeIntegration');
186
  $typeIntegration = Mage::helper('skyboxinternational/data')->getSkyboxIntegration();
187
- if ($typeIntegration==3) {
188
  $allowRunByIntegration3 = false;
189
  }
190
  //Mage::log("Call true22: changeQuoteAddressSkybox", null, 'local.log', true);
191
  /**
192
  * Integration 3 end, show price shop in cart*
193
  */
194
- if($allowRunByIntegration3) {
195
- if($this->_getApi()->getLocationAllow()){
196
  Mage::log('Observer->changeQuoteAddressSkybox : ini', null, 'TotalSales.log', true);
197
  /* $quote Mage_Sales_Model_Quote */
198
  $quote = $observer->getEvent()->getQuote();
@@ -202,7 +205,7 @@ class Skybox_Checkout_Model_Observer
202
 
203
  $totals = 0;
204
  $baseTotals = 0;
205
- $totalTax=0;
206
 
207
  foreach ($quote->getAllItems() as $item) {
208
 
@@ -216,7 +219,8 @@ class Skybox_Checkout_Model_Observer
216
  $item->setBaseRowTotalInclTax($item->setBaseRowTotal());*/
217
  //------------------------------------------------------------>
218
 
219
- Mage::log('Observer->changeQuoteAddressSkybox->Item->getRowTotalSkybox->' . $item->getRowTotalSkybox(), null, 'TotalSales.log', true);
 
220
 
221
  $totals += $item->getRowTotalSkybox();
222
  }
@@ -275,10 +279,10 @@ class Skybox_Checkout_Model_Observer
275
  $address->setPriceInclTax($totals);
276
  $address->setBasePriceInclTax($baseTotals);
277
 
278
- $totals = floatval(preg_replace("/[^-0-9\.]/","",$totals));
279
  //$address->setGrandTotal($totals+$totalTax);
280
- $address->setGrandTotal($totals+$totalTax);
281
- $address->setBaseGrandTotal($baseTotals+$totalTax);
282
 
283
  //$address->save();
284
 
@@ -290,4 +294,25 @@ class Skybox_Checkout_Model_Observer
290
  }
291
 
292
  }
293
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  *
6
  * @category Skybox
7
  * @package Skybox_Checkout
8
+ * @copyright Copyright (c) 2014 - 2017 Skybox Checkout. (http://www.skyboxcheckout.com)
9
  */
10
  class Skybox_Checkout_Model_Observer
11
  {
19
 
20
  protected function _getApi()
21
  {
22
+ if (null === $this->_api) {
23
  $this->_api = Mage::getModel($this->_typeApi);
24
+ }
25
 
26
  return $this->_api;
27
  }
32
 
33
  protected function _getProduct()
34
  {
35
+ if (null === $this->_product) {
36
  $this->_product = Mage::getModel($this->_typeProduct);
37
+ }
38
 
39
  return $this->_product;
40
  }
41
 
42
+ private function isEnable()
43
+ {
44
  if ($this->_enable === null) {
45
  // $value = (bool)Mage::getStoreConfig('skyboxinternational/skyboxsettings/skyboxactive', Mage::app()->getStore());
46
  $value = Mage::getModel('skyboxcore/api_restful')->isModuleEnable();
61
 
62
  public function RemoveTax(Varien_Event_Observer $observer)
63
  {
64
+ if (!$this->isEnable()) {
65
  return;
66
  }
67
 
69
  $customer_id = Mage::getSingleton('customer/session')->getId();
70
  $customer = Mage::getModel("customer/customer")->load($customer_id);
71
 
72
+ if ($customer->getIsTaxExempt() == 1) {
 
73
  $items = $observer->getEvent()->getQuote()->getAllVisibleItems();
74
+ foreach ($items as $item) {
75
  $item->getProduct()->setTaxClassId(0);
76
+ }
77
  Mage::log('RemoveTax->Tax', null, 'SkyObserver.log', true);
78
  }
79
  Mage::log('RemoveTax->fin', null, 'SkyObserver.log', true);
81
 
82
  public function CalculatePriceQuoteItem(Varien_Event_Observer $observer)
83
  {
84
+ if (!$this->isEnable()) {
85
  return $this;
86
  }
87
  Mage::log('Observer->CalculatePriceQuoteItem->ini', null, 'cart.log', true);
107
  }*/
108
 
109
  return $this;
110
+
111
  //$product = $quote_item->getProduct();
112
 
113
  /*$quote = Mage::getSingleton('checkout/session');
177
  * only one time for call to service end - Active
178
  */
179
 
180
+ if (!$this->isEnable()) {
181
  return $this;
182
  }
183
 
187
  $allowRunByIntegration3 = true;
188
  //$typeIntegration = Mage::getStoreConfig('settings/typeIntegration');
189
  $typeIntegration = Mage::helper('skyboxinternational/data')->getSkyboxIntegration();
190
+ if ($typeIntegration == 3) {
191
  $allowRunByIntegration3 = false;
192
  }
193
  //Mage::log("Call true22: changeQuoteAddressSkybox", null, 'local.log', true);
194
  /**
195
  * Integration 3 end, show price shop in cart*
196
  */
197
+ if ($allowRunByIntegration3) {
198
+ if ($this->_getApi()->getLocationAllow()) {
199
  Mage::log('Observer->changeQuoteAddressSkybox : ini', null, 'TotalSales.log', true);
200
  /* $quote Mage_Sales_Model_Quote */
201
  $quote = $observer->getEvent()->getQuote();
205
 
206
  $totals = 0;
207
  $baseTotals = 0;
208
+ $totalTax = 0;
209
 
210
  foreach ($quote->getAllItems() as $item) {
211
 
219
  $item->setBaseRowTotalInclTax($item->setBaseRowTotal());*/
220
  //------------------------------------------------------------>
221
 
222
+ Mage::log('Observer->changeQuoteAddressSkybox->Item->getRowTotalSkybox->' . $item->getRowTotalSkybox(),
223
+ null, 'TotalSales.log', true);
224
 
225
  $totals += $item->getRowTotalSkybox();
226
  }
279
  $address->setPriceInclTax($totals);
280
  $address->setBasePriceInclTax($baseTotals);
281
 
282
+ $totals = floatval(preg_replace("/[^-0-9\.]/", "", $totals));
283
  //$address->setGrandTotal($totals+$totalTax);
284
+ $address->setGrandTotal($totals + $totalTax);
285
+ $address->setBaseGrandTotal($baseTotals + $totalTax);
286
 
287
  //$address->save();
288
 
294
  }
295
 
296
  }
297
+
298
+ /**
299
+ * Hide Skybox Shipping Method
300
+ * @param Varien_Event_Observer $observer
301
+ */
302
+ public function hideShippingMethod(Varien_Event_Observer $observer)
303
+ {
304
+ if (Mage::getDesign()->getArea() === Mage_Core_Model_App_Area::AREA_FRONTEND) {
305
+ $quote = $observer->getEvent()->getQuote();
306
+ $store = Mage::app()->getStore($quote->getStoreId());
307
+ $carriers = Mage::getStoreConfig('carriers', $store);
308
+
309
+ $hiddenMethodCode = 'skyboxcheckout_shipping';
310
+
311
+ foreach ($carriers as $carrierCode => $carrierConfig) {
312
+ if ($carrierCode == $hiddenMethodCode) {
313
+ $store->setConfig("carriers/{$carrierCode}/active", '0');
314
+ }
315
+ }
316
+ }
317
+ }
318
+ }
app/code/community/Skybox/Checkout/Model/Quote/Item.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Skybox Checkout
5
+ *
6
+ * @category Skybox
7
+ * @package Skybox_Checkout
8
+ * @copyright Copyright (c) 2017 Skybox Checkout. (http://www.skyboxcheckout.com)
9
+ */
10
+ class Skybox_Checkout_Model_Quote_Item extends Mage_Sales_Model_Quote_Item
11
+ {
12
+ /**
13
+ * Declare quote item quantity
14
+ *
15
+ * @param float $qty
16
+ * @return Mage_Sales_Model_Quote_Item
17
+ */
18
+ public function setQty($qty)
19
+ {
20
+ $oldQty = $this->_getData('qty');
21
+
22
+ parent::setQty($qty);
23
+ $qty = $this->getQty();
24
+
25
+ if ($oldQty != $qty) {
26
+ $skyboxProductId = $this->getIdProductSkybox();
27
+
28
+ if ($skyboxProductId) {
29
+ $api_checkout = Mage::getModel('skyboxcheckout/api_checkout');
30
+ $api_checkout->UpdateProductOfCart($skyboxProductId, $qty);
31
+ }
32
+ }
33
+ return $this;
34
+ }
35
+
36
+ }
app/code/community/Skybox/Checkout/controllers/CalculateController.php CHANGED
@@ -67,7 +67,7 @@ class Skybox_Checkout_CalculateController extends Mage_Core_Controller_Front_Act
67
  break;
68
  }
69
 
70
- $extraHtml = '<p class="label" id="skybox-configurable-price-from-'
71
  . $product->getId()
72
  //. $this->getIdSuffix()
73
  . ''
67
  break;
68
  }
69
 
70
+ $extraHtml = '<div style="font-weight:bold" id="skybox-configurable-price-from-'
71
  . $product->getId()
72
  //. $this->getIdSuffix()
73
  . ''
app/code/community/Skybox/Checkout/controllers/InternationalController.php CHANGED
@@ -11,7 +11,7 @@ class Skybox_Checkout_InternationalController extends Mage_Core_Controller_Front
11
  {
12
  public function indexAction()
13
  {
14
- /* var $checkout_cart Mage_Checkout_Model_Session */
15
  $checkout_cart = Mage::getSingleton('checkout/cart');
16
  $items = $checkout_cart->getItems();
17
 
@@ -21,6 +21,29 @@ class Skybox_Checkout_InternationalController extends Mage_Core_Controller_Front
21
  );
22
  }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  $this->loadLayout();
25
  $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
26
  //$this->getLayout()->getBlock('root')->setTemplate('skybox/checkout/pagecheckout.phtml');
11
  {
12
  public function indexAction()
13
  {
14
+ /** @var $checkout_cart Mage_Checkout_Model_Session */
15
  $checkout_cart = Mage::getSingleton('checkout/cart');
16
  $items = $checkout_cart->getItems();
17
 
21
  );
22
  }
23
 
24
+ $cart_count = Mage::helper('checkout/cart')->getSummaryCount();
25
+
26
+ /** @var $config Skybox_Checkout_Model_Config */
27
+ $config = Mage::getModel('skyboxcore/config');
28
+ $cart = $config->getSession()->getCartSkybox();
29
+
30
+ $cartItemCount = 0;
31
+ if (!empty($cart)) {
32
+ $cartItemCount = intval($cart->{'CartItemCount'});
33
+ }
34
+
35
+ /** @var $api_mproduct Skybox_Catalog_Model_Api_Product */
36
+ $api_mproduct = Mage::getModel('skyboxcatalog/api_product');
37
+
38
+ if ($cart_count != $cartItemCount && $api_mproduct->getLocationAllow()) {
39
+
40
+ $processUrl = Mage::getUrl() . 'skbcheckout/process';
41
+ $returnUrl = Mage::getUrl() . 'skbcheckout/international';
42
+
43
+ $url = $processUrl . '?return_url=' . $returnUrl;
44
+ $this->getResponse()->setRedirect($url);
45
+ }
46
+
47
  $this->loadLayout();
48
  $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');
49
  //$this->getLayout()->getBlock('root')->setTemplate('skybox/checkout/pagecheckout.phtml');
app/code/community/Skybox/Checkout/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Skybox_Checkout>
5
- <version>0.1.0</version>
6
  <codePool>community</codePool>
7
  </Skybox_Checkout>
8
  </modules>
@@ -160,6 +160,11 @@
160
  <cart>Skybox_Checkout_Model_Cart</cart>
161
  </rewrite>
162
  </checkout>
 
 
 
 
 
163
  </models>
164
  <blocks>
165
  <skyboxcheckout>
@@ -243,6 +248,14 @@
243
  </skyboxcheckout_removetax_observer>
244
  </observers>
245
  </sales_quote_collect_totals_before-->
 
 
 
 
 
 
 
 
246
  </events>
247
  <!--rewrite>
248
  <skybox_checkout_cart>
@@ -432,7 +445,7 @@
432
  <default>
433
  <carriers>
434
  <skyboxcheckout_shipping>
435
- <active>0</active>
436
  <model>skyboxcheckout/carrier</model>
437
  <title>SkyboxCheckout Method</title>
438
  <price>0</price>
2
  <config>
3
  <modules>
4
  <Skybox_Checkout>
5
+ <version>1.2.4</version>
6
  <codePool>community</codePool>
7
  </Skybox_Checkout>
8
  </modules>
160
  <cart>Skybox_Checkout_Model_Cart</cart>
161
  </rewrite>
162
  </checkout>
163
+ <sales>
164
+ <rewrite>
165
+ <quote_item>Skybox_Checkout_Model_Quote_Item</quote_item>
166
+ </rewrite>
167
+ </sales>
168
  </models>
169
  <blocks>
170
  <skyboxcheckout>
248
  </skyboxcheckout_removetax_observer>
249
  </observers>
250
  </sales_quote_collect_totals_before-->
251
+ <sales_quote_collect_totals_before>
252
+ <observers>
253
+ <frontend_shipping_rates_sales_quote_collect_totals_before>
254
+ <class>Skybox_Checkout_Model_Observer</class>
255
+ <method>hideShippingMethod</method>
256
+ </frontend_shipping_rates_sales_quote_collect_totals_before>
257
+ </observers>
258
+ </sales_quote_collect_totals_before>
259
  </events>
260
  <!--rewrite>
261
  <skybox_checkout_cart>
445
  <default>
446
  <carriers>
447
  <skyboxcheckout_shipping>
448
+ <active>1</active>
449
  <model>skyboxcheckout/carrier</model>
450
  <title>SkyboxCheckout Method</title>
451
  <price>0</price>
app/code/community/Skybox/Checkout/sql/skyboxcheckout_setup/mysql4-upgrade-0.1.0-0.1.1.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
4
 
5
 
6
  $installer = new Mage_Sales_Model_Mysql4_Setup('core_setup');
@@ -66,7 +66,3 @@ $installer->addAttribute('order', 'concepts_skybox', array('type' => 'text', 'vi
66
  */
67
 
68
  $installer->endSetup();
69
-
70
- die("Exit for now");
71
-
72
-
1
  <?php
2
 
3
+ echo 'Running This Upgrade: ' . get_class($this) . "\n <br /> \n";
4
 
5
 
6
  $installer = new Mage_Sales_Model_Mysql4_Setup('core_setup');
66
  */
67
 
68
  $installer->endSetup();
 
 
 
 
app/code/community/Skybox/Checkout/sql/skyboxcheckout_setup/mysql4-upgrade-0.1.0-0.1.2.php CHANGED
@@ -14,6 +14,3 @@ $installer->addAttribute('order', 'others_total_usd_skybox', array('type' => 'va
14
  */
15
  $installer->endSetup();
16
 
17
- die("Exit for now");
18
-
19
-
14
  */
15
  $installer->endSetup();
16
 
 
 
 
app/code/community/Skybox/Core/Model/Api/Restful.php CHANGED
@@ -70,6 +70,7 @@ class Skybox_Core_Model_Api_Restful extends Skybox_Core_Model_Api_Abstract
70
  return $this;
71
  }
72
 
 
73
  public function getGuidApi()
74
  {
75
  $guidId = null;
@@ -85,7 +86,7 @@ class Skybox_Core_Model_Api_Restful extends Skybox_Core_Model_Api_Abstract
85
  if (!$guidId) {
86
  $skyboxSession = $this->_config->getSession()->getCookieGuid();
87
  if ($skyboxSession) {
88
- Mage::log(' | CallApiRest->Error2 | ', null, 'guid.log', true);
89
  Mage::log("Call getGuidApi() from getSession(): " . $this->_config->getSession()->getCookieGuid(), null,
90
  'guid.log', true);
91
  $guidId = $this->_config->getSession()->getCookieGuid();
@@ -360,4 +361,4 @@ class Skybox_Core_Model_Api_Restful extends Skybox_Core_Model_Api_Abstract
360
  {
361
  return (bool)Mage::getStoreConfig('skyboxinternational/skyboxsettings/skyboxactive', Mage::app()->getStore());
362
  }
363
- }
70
  return $this;
71
  }
72
 
73
+ // @todo Rewrite the way to get GUID
74
  public function getGuidApi()
75
  {
76
  $guidId = null;
86
  if (!$guidId) {
87
  $skyboxSession = $this->_config->getSession()->getCookieGuid();
88
  if ($skyboxSession) {
89
+ // Mage::log(' | CallApiRest->Error2 | ', null, 'guid.log', true);
90
  Mage::log("Call getGuidApi() from getSession(): " . $this->_config->getSession()->getCookieGuid(), null,
91
  'guid.log', true);
92
  $guidId = $this->_config->getSession()->getCookieGuid();
361
  {
362
  return (bool)Mage::getStoreConfig('skyboxinternational/skyboxsettings/skyboxactive', Mage::app()->getStore());
363
  }
364
+ }
app/code/community/Skybox/Core/Model/Standard.php CHANGED
@@ -270,8 +270,8 @@ class Skybox_Core_Model_Standard
270
  }
271
 
272
 
273
- $total_time = round(microtime(true)-$start, 4);
274
- Mage::log('Servicio generado ['.$action.']: '.$total_time.' segundos.', null, 'timer.log',true);
275
 
276
  return $this;
277
  }
270
  }
271
 
272
 
273
+ // $total_time = round(microtime(true)-$start, 4);
274
+ // Mage::log('Servicio generado ['.$action.']: '.$total_time.' segundos.', null, 'timer.log',true);
275
 
276
  return $this;
277
  }
app/code/community/Skybox/Core/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Skybox_Core>
5
- <version>0.1.0</version>
6
  <codePool>community</codePool>
7
  </Skybox_Core>
8
  </modules>
@@ -57,4 +57,4 @@
57
  </blocks>
58
 
59
  </global>
60
- </config>
2
  <config>
3
  <modules>
4
  <Skybox_Core>
5
+ <version>1.2.4</version>
6
  <codePool>community</codePool>
7
  </Skybox_Core>
8
  </modules>
57
  </blocks>
58
 
59
  </global>
60
+ </config>
app/code/community/Skybox/Core/sql/skyboxcore_setup/mysql4-install-0.1.0.php CHANGED
@@ -20,8 +20,6 @@ $installer->run("
20
  $installer->endSetup();
21
 
22
  echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
23
- die("Exit for now");
24
- //exit();
25
  */
26
 
27
  $installer = $this;
20
  $installer->endSetup();
21
 
22
  echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
 
 
23
  */
24
 
25
  $installer = $this;
app/code/community/Skybox/International/etc/config.xml CHANGED
@@ -1,7 +1,7 @@
1
  <config>
2
  <modules>
3
  <Skybox_International>
4
- <version>0.1.0</version>
5
  <codePool>community</codePool>
6
  </Skybox_International>
7
  </modules>
@@ -58,4 +58,4 @@
58
  </skyboxproduct>
59
  </skyboxinternational>
60
  </default>
61
- </config>
1
  <config>
2
  <modules>
3
  <Skybox_International>
4
+ <version>1.2.4</version>
5
  <codePool>community</codePool>
6
  </Skybox_International>
7
  </modules>
58
  </skyboxproduct>
59
  </skyboxinternational>
60
  </default>
61
+ </config>
app/code/community/Skybox/Services/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <modules>
4
  <Skybox_Services>
5
  <active>true</active>
6
- <version>0.1.0</version>
7
  <codePool>community</codePool>
8
  </Skybox_Services>
9
  </modules>
@@ -23,4 +23,4 @@
23
  </controller_front_init_routers>
24
  </events>
25
  </frontend-->
26
- </config>
3
  <modules>
4
  <Skybox_Services>
5
  <active>true</active>
6
+ <version>1.2.4</version>
7
  <codePool>community</codePool>
8
  </Skybox_Services>
9
  </modules>
23
  </controller_front_init_routers>
24
  </events>
25
  </frontend-->
26
+ </config>
app/design/frontend/base/default/template/skybox/checkout/cart.phtml CHANGED
@@ -1,291 +1,308 @@
1
  <?php
 
2
  $_helper = Mage::helper('skyboxinternational/data');
3
 
4
- /** @var Skybox_Core_Model_Config $_config */
5
- $_config = Mage::getModel('skyboxcore/config');
6
 
7
- /** @var Skybox_Checkout_Model_Api_Checkout $_checkout */
8
- $_checkout = Mage::getModel('skyboxcheckout/api_checkout');
9
 
10
- /** @var Skybox_Core_Helper_Allow $allowHelper */
11
- $allowHelper = Mage::helper('skyboxcore/allow');
12
 
13
- $isCartEnabled = $allowHelper->isCartBarEnabled();
 
14
 
15
- $_cartDataURL = "";
16
- $_merchant = $_helper->getMerchantCode();
17
- $template = "";
18
- $cartId = $_helper->getCartId();
19
 
20
- Mage::log("InitializeBarSkybox ", null, 'cartphtml.log', true);
21
- $_checkout->InitializeBarSkybox();
 
 
22
 
23
- $change_country = false;
 
24
 
25
- $request = $this->getRequest();
26
- $module = $request->getModuleName();
27
- $controller = $request->getControllerName();
28
- $action = $request->getActionName();
29
- $getHomeUrl = Mage::helper('core/url')->getHomeUrl();
30
- $urlCheckCart = Mage::getUrl("checkout/cart");
31
 
32
- $cart = $_config->getSession()->getCartSkybox();
33
- /**
34
- * Start Aditional we add a line debug with integration information
35
- */
36
- echo '<script>
 
 
 
 
 
 
 
37
  console.log("LocationAllowService: ' . $_checkout->getLocationAllow() . ' ");
38
  </script>';
39
- /**
40
- * End Aditional we add a line debug with integration information
41
- */
42
  //$template = "<a href='#' id='link_choise_country'>&nbsp;</a>";
43
  // Load CSS & JS
44
- $skybox_url = $_helper->getSkyboxUrlMain();// $_config->skyboxDefaultUrl;
45
- $api_css_button_international = $skybox_url . 'widgets/api-button/css/api-button-international-css.ashx';
46
- $api_css_button_international .= '?s=' . $_helper->getMerchantCode();
47
- $api_css_button_international .= '&CssVersion=' . $_helper->getCssVersion();
48
- $api_js_button_international = $skybox_url . 'Content/debug/API/js/api-button-tooltip.js';
49
- $countryChange = 0;
50
-
51
- if($allowHelper->isCartBarEnabled()) :
52
- $countryChange = 1;
53
- $template = '';
54
- $cart = $_config->getSession()->getCartSkybox();
55
- if (!empty($cart)) :
56
- $template = $cart->BarHtmlTemplate;
57
- foreach ($cart as $key => $value) :
58
- $template = str_replace('{' . $key . '}', $value, $template);
59
- endforeach;
 
 
 
60
  endif;
61
- $_cartDataURL = $cart->CartDataURL;
62
- echo $template;
63
- endif;
64
 
65
- if($allowHelper->isChangeCountryEnabled()):
66
- $cart = $_config->getSession()->getCartSkybox();
67
- $template = "<div class='main-container' style='padding: 10px 0 0;text-align: right;'>";
68
- $template .= "<div class='change_country'>";
69
- $template .= "<a class='skx_position_option_country' href='javascript:;'>Change country</a>";
70
- $template .= "</div>";
71
- $template .= "</div>";
72
- $change_country = true;
73
- $countryChange = 0;
74
- $_cartDataURL = $cart->CartDataURL;
75
- echo $template;
76
- endif;
77
-
78
- $skyBoxUrlClientBase= $_helper->getSkyBoxUrlAPI();
79
- $storeCode = Mage::getModel('skyboxcatalog/api_product')->getStoreCode();
80
- $skyBoxUrlClientGet = str_replace("apirest/", "", $skyBoxUrlClientBase);
81
- $skyBoxUrlClient = $skyBoxUrlClientGet . "multiplecalculate/" . $storeCode . "/calc-";
82
- ?>
83
- <link rel="stylesheet" type="text/css" href="<?php echo $api_css_button_international; ?>"/>
84
- <link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/skybox/style.css?v=' . $_helper->getCssVersion()); ?>"/>
85
- <script type="text/javascript">
86
- var URL_CHECK_CART = "<?php echo $urlCheckCart ?>";
87
- var CART_ID = "<?php echo $cartId ?>";
88
- var CART_DATA_URL_SKYBOX= "<?php echo $_cartDataURL ?>";
89
- var MERCHANT_ID_SKYBOX = "<?php echo $_merchant ?>";
90
- var SKYBOX_URL = "<?php echo $skybox_url ?>";
91
- var CHANGE_COUNTRY = "<?php echo $change_country ?>";
92
- var ACTUAL_URI = "<?php echo 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'] ?>";
93
- var GET_HOME_URL = "<?php echo $getHomeUrl ?>";
94
- var COUNTRY_CHANGE = "<?php echo $countryChange?>";
95
- var IS_SKYBOX_VISIBLE = "<?php echo $_checkout->getLocationAllow(); ?>";
96
- var URL_BASE_MAGENTO = "<?php echo Mage::getBaseUrl() ?>";
97
- var IS_REGISTRATION_DISABLED_SKYBOX = 1;
98
-
99
- jQuery(document).ready(function () {
100
- if (!jQuery().fancybox) {
101
- var fileref = document.createElement("link");
102
- fileref.rel = "stylesheet";
103
- fileref.type = "text/css";
104
- fileref.href = "<?php echo $this->getSkinUrl('css/skybox/jquery.fancybox.css');?>";
105
- document.getElementsByTagName("head")[0].appendChild(fileref);
106
- jQuery('head').append(jQuery('<script />').attr('src','<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'js/skybox/jquery.fancybox.js'; ?>'));
107
- }
108
- jQuery(".skybox-price-set").each(function (index) {
109
- var SkyBoxUrlClient = "<?php echo $skyBoxUrlClient;?>";
110
- var dataId = jQuery(this).attr("id");
111
- var id = jQuery(this).attr("product-id");
112
- var url = SkyBoxUrlClient + id + ".html";
113
- var content = jQuery.get(url, function (data) {
114
- jQuery("#" + dataId).html(data);
 
 
 
115
  });
116
  });
117
- });
118
- </script>
119
- <script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'js/skybox/main.js'; ?>"></script>
120
- <script type="text/javascript">
121
- (function ($) {
122
-
123
- var widthPage = 0;
124
- var heightPage = 0;
125
- var popup = {};
126
- var popupWidth = 540;
127
- var popupHeight = 545;
128
- var win = '';
129
-
130
- function goToCart() {
131
- document.location = URL_CHECK_CART;
132
- }
133
-
134
- function goToInitializeSession() {
135
- var idCart = CART_ID;
136
- var datos = CART_DATA_URL_SKYBOX;
137
- var merchant = MERCHANT_ID_SKYBOX;
138
- var actualUri = ACTUAL_URI + "?LoadFrame=1";
139
- var url = SKYBOX_URL + "WebForms/PublicSite/Tracking.aspx?" + datos + "&merchant=" + merchant + "&idCart=" + idCart + "&ReLoad=1&uri=" + actualUri;
140
- var name = 'initSession' + Date.now();
141
- callAlphacube();
142
- }
143
-
144
- function getReturnUrl() {
145
- var result = document.URL;
146
- <?php $forceReload = (Mage::getBlockSingleton('page/html_header')->getIsHomePage()) ? 'force_reload' : '';?>
147
- result += '<?php echo $forceReload; ?>';
148
- return result;
149
- }
150
-
151
- function callAlphacube() {
152
- var alphacube_ = document.querySelectorAll('.alphacube_close');
153
- if (alphacube_.length > 0) {
154
- var overlay_ = document.getElementById("overlay_modal");
155
- if (overlay_ !== null) overlay_.style.display = '';
156
- var id_modal = (alphacube_[1]) ? alphacube_[1].parentNode.getAttribute('id') : '';
157
- try { document.getElementById(id_modal).remove();} catch (e) {}
158
  }
159
- }
160
-
161
- function goToLocation() {
162
- win = 'resync';
163
- var datos = CART_DATA_URL_SKYBOX;
164
- var process_url = GET_HOME_URL + "skbcheckout/process";
165
- var return_url = getReturnUrl();
166
- var change_country_status = CHANGE_COUNTRY;
167
- var url = SKYBOX_URL + "Webforms/PublicSite/ReSync.aspx?" + datos;
168
- url += "&process_url=" + process_url;
169
- url += "&return_url=" + return_url;
170
- url += "&change_country=" + change_country_status;
171
-
172
- var _size = getSizeForPopup();
173
- var name = 'selectLocation' + Date.now();
174
- callAlphacube();
175
- }
176
-
177
- function goToTrackingLocation() {
178
- var url = SKYBOX_URL + "Webforms/PublicSite/Tracking.aspx?" + CART_DATA_URL_SKYBOX + "&idCart=" + CART_ID;
179
- var name = 'tracking' + Date.now();
180
- showPopup(name, '', url, (widthPage - 50 ), ((heightPage < 800) ? heightPage - 50 : 800));
181
- }
182
-
183
- function loadIframe() {
184
- var actualUri = ACTUAL_URI;
185
- var flgLoadIframe = "<?php echo (isset($_GET['LoadFrame'])) ? $_GET['LoadFrame'] : 0; ?>";
186
- if (flgLoadIframe === "1") {
187
- if (actualUri.indexOf("skbcheckout/international") === -1) goToInitializeSession();
188
  }
189
- }
190
-
191
- function postMessageIframe() {
192
- var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
193
- var eventer = window[eventMethod];
194
- var messageEvent = (eventMethod === "attachEvent") ? "onmessage" : "message";
195
- eventer(messageEvent, function (e) {recalculateHeightIframe(e.data);}, false);
196
- }
197
-
198
- function recalculateHeightIframe(data) {
199
- if (data.win === 'resync') {
200
- popupHeight = data.height;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  var _size = getSizeForPopup();
202
- try{ popup.setSize(_size.width, _size.height);}
203
- catch (e) {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  }
205
- }
206
 
207
- function browserResize() {
208
- jQuery(window).resize(function () {
209
- if (!jQuery.isEmptyObject(popup)) {
210
  var _size = getSizeForPopup();
211
- popup.setSize(_size.width, _size.height)
 
 
 
 
212
  }
213
- });
214
- }
215
 
216
- function getSizeForPopup() {
217
- var _width = jQuery(window).width();
218
- var _height = jQuery(window).height();
219
- _width = (_width < popupWidth) ? _width - 30 : popupWidth ;
220
- return {width: _width, height: popupHeight};
221
- }
 
 
222
 
223
- $(".skx_position_option_country").unbind().click(function(){
224
- goToLocation();
225
- });
 
 
 
226
 
227
- $(".skx_banner_image_account").unbind().click(function(){
228
- goToInitializeSession();
229
- });
230
 
231
- $(".skx_banner_image_car").unbind().click(function(){
232
- goToCart();
233
- });
234
 
235
- $(".skx_banner_image_tracking").unbind().click(function(){
236
- goToTrackingLocation();
237
- });
238
 
239
- $("#link_choise_country").unbind().click(function(){
240
- goToCart();
241
- });
242
 
243
- $(document).ready(function () {
244
- widthPage = $(window).width();
245
- heightPage = $(window).height();
246
- postMessageIframe();
247
- loadIframe();
248
- browserResize();
249
- <?php
250
- // note: Just to force reload page on Home Page.
251
- $forceReload = $_config->getSession()->getChangeCountryHomePage();
252
- if (Mage::getBlockSingleton('page/html_header')->getIsHomePage() && $forceReload) :
253
- $_config->getSession()->setChangeCountryHomePage(null);
254
- echo 'window.location.reload(false);';
255
- endif;
256
- ?>
257
- });
258
- })(jQuery);
259
- </script>
260
-
261
- <script type="text/javascript">
262
- //<![CDATA[
263
- var SKYBOX_OPTIONS_PRICE_URL = '<?php echo Mage::getUrl(); ?>skbcheckout/calculate';
264
- //]]>
265
- </script>
266
- <script type="text/javascript" src="<?php echo $api_js_button_international; ?>"></script>
267
- <script>
268
- setTimeout(function(){
269
- var country_change = "<?php echo $countryChange?>";
270
- if(parseInt(country_change) === 1){
271
- var currencyISO_ = document.getElementsByClassName('skx_banner_label_currencyISO');
272
- if(currencyISO_.length > 1){
273
- var nextSiblingOne = currencyISO_[0].nextElementSibling;
274
- var getAttrNextSiblingOne = nextSiblingOne.getAttribute('class');
275
- var nextSiblingLast = currencyISO_[1].nextElementSibling;
276
- nextSiblingLast.setAttribute('class',getAttrNextSiblingOne);
277
- currencyISO_[1].innerHTML = currencyISO_[0].innerHTML;
278
- }
279
- }else{
280
- var optCountry = document.getElementsByClassName('skx_position_option_country');
281
- if(optCountry.length > 1) {
282
- optCountry[1].innerHTML = optCountry[0].innerText;
283
- try{
284
- document.getElementById('l_checkout_view_account').style.display = 'none';
285
- }catch (e){
286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  }
288
  }
289
- }
290
- },500);
291
- </script>
 
 
 
1
  <?php
2
+ /** @var Skybox_International_Helper_Data $_helper */
3
  $_helper = Mage::helper('skyboxinternational/data');
4
 
5
+ if ($_helper->getActive()) {
 
6
 
7
+ /** @var Skybox_Core_Model_Config $_config */
8
+ $_config = Mage::getModel('skyboxcore/config');
9
 
10
+ /** @var Skybox_Checkout_Model_Api_Checkout $_checkout */
11
+ $_checkout = Mage::getModel('skyboxcheckout/api_checkout');
12
 
13
+ /** @var Skybox_Core_Helper_Allow $allowHelper */
14
+ $allowHelper = Mage::helper('skyboxcore/allow');
15
 
16
+ $isCartEnabled = $allowHelper->isCartBarEnabled();
 
 
 
17
 
18
+ $_cartDataURL = "";
19
+ $_merchant = $_helper->getMerchantCode();
20
+ $template = "";
21
+ $cartId = $_helper->getCartId();
22
 
23
+ Mage::log("InitializeBarSkybox ", null, 'cartphtml.log', true);
24
+ $_checkout->InitializeBarSkybox();
25
 
26
+ $change_country = false;
 
 
 
 
 
27
 
28
+ $request = $this->getRequest();
29
+ $module = $request->getModuleName();
30
+ $controller = $request->getControllerName();
31
+ $action = $request->getActionName();
32
+ $getHomeUrl = Mage::helper('core/url')->getHomeUrl();
33
+ $urlCheckCart = Mage::getUrl("checkout/cart");
34
+
35
+ $cart = $_config->getSession()->getCartSkybox();
36
+ /**
37
+ * Start Aditional we add a line debug with integration information
38
+ */
39
+ echo '<script>
40
  console.log("LocationAllowService: ' . $_checkout->getLocationAllow() . ' ");
41
  </script>';
42
+ /**
43
+ * End Aditional we add a line debug with integration information
44
+ */
45
  //$template = "<a href='#' id='link_choise_country'>&nbsp;</a>";
46
  // Load CSS & JS
47
+ $skybox_url = $_helper->getSkyboxUrlMain();// $_config->skyboxDefaultUrl;
48
+ $api_css_button_international = $skybox_url . 'widgets/api-button/css/api-button-international-css.ashx';
49
+ $api_css_button_international .= '?s=' . $_helper->getMerchantCode();
50
+ $api_css_button_international .= '&CssVersion=' . $_helper->getCssVersion();
51
+ $api_js_button_international = $skybox_url . 'Content/debug/API/js/api-button-tooltip.js';
52
+ $countryChange = 0;
53
+
54
+ if ($allowHelper->isCartBarEnabled()) :
55
+ $countryChange = 1;
56
+ $template = '';
57
+ $cart = $_config->getSession()->getCartSkybox();
58
+ if (!empty($cart)) :
59
+ $template = $cart->BarHtmlTemplate;
60
+ foreach ($cart as $key => $value) :
61
+ $template = str_replace('{' . $key . '}', $value, $template);
62
+ endforeach;
63
+ endif;
64
+ $_cartDataURL = $cart->CartDataURL;
65
+ echo $template;
66
  endif;
 
 
 
67
 
68
+ if ($allowHelper->isChangeCountryEnabled()):
69
+ $cart = $_config->getSession()->getCartSkybox();
70
+ $template = "<div class='main-container' style='padding: 10px 0 0;text-align: right;'>";
71
+ $template .= "<div class='change_country'>";
72
+ $template .= "<a class='skx_position_option_country' href='javascript:;'>Change country</a>";
73
+ $template .= "</div>";
74
+ $template .= "</div>";
75
+ $change_country = true;
76
+ $countryChange = 0;
77
+ $_cartDataURL = $cart->CartDataURL;
78
+ echo $template;
79
+ endif;
80
+
81
+ $skyBoxUrlClientBase = $_helper->getSkyBoxUrlAPI();
82
+ $storeCode = Mage::getModel('skyboxcatalog/api_product')->getStoreCode();
83
+ $skyBoxUrlClientGet = str_replace("apirest/", "", $skyBoxUrlClientBase);
84
+ $skyBoxUrlClient = $skyBoxUrlClientGet . "multiplecalculate/" . $storeCode . "/calc-";
85
+ ?>
86
+ <link rel="stylesheet" type="text/css" href="<?php echo $api_css_button_international; ?>"/>
87
+ <link rel="stylesheet" type="text/css"
88
+ href="<?php echo $this->getSkinUrl('css/skybox/style.css?v=' . $_helper->getCssVersion()); ?>"/>
89
+ <script type="text/javascript">
90
+ var URL_CHECK_CART = "<?php echo $urlCheckCart ?>";
91
+ var CART_ID = "<?php echo $cartId ?>";
92
+ var CART_DATA_URL_SKYBOX = "<?php echo $_cartDataURL ?>";
93
+ var MERCHANT_ID_SKYBOX = "<?php echo $_merchant ?>";
94
+ var SKYBOX_URL = "<?php echo $skybox_url ?>";
95
+ var CHANGE_COUNTRY = "<?php echo $change_country ?>";
96
+ var ACTUAL_URI = "<?php echo 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'] ?>";
97
+ var GET_HOME_URL = "<?php echo $getHomeUrl ?>";
98
+ var COUNTRY_CHANGE = "<?php echo $countryChange?>";
99
+ var IS_SKYBOX_VISIBLE = "<?php echo $_checkout->getLocationAllow(); ?>";
100
+ var URL_BASE_MAGENTO = "<?php echo Mage::getBaseUrl() ?>";
101
+ var IS_REGISTRATION_DISABLED_SKYBOX = 1;
102
+
103
+ jQuery(document).ready(function () {
104
+ if (!jQuery().fancybox) {
105
+ var fileref = document.createElement("link");
106
+ fileref.rel = "stylesheet";
107
+ fileref.type = "text/css";
108
+ fileref.href = "<?php echo $this->getSkinUrl('css/skybox/jquery.fancybox.css');?>";
109
+ document.getElementsByTagName("head")[0].appendChild(fileref);
110
+ jQuery('head').append(jQuery('<script />').attr('src', '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'js/skybox/jquery.fancybox.js'; ?>'));
111
+ }
112
+ jQuery(".skybox-price-set").each(function (index) {
113
+ var SkyBoxUrlClient = "<?php echo $skyBoxUrlClient;?>";
114
+ var dataId = jQuery(this).attr("id");
115
+ var id = jQuery(this).attr("product-id");
116
+ var url = SkyBoxUrlClient + id + ".html";
117
+ console.log("URL : " + url);
118
+ var content = jQuery.get(url, function (data) {
119
+ jQuery("#" + dataId).html(data);
120
+ });
121
  });
122
  });
123
+ </script>
124
+ <script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'js/skybox/main.js'; ?>"></script>
125
+ <script type="text/javascript">
126
+ (function ($) {
127
+
128
+ var widthPage = 0;
129
+ var heightPage = 0;
130
+ var popup = {};
131
+ var popupWidth = 540;
132
+ var popupHeight = 545;
133
+ var win = '';
134
+
135
+ function goToCart() {
136
+ document.location = URL_CHECK_CART;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  }
138
+
139
+ function goToInitializeSession() {
140
+ var idCart = CART_ID;
141
+ var datos = CART_DATA_URL_SKYBOX;
142
+ var merchant = MERCHANT_ID_SKYBOX;
143
+ var actualUri = ACTUAL_URI + "?LoadFrame=1";
144
+ var url = SKYBOX_URL + "WebForms/PublicSite/Tracking.aspx?" + datos + "&merchant=" + merchant + "&idCart=" + idCart + "&ReLoad=1&uri=" + actualUri;
145
+ var name = 'initSession' + Date.now();
146
+ callAlphacube();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
148
+
149
+ function getReturnUrl() {
150
+ var result = document.URL;
151
+ <?php $forceReload = (Mage::getBlockSingleton('page/html_header')->getIsHomePage()) ? 'force_reload' : '';?>
152
+ result += '<?php echo $forceReload; ?>';
153
+ return result;
154
+ }
155
+
156
+ function callAlphacube() {
157
+ var alphacube_ = document.querySelectorAll('.alphacube_close');
158
+ if (alphacube_.length > 0) {
159
+ var overlay_ = document.getElementById("overlay_modal");
160
+ if (overlay_ !== null) overlay_.style.display = '';
161
+ var id_modal = (alphacube_[1]) ? alphacube_[1].parentNode.getAttribute('id') : '';
162
+ try {
163
+ document.getElementById(id_modal).remove();
164
+ } catch (e) {
165
+ }
166
+ }
167
+ }
168
+
169
+ function goToLocation() {
170
+ win = 'resync';
171
+ var datos = CART_DATA_URL_SKYBOX;
172
+ var process_url = GET_HOME_URL + "skbcheckout/process";
173
+ var return_url = getReturnUrl();
174
+ var change_country_status = CHANGE_COUNTRY;
175
+ var url = SKYBOX_URL + "Webforms/PublicSite/ReSync.aspx?" + datos;
176
+ url += "&process_url=" + process_url;
177
+ url += "&return_url=" + return_url;
178
+ url += "&change_country=" + change_country_status;
179
+
180
  var _size = getSizeForPopup();
181
+ var name = 'selectLocation' + Date.now();
182
+ callAlphacube();
183
+ }
184
+
185
+ function goToTrackingLocation() {
186
+ var url = SKYBOX_URL + "Webforms/PublicSite/Tracking.aspx?" + CART_DATA_URL_SKYBOX + "&idCart=" + CART_ID;
187
+ var name = 'tracking' + Date.now();
188
+ showPopup(name, '', url, (widthPage - 50 ), ((heightPage < 800) ? heightPage - 50 : 800));
189
+ }
190
+
191
+ function loadIframe() {
192
+ var actualUri = ACTUAL_URI;
193
+ var flgLoadIframe = "<?php echo (isset($_GET['LoadFrame'])) ? $_GET['LoadFrame'] : 0; ?>";
194
+ if (flgLoadIframe === "1") {
195
+ if (actualUri.indexOf("skbcheckout/international") === -1) goToInitializeSession();
196
+ }
197
+ }
198
+
199
+ function postMessageIframe() {
200
+ var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
201
+ var eventer = window[eventMethod];
202
+ var messageEvent = (eventMethod === "attachEvent") ? "onmessage" : "message";
203
+ eventer(messageEvent, function (e) {
204
+ recalculateHeightIframe(e.data);
205
+ }, false);
206
  }
 
207
 
208
+ function recalculateHeightIframe(data) {
209
+ if (data.win === 'resync') {
210
+ popupHeight = data.height;
211
  var _size = getSizeForPopup();
212
+ try {
213
+ popup.setSize(_size.width, _size.height);
214
+ }
215
+ catch (e) {
216
+ }
217
  }
218
+ }
 
219
 
220
+ function browserResize() {
221
+ jQuery(window).resize(function () {
222
+ if (!jQuery.isEmptyObject(popup)) {
223
+ var _size = getSizeForPopup();
224
+ popup.setSize(_size.width, _size.height)
225
+ }
226
+ });
227
+ }
228
 
229
+ function getSizeForPopup() {
230
+ var _width = jQuery(window).width();
231
+ var _height = jQuery(window).height();
232
+ _width = (_width < popupWidth) ? _width - 30 : popupWidth;
233
+ return {width: _width, height: popupHeight};
234
+ }
235
 
236
+ $(".skx_position_option_country").unbind().click(function () {
237
+ goToLocation();
238
+ });
239
 
240
+ $(".skx_banner_image_account").unbind().click(function () {
241
+ goToInitializeSession();
242
+ });
243
 
244
+ $(".skx_banner_image_car").unbind().click(function () {
245
+ goToCart();
246
+ });
247
 
248
+ $(".skx_banner_image_tracking").unbind().click(function () {
249
+ goToTrackingLocation();
250
+ });
251
 
252
+ $("#link_choise_country").unbind().click(function () {
253
+ goToCart();
254
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
 
256
+ $(document).ready(function () {
257
+ widthPage = $(window).width();
258
+ heightPage = $(window).height();
259
+ postMessageIframe();
260
+ loadIframe();
261
+ browserResize();
262
+ <?php
263
+ // note: Just to force reload page on Home Page.
264
+ $forceReload = $_config->getSession()->getChangeCountryHomePage();
265
+ if (Mage::getBlockSingleton('page/html_header')->getIsHomePage() && $forceReload) :
266
+ $_config->getSession()->setChangeCountryHomePage(null);
267
+ echo 'window.location.reload(false);';
268
+ endif;
269
+ ?>
270
+ });
271
+ })(jQuery);
272
+ </script>
273
+
274
+ <script type="text/javascript">
275
+ //<![CDATA[
276
+ var SKYBOX_OPTIONS_PRICE_URL = '<?php echo Mage::getUrl(); ?>skbcheckout/calculate';
277
+ //]]>
278
+ </script>
279
+ <script type="text/javascript" src="<?php echo $api_js_button_international; ?>"></script>
280
+ <script>
281
+ setTimeout(function () {
282
+ var country_change = "<?php echo $countryChange?>";
283
+ if (parseInt(country_change) === 1) {
284
+ var currencyISO_ = document.getElementsByClassName('skx_banner_label_currencyISO');
285
+ if (currencyISO_.length > 1) {
286
+ var nextSiblingOne = currencyISO_[0].nextElementSibling;
287
+ var getAttrNextSiblingOne = nextSiblingOne.getAttribute('class');
288
+ var nextSiblingLast = currencyISO_[1].nextElementSibling;
289
+ nextSiblingLast.setAttribute('class', getAttrNextSiblingOne);
290
+ currencyISO_[1].innerHTML = currencyISO_[0].innerHTML;
291
+ }
292
+ } else {
293
+ var optCountry = document.getElementsByClassName('skx_position_option_country');
294
+ if (optCountry.length > 1) {
295
+ optCountry[1].innerHTML = optCountry[0].innerText;
296
+ try {
297
+ document.getElementById('l_checkout_view_account').style.display = 'none';
298
+ } catch (e) {
299
+
300
+ }
301
  }
302
  }
303
+ }, 500);
304
+ </script>
305
+
306
+ <?php
307
+ }
308
+ ?>
app/etc/modules/Skybox_All.xml CHANGED
@@ -19,6 +19,7 @@
19
  <depends>
20
  <Mage_Core/>
21
  <Mage_Checkout/>
 
22
  <Mage_Shipping />
23
  <!--Skybox_Core /-->
24
  </depends>
@@ -33,4 +34,4 @@
33
  </depends>
34
  </Skybox_Catalog>
35
  </modules>
36
- </config>
19
  <depends>
20
  <Mage_Core/>
21
  <Mage_Checkout/>
22
+ <Mage_Sales />
23
  <Mage_Shipping />
24
  <!--Skybox_Core /-->
25
  </depends>
34
  </depends>
35
  </Skybox_Catalog>
36
  </modules>
37
+ </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>SKYBOZ456</name>
4
- <version>1.2.3</version>
5
  <stability>stable</stability>
6
  <license>Open</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Skybox Checkout enables a Magento ecommerce site to sell instantly to 180 countries &amp;amp; territories and accept payment in 140 local currencies. SkyBOX Checkout is a combination of technology tools &amp;amp; services to help retailers expand overseas while offering a localized full landed cost calculation to international shoppers. SkyBOX Checkout takes on full risk of fraud screening &amp;amp; international payments while providing competitive international shipping with full tracking via its proprietary logistics network.</description>
11
  <notes>Skybox Checkout enables a Magento ecommerce site to sell instantly to 180 countries &amp;amp; territories and accept payment in 140 local currencies. SkyBOX Checkout is a combination of technology tools &amp;amp; services to help retailers expand overseas while offering a localized full landed cost calculation to international shoppers. SkyBOX Checkout takes on full risk of fraud screening &amp;amp; international payments while providing competitive international shipping with full tracking via its proprietary logistics network.</notes>
12
  <authors><author><name>Emilio Lizarraga</name><user>Emilio</user><email>emilio@skynet.net</email></author></authors>
13
- <date>2017-05-04</date>
14
- <time>19:16:39</time>
15
- <contents><target name="magecommunity"><dir name="Skybox"><dir name="Catalog"><dir name="Block"><dir name="Bundle"><file name="Price.php" hash="9e6a41b50d37ed0884d08387ed793f99"/></dir><dir name="Catalog"><dir name="Category"><dir name="Tab"><file name="Skyboxcheckout.php" hash="c7e4e2df7a3b11ef640d18191eb01e2a"/></dir></dir></dir><dir name="Product"><file name="List.php" hash="c16ec428d23df931d0f56955254db92b"/><file name="Price.php" hash="f53f9c23c1c9cf537bbda17e1fa17110"/><dir name="Widget"><file name="New.php" hash="8988c7748816f60afbc01eae20707c52"/></dir></dir></dir><dir name="Model"><dir name="Api"><file name="Product.php" hash="60ab5d3b86dd989cb1dd164c1112eb39"/></dir><file name="Observer.php" hash="cb96f1f3c9e83821148ca03c13d4e7a4"/><dir name="Product"><dir name="Attribute"><dir name="Source"><file name="Categories.php" hash="2c8e12e8ec757115531380881a3a4a22"/></dir></dir><dir name="Type"><file name="Price.php" hash="70f5e1fd02249941a5f04ca472bf440b"/></dir></dir><dir name="Resource"><file name="Setup.php" hash="02712115776769fa7983632cc72bdbdb"/></dir></dir><dir name="etc"><file name="config.xml" hash="33ec1a2a9efe53d6788113984a599b1b"/></dir><dir name="sql"><dir name="skyboxcatalog_setup"><file name="mysql4-install-0.1.0.php" hash="dfa79dc84a6028a9171f709670a1b8d1"/></dir></dir></dir><dir name="Checkout"><dir name="Block"><dir name="Cart"><dir name="Item"><file name="Renderer.php" hash="c7862ab4b8936f0f15d2217b8175f3b2"/></dir><file name="Sidebar.php" hash="cefcb890a5d9d2d89d370d07eee11049"/><file name="Totals.php" hash="b695dde8996b21b65277dfc6efc50482"/></dir><dir name="Checkout"><dir name="Cart"><file name="Sidebar.php" hash="f2f99df06a26ce5bc580becff0f562aa"/></dir><file name="Cart.php" hash="f5bf7d91da455bf8b587b12090cb5f55"/><file name="Links.php" hash="3bc5d4ee0b81cab34ef85b616362ba82"/><dir name="Onepage"><file name="Link.php" hash="6ee490c1a0248814c79b003dc11b3b13"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Total.php" hash="aca921ee33625d8ab824c9f770154fe8"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="42382d6dbe0257802a7f69548de10122"/><file name="Url.php" hash="bc4ba406cff59e5fdebe1cd087c3d946"/></dir><dir name="Model"><dir name="Api"><file name="Checkout.php" hash="02f0ea9268f986c85998527290e6cb61"/></dir><file name="Carrier.php" hash="e7a7856c7bd25099d2cd0ccc0fef3cc8"/><file name="Cart.php" hash="12f0dc88ff39bb2ff313aa1f1f680293"/><dir name="Creditmemo"><file name="Total.php" hash="9741bdffba5f4fb93f974ebff5342446"/></dir><dir name="Invoice"><file name="Total.php" hash="9e050be88f3f50f66b022279b5475d6e"/></dir><file name="Observer.php" hash="79a6feac3f1db4ad874e3f9055d08a92"/><file name="Pay.php" hash="2162cfc602ba16441b50e76a1f0d355e"/><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Rmt.php" hash="c4db6c8af1925ec3af986608ba6f5f90"/><file name="Tax.php" hash="d19c997af49305890ec76256537bc274"/></dir></dir><file name="SubTotal.php" hash="618ab987b56594928babd91032d96fcf"/><file name="Total.php" hash="4b1ff9e87189ce3ebd426d782e6d6d49"/><file name="Total2.php" hash="2e68ee88038d6afa4ecae31c760923d2"/><file name="Total3.php" hash="af800fdcafa73d7e6f5005617c1fff50"/><file name="Total4.php" hash="d07c7d0c6cea924de1c073b86325f334"/><file name="Total5.php" hash="7621ffe0c48f4cff0be01d8675ebfd40"/><file name="Total6.php" hash="f3928406b3f8e27c2130b191affa216b"/><file name="Total7.php" hash="364dda6841e33501d8da82d6a707e3f3"/><file name="Total8.php" hash="0198e24497fbfb54da8d08c068421e98"/></dir></dir><dir name="controllers"><file name="CalculateController.php" hash="5e838fcdf3e57ea613dcc3c2d48b30e4"/><file name="InternationalController.php" hash="a70b534ba27db95927f247e975d4941c"/><file name="ProcessController.php" hash="9160f65b3dadec8533453f9bb536db10"/></dir><dir name="etc"><file name="config.xml" hash="f9d333b6cbb5263c4b7a312be3b00388"/><file name="system.xml" hash="2a5472fd0a152a9675de8cecb9bdf6c5"/></dir><dir name="sql"><dir name="skyboxcheckout_setup"><file name="mysql4-install-0.1.0.php" hash="fb9abdfaba4397c16c925d7775a9f8f6"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="d04ac619cd6e4b5381f8956d4b7577e7"/><file name="mysql4-upgrade-0.1.0-0.1.2.php" hash="6a8ec2a85f9f489b1a73ceed7d375002"/></dir></dir></dir><dir name="Core"><file name="Exception.php" hash="bca15d9d6fff9b215368a2957f2143c2"/><dir name="Helper"><file name="Allow.php" hash="f9376ffe2d6fd16b61f5e5b03a25c236"/><file name="Data.php" hash="eccfed0d0f8e29e8e50ec775d58a999f"/><file name="Email.php" hash="cc031b5b69014ac7105e909c39844acf"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="96880d0c219133d16a9507bc6b746521"/><file name="Restful.php" hash="925c02a84f87315c0f0c38886bc1a39d"/></dir><file name="Config.php" hash="66680aacb08b887a655e4a1236e36dc1"/><file name="Logservice.php" hash="705634aa093731d2612d658f920f279f"/><dir name="Mysql4"><dir name="Logservice"><file name="Collection.php" hash="58ebee3c24c6743cee363bc2562e1244"/></dir><file name="Logservice.php" hash="c24c3296dabd9ea9443fb4fca9e1ab2e"/></dir><file name="Mysql4.php" hash="48e708546b6d819f9ab57d630d8a72c7"/><file name="Session.php" hash="75e90de0993568a07ba2cd9b83500538"/><file name="Standard.php" hash="acc38a85fe753af0f5f28bbea6e065be"/></dir><dir name="etc"><file name="config.xml" hash="e1ac19f0b440dbdd476aff9b48643c6d"/></dir><dir name="sql"><dir name="skyboxcore_setup"><file name="mysql4-install-0.1.0.php" hash="9b80c6c888a98c252b6a0e84ce620d39"/></dir></dir></dir><dir name="International"><dir name="Helper"><file name="Data.php" hash="861172962e401f9729f0f098853d2535"/></dir><dir name="Model"><file name="Config.php" hash="7de8767d2cafb6a32c25ec04d5cc31d1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a282724808c4a3e46cf9bef869004684"/><file name="config.xml" hash="1590808e7d75b00203b531ffb2208ec9"/><file name="system.xml" hash="e39beecb0a418d56199062bca9bd4349"/></dir></dir><dir name="Services"><dir name="Model"><dir name="Api"><file name="V2.php" hash="85b805249e2d4bd5183402a958821c70"/></dir><file name="Api.php" hash="773cbefe6af8fc316f7a65b4b834da21"/></dir><dir name="etc"><file name="api.xml" hash="5a997cabfcebdfd33c046fb36a9f2c05"/><file name="config.xml" hash="819b408a860dab22d77826e6e6dd9065"/><file name="wsdl.xml" hash="f457001a1237e7d87be84d6903b6e614"/><file name="wsi.xml" hash="a077f2cf9644dba05db287ec47509808"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="skyboxcatalog.xml" hash="49c2aa4aef74456609fc9411739dc030"/><file name="skyboxinternational.xml" hash="b26933ce204399bfbe54ce28d385c1e3"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="skyboxcheckout.xml" hash="00d65daea65979c748a3510094544f34"/></dir><dir name="template"><dir name="skybox"><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="3e4d275d5260bf10def74b0af438b6e5"/></dir><file name="shipping.phtml" hash="4a181beac32bf4ecfee57d407b7c484b"/><dir name="sidebar"><file name="default.phtml" hash="3c767fa405317514d7c2d3d3ab9b6bc7"/></dir><file name="sidebar.phtml" hash="8344c09dde70abe4e3b9c8861a1bb741"/></dir><file name="cart.phtml" hash="b276185858e95de7104ec74421281eb4"/><file name="cart_list.phtml" hash="92e9359602a2f239fa1197060a3dc1a8"/><file name="headerskybox.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><dir name="onepage"><file name="link.phtml" hash="64157cac24b28a6563b5ff1d8c06780c"/></dir><file name="onepage.phtml" hash="2b74cd9dc82b54f1b71fe1f2d25ea3bb"/><file name="pagecheckout.phtml" hash="f049c52b94b917a96004c26f4a404f7d"/><file name="skyboxcheckout.phtml" hash="2ba5ad0d53914fbd44df66582f1fc4ed"/><file name="skyboxsuccess.phtml" hash="5327d846883827678f2ab6f5a426652e"/></dir><dir name="product"><file name="price.phtml" hash="22d109303a7e71cedd65f130ba64377d"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Skybox_All.xml" hash="f5e01649933a24900230218d4c87eb63"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="skybox"><file name="catalog.product.configurable.js" hash="a076638a02cbd88a605620c527a7ce28"/></dir></dir><dir name="css"><dir name="skybox"><file name="blank.gif" hash="325472601571f31e1bf00674c368d335"/><file name="fancybox_loading.gif" hash="328cc0f6c78211485058d460e80f4fa8"/><file name="fancybox_loading@2x.gif" hash="f92938639fa894a0e8ded1c3368abe98"/><file name="fancybox_overlay.png" hash="77aeaa52715b898b73c74d68c630330e"/><file name="fancybox_sprite.png" hash="783d4031fe50c3d83c960911e1fbc705"/><file name="fancybox_sprite@2x.png" hash="ed9970ce22242421e66ff150aa97fe5f"/><file name="jquery.fancybox.css" hash="50b795fb178b5a1c73833c47bad38987"/><file name="style.css" hash="0b0dd76a8678b1860a0fe6993a800c3e"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="skybox"><file name="adminhtml.category.js" hash="2c005c1478cfe7b39266257f5bfa89c9"/><file name="jquery.ba-resize.min.js" hash="9e80c546032c71de01a5c4bf4527995f"/><file name="jquery.fancybox.js" hash="5701e956bc1c938e0bdb4f7c20cec9c4"/><file name="jquery.min.js" hash="b8d64d0bc142b3f670cc0611b0aebcae"/><file name="load-jquery.js" hash="79b0d3dfea993a89d56b4c690d10d468"/><file name="main.js" hash="8b56e5bec2d4acbd445ae3629f38a167"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.25</min><max>7.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>SKYBOZ456</name>
4
+ <version>1.2.4</version>
5
  <stability>stable</stability>
6
  <license>Open</license>
7
  <channel>community</channel>
10
  <description>Skybox Checkout enables a Magento ecommerce site to sell instantly to 180 countries &amp;amp; territories and accept payment in 140 local currencies. SkyBOX Checkout is a combination of technology tools &amp;amp; services to help retailers expand overseas while offering a localized full landed cost calculation to international shoppers. SkyBOX Checkout takes on full risk of fraud screening &amp;amp; international payments while providing competitive international shipping with full tracking via its proprietary logistics network.</description>
11
  <notes>Skybox Checkout enables a Magento ecommerce site to sell instantly to 180 countries &amp;amp; territories and accept payment in 140 local currencies. SkyBOX Checkout is a combination of technology tools &amp;amp; services to help retailers expand overseas while offering a localized full landed cost calculation to international shoppers. SkyBOX Checkout takes on full risk of fraud screening &amp;amp; international payments while providing competitive international shipping with full tracking via its proprietary logistics network.</notes>
12
  <authors><author><name>Emilio Lizarraga</name><user>Emilio</user><email>emilio@skynet.net</email></author></authors>
13
+ <date>2017-05-09</date>
14
+ <time>14:41:44</time>
15
+ <contents><target name="magecommunity"><dir name="Skybox"><dir name="Catalog"><dir name="Block"><dir name="Bundle"><file name="Price.php" hash="9e6a41b50d37ed0884d08387ed793f99"/></dir><dir name="Catalog"><dir name="Category"><dir name="Tab"><file name="Skyboxcheckout.php" hash="c7e4e2df7a3b11ef640d18191eb01e2a"/></dir></dir></dir><dir name="Product"><file name="List.php" hash="b2b64e6dabe4727d4d18c7520eff7226"/><file name="Price.php" hash="b2fd8386c461d87e61c0d68f9718fe84"/><dir name="Widget"><file name="New.php" hash="8988c7748816f60afbc01eae20707c52"/></dir></dir></dir><dir name="Model"><dir name="Api"><file name="Product.php" hash="60ab5d3b86dd989cb1dd164c1112eb39"/></dir><file name="Observer.php" hash="cb96f1f3c9e83821148ca03c13d4e7a4"/><dir name="Product"><dir name="Attribute"><dir name="Source"><file name="Categories.php" hash="2c8e12e8ec757115531380881a3a4a22"/></dir></dir><dir name="Type"><file name="Price.php" hash="70f5e1fd02249941a5f04ca472bf440b"/></dir></dir><dir name="Resource"><file name="Setup.php" hash="02712115776769fa7983632cc72bdbdb"/></dir></dir><dir name="etc"><file name="config.xml" hash="aaeceb755f07f5ea6233b653d602bfdc"/></dir><dir name="sql"><dir name="skyboxcatalog_setup"><file name="mysql4-install-0.1.0.php" hash="dfa79dc84a6028a9171f709670a1b8d1"/></dir></dir></dir><dir name="Checkout"><dir name="Block"><dir name="Cart"><dir name="Item"><file name="Renderer.php" hash="c7862ab4b8936f0f15d2217b8175f3b2"/></dir><file name="Sidebar.php" hash="cefcb890a5d9d2d89d370d07eee11049"/><file name="Totals.php" hash="b695dde8996b21b65277dfc6efc50482"/></dir><dir name="Checkout"><dir name="Cart"><file name="Sidebar.php" hash="f2f99df06a26ce5bc580becff0f562aa"/></dir><file name="Cart.php" hash="f5bf7d91da455bf8b587b12090cb5f55"/><file name="Links.php" hash="3bc5d4ee0b81cab34ef85b616362ba82"/><dir name="Onepage"><file name="Link.php" hash="6ee490c1a0248814c79b003dc11b3b13"/></dir></dir><dir name="Sales"><dir name="Order"><file name="Total.php" hash="aca921ee33625d8ab824c9f770154fe8"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="42382d6dbe0257802a7f69548de10122"/><file name="Url.php" hash="bc4ba406cff59e5fdebe1cd087c3d946"/></dir><dir name="Model"><dir name="Api"><file name="Checkout.php" hash="02f0ea9268f986c85998527290e6cb61"/></dir><file name="Carrier.php" hash="e7a7856c7bd25099d2cd0ccc0fef3cc8"/><file name="Cart.php" hash="82cfd05c6c38fee8b63447abba31ba2f"/><dir name="Creditmemo"><file name="Total.php" hash="9741bdffba5f4fb93f974ebff5342446"/></dir><dir name="Invoice"><file name="Total.php" hash="9e050be88f3f50f66b022279b5475d6e"/></dir><file name="Observer.php" hash="1d61207e72f626d76059bf4c5179e414"/><file name="Pay.php" hash="2162cfc602ba16441b50e76a1f0d355e"/><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Rmt.php" hash="c4db6c8af1925ec3af986608ba6f5f90"/><file name="Tax.php" hash="d19c997af49305890ec76256537bc274"/></dir></dir><file name="Item.php" hash="94c87cbf798b4f3b1df93df58d0127ff"/><file name="SubTotal.php" hash="618ab987b56594928babd91032d96fcf"/><file name="Total.php" hash="4b1ff9e87189ce3ebd426d782e6d6d49"/><file name="Total2.php" hash="2e68ee88038d6afa4ecae31c760923d2"/><file name="Total3.php" hash="af800fdcafa73d7e6f5005617c1fff50"/><file name="Total4.php" hash="d07c7d0c6cea924de1c073b86325f334"/><file name="Total5.php" hash="7621ffe0c48f4cff0be01d8675ebfd40"/><file name="Total6.php" hash="f3928406b3f8e27c2130b191affa216b"/><file name="Total7.php" hash="364dda6841e33501d8da82d6a707e3f3"/><file name="Total8.php" hash="0198e24497fbfb54da8d08c068421e98"/></dir></dir><dir name="controllers"><file name="CalculateController.php" hash="c73aa0c8ac767ececbfbbcd1619e7b4b"/><file name="InternationalController.php" hash="f0ffbc37e5e4d0a87108fb1e472944b1"/><file name="ProcessController.php" hash="9160f65b3dadec8533453f9bb536db10"/></dir><dir name="etc"><file name="config.xml" hash="6940bcff2b9a12ebde373efb67fd0abe"/><file name="system.xml" hash="2a5472fd0a152a9675de8cecb9bdf6c5"/></dir><dir name="sql"><dir name="skyboxcheckout_setup"><file name="mysql4-install-0.1.0.php" hash="fb9abdfaba4397c16c925d7775a9f8f6"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="a9c26858268c150c09b486525a001ece"/><file name="mysql4-upgrade-0.1.0-0.1.2.php" hash="16668f60c9e3cdd74b4aebf6ac5beb99"/></dir></dir></dir><dir name="Core"><file name="Exception.php" hash="bca15d9d6fff9b215368a2957f2143c2"/><dir name="Helper"><file name="Allow.php" hash="f9376ffe2d6fd16b61f5e5b03a25c236"/><file name="Data.php" hash="eccfed0d0f8e29e8e50ec775d58a999f"/><file name="Email.php" hash="cc031b5b69014ac7105e909c39844acf"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="96880d0c219133d16a9507bc6b746521"/><file name="Restful.php" hash="3107eeebbf64d6c365cf0fe3a1b5a580"/></dir><file name="Config.php" hash="66680aacb08b887a655e4a1236e36dc1"/><file name="Logservice.php" hash="705634aa093731d2612d658f920f279f"/><dir name="Mysql4"><dir name="Logservice"><file name="Collection.php" hash="58ebee3c24c6743cee363bc2562e1244"/></dir><file name="Logservice.php" hash="c24c3296dabd9ea9443fb4fca9e1ab2e"/></dir><file name="Mysql4.php" hash="48e708546b6d819f9ab57d630d8a72c7"/><file name="Session.php" hash="75e90de0993568a07ba2cd9b83500538"/><file name="Standard.php" hash="9faf8ad601d206f7e7fd155ad87b0e4e"/></dir><dir name="etc"><file name="config.xml" hash="5364f9123f7a48ccf6eb708ec45c253e"/></dir><dir name="sql"><dir name="skyboxcore_setup"><file name="mysql4-install-0.1.0.php" hash="075d96fc11928d12d490cb346029f392"/></dir></dir></dir><dir name="International"><dir name="Helper"><file name="Data.php" hash="861172962e401f9729f0f098853d2535"/></dir><dir name="Model"><file name="Config.php" hash="7de8767d2cafb6a32c25ec04d5cc31d1"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a282724808c4a3e46cf9bef869004684"/><file name="config.xml" hash="ec7afcf3c8c18aeb0aebe56bba3a25c5"/><file name="system.xml" hash="e39beecb0a418d56199062bca9bd4349"/></dir></dir><dir name="Services"><dir name="Model"><dir name="Api"><file name="V2.php" hash="85b805249e2d4bd5183402a958821c70"/></dir><file name="Api.php" hash="773cbefe6af8fc316f7a65b4b834da21"/></dir><dir name="etc"><file name="api.xml" hash="5a997cabfcebdfd33c046fb36a9f2c05"/><file name="config.xml" hash="340bcfa91d8e27a04301e9fd713c29e1"/><file name="wsdl.xml" hash="f457001a1237e7d87be84d6903b6e614"/><file name="wsi.xml" hash="a077f2cf9644dba05db287ec47509808"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="skyboxcatalog.xml" hash="49c2aa4aef74456609fc9411739dc030"/><file name="skyboxinternational.xml" hash="b26933ce204399bfbe54ce28d385c1e3"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="skyboxcheckout.xml" hash="00d65daea65979c748a3510094544f34"/></dir><dir name="template"><dir name="skybox"><dir name="checkout"><dir name="cart"><dir name="item"><file name="default.phtml" hash="3e4d275d5260bf10def74b0af438b6e5"/></dir><file name="shipping.phtml" hash="4a181beac32bf4ecfee57d407b7c484b"/><dir name="sidebar"><file name="default.phtml" hash="3c767fa405317514d7c2d3d3ab9b6bc7"/></dir><file name="sidebar.phtml" hash="8344c09dde70abe4e3b9c8861a1bb741"/></dir><file name="cart.phtml" hash="f7071c19bfce775aae865b96d05d2167"/><file name="cart_list.phtml" hash="92e9359602a2f239fa1197060a3dc1a8"/><file name="headerskybox.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><dir name="onepage"><file name="link.phtml" hash="64157cac24b28a6563b5ff1d8c06780c"/></dir><file name="onepage.phtml" hash="2b74cd9dc82b54f1b71fe1f2d25ea3bb"/><file name="pagecheckout.phtml" hash="f049c52b94b917a96004c26f4a404f7d"/><file name="skyboxcheckout.phtml" hash="2ba5ad0d53914fbd44df66582f1fc4ed"/><file name="skyboxsuccess.phtml" hash="5327d846883827678f2ab6f5a426652e"/></dir><dir name="product"><file name="price.phtml" hash="22d109303a7e71cedd65f130ba64377d"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Skybox_All.xml" hash="050dbba0b15dc3f5a8d78baa03fe1d81"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><dir name="skybox"><file name="catalog.product.configurable.js" hash="41265b531b5ae4d03e7663aa1c354b6d"/></dir></dir><dir name="css"><dir name="skybox"><file name="blank.gif" hash="325472601571f31e1bf00674c368d335"/><file name="fancybox_loading.gif" hash="328cc0f6c78211485058d460e80f4fa8"/><file name="fancybox_loading@2x.gif" hash="f92938639fa894a0e8ded1c3368abe98"/><file name="fancybox_overlay.png" hash="77aeaa52715b898b73c74d68c630330e"/><file name="fancybox_sprite.png" hash="783d4031fe50c3d83c960911e1fbc705"/><file name="fancybox_sprite@2x.png" hash="ed9970ce22242421e66ff150aa97fe5f"/><file name="jquery.fancybox.css" hash="50b795fb178b5a1c73833c47bad38987"/><file name="style.css" hash="2fc25ef48794afef983262e2e652a3c1"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="skybox"><file name="adminhtml.category.js" hash="2c005c1478cfe7b39266257f5bfa89c9"/><file name="jquery.ba-resize.min.js" hash="9e80c546032c71de01a5c4bf4527995f"/><file name="jquery.fancybox.js" hash="5701e956bc1c938e0bdb4f7c20cec9c4"/><file name="jquery.min.js" hash="b8d64d0bc142b3f670cc0611b0aebcae"/><file name="load-jquery.js" hash="79b0d3dfea993a89d56b4c690d10d468"/><file name="main.js" hash="8b56e5bec2d4acbd445ae3629f38a167"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.25</min><max>7.0.0</max></php></required></dependencies>
18
  </package>
skin/frontend/base/default/css/skybox/style.css CHANGED
@@ -106,4 +106,9 @@
106
  #iframe_skybox_checkout {
107
  width: 100%;
108
  }
109
- /* SelecLocation Iframe */
 
 
 
 
 
106
  #iframe_skybox_checkout {
107
  width: 100%;
108
  }
109
+ /* SelecLocation Iframe */
110
+
111
+ .fancybox-mobile{
112
+ position: fixed !important;
113
+ top: 20px !important;
114
+ }
skin/frontend/base/default/js/skybox/catalog.product.configurable.js CHANGED
@@ -11,7 +11,10 @@ if (typeof Product != 'undefined') {
11
  var $jq = jQuery.noConflict();
12
  $jq(".skx_content_button").each(function () {
13
  //Tipped.create($jq(this).find(".skx_content_button")[0], $jq(this).find(".skx_content_button_detail")[0], { skin: 'light', hook: 'lefttop' });
14
- Tipped.create($jq(".skx_button_content")[0], $jq(".skx_content_button_detail")[0], { skin: 'light', hook: 'lefttop' });
 
 
 
15
  $jq(this).mouseover(function () {
16
  $jq(this).find(".t_Tooltip").show();
17
  });
@@ -21,15 +24,18 @@ if (typeof Product != 'undefined') {
21
  }
22
 
23
  function prototypeButton() {
24
-
25
  $$('.skx_content_button').each(function () {
26
-
27
 
28
  //Tipped.create($$('.skx_button_content')[0], $$('".skx_content_button_detail')[0], { skin: 'light', hook: 'lefttop' });
29
- Tipped.create($$('.skx_button_content'), $$('".skx_content_button_detail'), { skin: 'light', hook: 'lefttop' });
 
 
 
30
 
31
  $$('.skx_content_button').observe('mouseover', function () {
32
-
33
  Prototype.Selector.find($$('.skx_content_button'), '.t_Tooltip', 0).show();
34
  });
35
  });
@@ -38,6 +44,7 @@ if (typeof Product != 'undefined') {
38
  var SkyboxOptionsPrice = Class.create(Product.OptionsPrice, {
39
 
40
  makeAjaxCall: function () {
 
41
  console.log("Price: " + this.myProductPrice);
42
  var request = $('product_addtocart_form').serialize();
43
 
@@ -62,7 +69,7 @@ if (typeof Product != 'undefined') {
62
 
63
  if (price_info) {
64
  //console.log('price-info');
65
- //$$('.price-info')[0].innerHTML = response;
66
  }
67
 
68
  jqueryButton();
@@ -101,17 +108,18 @@ if (typeof Product != 'undefined') {
101
  price = optionPrices + parseFloat(_productPrice);
102
  _priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100;
103
 
104
- console.log('Price incl tax: '+_priceInclTax);
105
- console.log('Origin Tax: '+this.currentTax);
106
  var tax = price * (this.currentTax / 100);
107
- console.log('Tax: '+tax);
108
  var excl = price;
109
- console.log('price reload: '+price);
110
  // var incl = excl + tax;
111
  var incl = excl;
112
- console.log('Price + Tax: '+incl);
113
  var finalPrice = parseFloat(incl);
114
 
 
 
 
 
 
 
115
  this.url = SKYBOX_OPTIONS_PRICE_URL;
116
  this.myProductPrice = finalPrice;
117
  this.makeAjaxCall();
11
  var $jq = jQuery.noConflict();
12
  $jq(".skx_content_button").each(function () {
13
  //Tipped.create($jq(this).find(".skx_content_button")[0], $jq(this).find(".skx_content_button_detail")[0], { skin: 'light', hook: 'lefttop' });
14
+ Tipped.create($jq(".skx_button_content")[0], $jq(".skx_content_button_detail")[0], {
15
+ skin: 'light',
16
+ hook: 'lefttop'
17
+ });
18
  $jq(this).mouseover(function () {
19
  $jq(this).find(".t_Tooltip").show();
20
  });
24
  }
25
 
26
  function prototypeButton() {
27
+
28
  $$('.skx_content_button').each(function () {
29
+
30
 
31
  //Tipped.create($$('.skx_button_content')[0], $$('".skx_content_button_detail')[0], { skin: 'light', hook: 'lefttop' });
32
+ Tipped.create($$('.skx_button_content'), $$('".skx_content_button_detail'), {
33
+ skin: 'light',
34
+ hook: 'lefttop'
35
+ });
36
 
37
  $$('.skx_content_button').observe('mouseover', function () {
38
+
39
  Prototype.Selector.find($$('.skx_content_button'), '.t_Tooltip', 0).show();
40
  });
41
  });
44
  var SkyboxOptionsPrice = Class.create(Product.OptionsPrice, {
45
 
46
  makeAjaxCall: function () {
47
+ document.getElementsByClassName('price-info')[0].innerHTML = "<img src='https://cdn.shopify.com/s/files/1/1976/9429/t/1/assets/ajax-loader.gif?10083406412996855781'/>";
48
  console.log("Price: " + this.myProductPrice);
49
  var request = $('product_addtocart_form').serialize();
50
 
69
 
70
  if (price_info) {
71
  //console.log('price-info');
72
+ $$('.price-info')[0].innerHTML = response;
73
  }
74
 
75
  jqueryButton();
108
  price = optionPrices + parseFloat(_productPrice);
109
  _priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100;
110
 
 
 
111
  var tax = price * (this.currentTax / 100);
 
112
  var excl = price;
 
113
  // var incl = excl + tax;
114
  var incl = excl;
 
115
  var finalPrice = parseFloat(incl);
116
 
117
+ /*console.log('Price incl tax: ' + _priceInclTax);
118
+ console.log('Origin Tax: ' + this.currentTax);
119
+ console.log('Tax: ' + tax);
120
+ console.log('price reload: ' + price);
121
+ console.log('Price + Tax: ' + incl);*/
122
+
123
  this.url = SKYBOX_OPTIONS_PRICE_URL;
124
  this.myProductPrice = finalPrice;
125
  this.makeAjaxCall();