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.6.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.6.1 to 1.2.6.2
- app/code/community/Skybox/Catalog/Block/Product/List.php +35 -252
- app/code/community/Skybox/Catalog/etc/config.xml +1 -1
- app/code/community/Skybox/Checkout/Block/Sales/Order/Total.php +41 -15
- app/code/community/Skybox/Checkout/Model/Quote/Address/Total/Rmt.php +24 -4
- app/code/community/Skybox/Checkout/Model/Quote/SubTotal.php +63 -30
- app/code/community/Skybox/Checkout/controllers/ProcessController.php +6 -1
- app/code/community/Skybox/Checkout/etc/config.xml +1 -1
- app/code/community/Skybox/Core/Helper/Allow.php +1 -1
- app/code/community/Skybox/Core/etc/config.xml +1 -1
- app/code/community/Skybox/International/Model/StoreType.php +12 -0
- app/code/community/Skybox/International/etc/config.xml +1 -1
- app/code/community/Skybox/International/etc/system.xml +4 -2
- app/code/community/Skybox/Services/etc/config.xml +1 -1
- app/design/frontend/base/default/template/skybox/checkout/cart.phtml +43 -180
- js/skybox/main.js +53 -50
- package.xml +4 -4
- skin/frontend/base/default/js/skybox/catalog.product.configurable.js +48 -45
app/code/community/Skybox/Catalog/Block/Product/List.php
CHANGED
@@ -12,102 +12,6 @@
|
|
12 |
*/
|
13 |
class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
|
14 |
{
|
15 |
-
/**
|
16 |
-
* Default toolbar block name
|
17 |
-
*
|
18 |
-
* @var string
|
19 |
-
*/
|
20 |
-
protected $_defaultToolbarBlock = 'catalog/product_list_toolbar';
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Product Collection
|
24 |
-
*
|
25 |
-
* @var Mage_Eav_Model_Entity_Collection_Abstract
|
26 |
-
*/
|
27 |
-
protected $_productCollection;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Retrieve loaded category collection
|
31 |
-
*
|
32 |
-
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
33 |
-
*/
|
34 |
-
protected function _getProductCollection()
|
35 |
-
{
|
36 |
-
if (is_null($this->_productCollection)) {
|
37 |
-
$layer = $this->getLayer();
|
38 |
-
/* @var $layer Mage_Catalog_Model_Layer */
|
39 |
-
if ($this->getShowRootCategory()) {
|
40 |
-
$this->setCategoryId(Mage::app()->getStore()->getRootCategoryId());
|
41 |
-
}
|
42 |
-
|
43 |
-
// if this is a product view page
|
44 |
-
if (Mage::registry('product')) {
|
45 |
-
// get collection of categories this product is associated with
|
46 |
-
$categories = Mage::registry('product')->getCategoryCollection()
|
47 |
-
->setPage(1, 1)
|
48 |
-
->load();
|
49 |
-
// if the product is associated with any category
|
50 |
-
if ($categories->count()) {
|
51 |
-
// show products from this category
|
52 |
-
$this->setCategoryId(current($categories->getIterator()));
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
$origCategory = null;
|
57 |
-
if ($this->getCategoryId()) {
|
58 |
-
$category = Mage::getModel('catalog/category')->load($this->getCategoryId());
|
59 |
-
if ($category->getId()) {
|
60 |
-
$origCategory = $layer->getCurrentCategory();
|
61 |
-
$layer->setCurrentCategory($category);
|
62 |
-
$this->addModelTags($category);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
$this->_productCollection = $layer->getProductCollection();
|
66 |
-
|
67 |
-
$this->prepareSortableFieldsByCategory($layer->getCurrentCategory());
|
68 |
-
|
69 |
-
if ($origCategory) {
|
70 |
-
$layer->setCurrentCategory($origCategory);
|
71 |
-
}
|
72 |
-
}
|
73 |
-
|
74 |
-
return $this->_productCollection;
|
75 |
-
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Get catalog layer model
|
79 |
-
*
|
80 |
-
* @return Mage_Catalog_Model_Layer
|
81 |
-
*/
|
82 |
-
public function getLayer()
|
83 |
-
{
|
84 |
-
$layer = Mage::registry('current_layer');
|
85 |
-
if ($layer) {
|
86 |
-
return $layer;
|
87 |
-
}
|
88 |
-
return Mage::getSingleton('catalog/layer');
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* Retrieve loaded category collection
|
93 |
-
*
|
94 |
-
* @return Mage_Eav_Model_Entity_Collection_Abstract
|
95 |
-
*/
|
96 |
-
public function getLoadedProductCollection()
|
97 |
-
{
|
98 |
-
return $this->_getProductCollection();
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Retrieve current view mode
|
103 |
-
*
|
104 |
-
* @return string
|
105 |
-
*/
|
106 |
-
public function getMode()
|
107 |
-
{
|
108 |
-
return $this->getChild('toolbar')->getCurrentMode();
|
109 |
-
}
|
110 |
-
|
111 |
/**
|
112 |
* Retrieve API Product
|
113 |
*
|
@@ -121,51 +25,16 @@ class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
|
|
121 |
return $this->_api;
|
122 |
}
|
123 |
|
124 |
-
public function getUrlService($product)
|
125 |
-
{
|
126 |
-
|
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');
|
139 |
-
break;
|
140 |
-
}
|
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
|
169 |
}
|
170 |
|
171 |
$api_checkout = Mage::getModel('skyboxcheckout/api_checkout');
|
@@ -183,7 +52,8 @@ class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
|
|
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());
|
@@ -204,39 +74,32 @@ class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
|
|
204 |
Mage::register('skybox_multicalculate', $multiCalculate);
|
205 |
// Mage::registry('skybox_multicalculate');
|
206 |
|
207 |
-
return
|
208 |
}
|
209 |
|
210 |
/**
|
211 |
-
* @
|
|
|
212 |
*/
|
213 |
-
public function
|
214 |
{
|
215 |
-
|
216 |
-
|
217 |
-
/*var_dump($a->getHtmlTemplateButton());exit;*//*3 step call calculate*/;
|
218 |
-
if (1) {
|
219 |
-
|
220 |
-
/*$objectProduct = json_decode($objectProduct);
|
221 |
-
$objectProduct = json_decode(json_encode($objectProduct), true);*/
|
222 |
-
//var_dump($objectProduct);exit;
|
223 |
-
foreach ($objectProduct as $key => $value) {
|
224 |
-
/*echo "==>".$key."<====";
|
225 |
-
echo "==>".$value."<====";exit;-*/
|
226 |
-
$template = str_replace('{' . $key . '}', $value, $template);
|
227 |
-
}
|
228 |
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
|
|
|
|
|
|
236 |
}
|
237 |
-
|
238 |
-
/*var_dump($a); exit;
|
239 |
-
var_dump(Mage::getSingleton('skyboxcore/session')); exit;--*/
|
240 |
}
|
241 |
|
242 |
/**
|
@@ -266,104 +129,24 @@ class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
|
|
266 |
}
|
267 |
|
268 |
/**
|
269 |
-
*
|
270 |
*
|
271 |
-
* @return
|
272 |
*/
|
273 |
-
|
274 |
{
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
}
|
279 |
}
|
280 |
-
$block = $this->getLayout()->createBlock($this->_defaultToolbarBlock, microtime());
|
281 |
-
return $block;
|
282 |
-
}
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Retrieve additional blocks html
|
286 |
-
*
|
287 |
-
* @return string
|
288 |
-
*/
|
289 |
-
public function getAdditionalHtml()
|
290 |
-
{
|
291 |
-
return $this->getChildHtml('additional');
|
292 |
-
}
|
293 |
|
294 |
-
|
295 |
-
|
296 |
-
*
|
297 |
-
* @return string
|
298 |
-
*/
|
299 |
-
public function getToolbarHtml()
|
300 |
-
{
|
301 |
-
return $this->getChildHtml('toolbar');
|
302 |
-
}
|
303 |
-
|
304 |
-
public function setCollection($collection)
|
305 |
-
{
|
306 |
-
$this->_productCollection = $collection;
|
307 |
-
return $this;
|
308 |
-
}
|
309 |
-
|
310 |
-
public function addAttribute($code)
|
311 |
-
{
|
312 |
-
$this->_getProductCollection()->addAttributeToSelect($code);
|
313 |
-
return $this;
|
314 |
-
}
|
315 |
-
|
316 |
-
public function getPriceBlockTemplate()
|
317 |
-
{
|
318 |
-
return $this->_getData('price_block_template');
|
319 |
-
}
|
320 |
-
|
321 |
-
/**
|
322 |
-
* Retrieve Catalog Config object
|
323 |
-
*
|
324 |
-
* @return Mage_Catalog_Model_Config
|
325 |
-
*/
|
326 |
-
protected function _getConfig()
|
327 |
-
{
|
328 |
-
return Mage::getSingleton('catalog/config');
|
329 |
-
}
|
330 |
|
331 |
-
|
332 |
-
|
333 |
-
*
|
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 |
-
}
|
342 |
-
$availableOrders = $this->getAvailableOrders();
|
343 |
-
if (!$this->getSortBy()) {
|
344 |
-
if ($categorySortBy = $category->getDefaultSortBy()) {
|
345 |
-
if (!$availableOrders) {
|
346 |
-
$availableOrders = $this->_getConfig()->getAttributeUsedForSortByArray();
|
347 |
-
}
|
348 |
-
if (isset($availableOrders[$categorySortBy])) {
|
349 |
-
$this->setSortBy($categorySortBy);
|
350 |
-
}
|
351 |
-
}
|
352 |
}
|
353 |
|
354 |
-
return
|
355 |
-
}
|
356 |
-
|
357 |
-
/**
|
358 |
-
* Retrieve block cache tags based on product collection
|
359 |
-
*
|
360 |
-
* @return array
|
361 |
-
*/
|
362 |
-
public function getCacheTags()
|
363 |
-
{
|
364 |
-
return array_merge(
|
365 |
-
parent::getCacheTags(),
|
366 |
-
$this->getItemsTags($this->_getProductCollection())
|
367 |
-
);
|
368 |
}
|
369 |
}
|
12 |
*/
|
13 |
class Skybox_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List
|
14 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
/**
|
16 |
* Retrieve API Product
|
17 |
*
|
25 |
return $this->_api;
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
/**
|
29 |
* Need use as _prepareLayout - but problem in declaring collection from
|
30 |
* another block (was problem with search result)
|
31 |
*/
|
32 |
protected function _beforeToHtml()
|
33 |
{
|
34 |
+
$result = parent::_beforeToHtml();
|
35 |
+
|
36 |
if (!$this->isEnable()) {
|
37 |
+
return $result;
|
38 |
}
|
39 |
|
40 |
$api_checkout = Mage::getModel('skyboxcheckout/api_checkout');
|
52 |
$multiCalculate = 1;
|
53 |
|
54 |
try {
|
55 |
+
// $products = $this->_getProductCollection();
|
56 |
+
$products = $this->getToolbarBlock()->getCollection();
|
57 |
|
58 |
foreach ($products as $prod) {
|
59 |
$product = Mage::getModel('catalog/product')->load($prod->getId());
|
74 |
Mage::register('skybox_multicalculate', $multiCalculate);
|
75 |
// Mage::registry('skybox_multicalculate');
|
76 |
|
77 |
+
return $result;
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
+
* @param $product
|
82 |
+
* @return array|string
|
83 |
*/
|
84 |
+
public function getUrlService($product)
|
85 |
{
|
86 |
+
$type = $product->getTypeId();
|
87 |
+
$template = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
|
89 |
+
switch ($type) {
|
90 |
+
case 'simple':
|
91 |
+
$template = $this->_getApi()->getUrl($product->getId(), null, $product->getFinalPrice(),
|
92 |
+
$product->getTypeId());
|
93 |
+
break;
|
94 |
+
case 'configurable':
|
95 |
+
$template = $this->_getApi()->getUrl($product->getId(), null, $product->getFinalPrice(),
|
96 |
+
$product->getTypeId());
|
97 |
+
break;
|
98 |
+
case 'bundle':
|
99 |
+
$template = $this->_getApi()->getUrl($product, null, $product->getFinalPrice(), 'simple');
|
100 |
+
break;
|
101 |
}
|
102 |
+
return $template;
|
|
|
|
|
103 |
}
|
104 |
|
105 |
/**
|
129 |
}
|
130 |
|
131 |
/**
|
132 |
+
* is Enable?
|
133 |
*
|
134 |
+
* @return bool
|
135 |
*/
|
136 |
+
private function isEnable()
|
137 |
{
|
138 |
+
$isModuleEnable = Mage::getModel('skyboxcore/api_restful')->isModuleEnable();
|
139 |
+
if (!$isModuleEnable) {
|
140 |
+
return false;
|
|
|
141 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
+
/** @var Skybox_Core_Helper_Allow $allowHelper */
|
144 |
+
$allowHelper = Mage::helper('skyboxcore/allow');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
+
if (!$allowHelper->isPriceEnabled()) {
|
147 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
|
150 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
}
|
app/code/community/Skybox/Catalog/etc/config.xml
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
</default>
|
9 |
<modules>
|
10 |
<Skybox_Catalog>
|
11 |
-
<version>1.2.
|
12 |
<codePool>community</codePool>
|
13 |
</Skybox_Catalog>
|
14 |
</modules>
|
8 |
</default>
|
9 |
<modules>
|
10 |
<Skybox_Catalog>
|
11 |
+
<version>1.2.6.2</version>
|
12 |
<codePool>community</codePool>
|
13 |
</Skybox_Catalog>
|
14 |
</modules>
|
app/code/community/Skybox/Checkout/Block/Sales/Order/Total.php
CHANGED
@@ -9,37 +9,63 @@
|
|
9 |
*/
|
10 |
class Skybox_Checkout_Block_Sales_Order_Total extends Mage_Sales_Block_Order_Totals
|
11 |
{
|
|
|
|
|
|
|
12 |
|
13 |
-
|
|
|
|
|
14 |
|
15 |
-
|
16 |
-
$order= $this->getOrder();
|
17 |
|
18 |
//Mage::log('$order', null, 'tracer.log', true);
|
19 |
//Mage::log(print_r($order->debug(), true), null, 'tracer.log', true);
|
20 |
|
21 |
-
|
22 |
|
23 |
//Mage::log('$ConceptsSkyboxjson', null, 'tracer.log', true);
|
24 |
// Mage::log(print_r($ConceptsSkyboxjson, true), null, 'tracer.log', true);
|
25 |
-
if(count($ConceptsSkyboxjson)>0){
|
26 |
-
|
27 |
$i = 0;
|
28 |
foreach ($ConceptsSkyboxjson as $item) {
|
29 |
-
if($item->Visible != 0)
|
30 |
-
|
31 |
-
$i+=1;
|
32 |
$this->getParentBlock()->addTotal(new Varien_Object(array(
|
33 |
-
'code'=> 'checkout_total'
|
34 |
-
'value'=> $item->ValueUSD,//$item->Value
|
35 |
-
'base_value'=> $item->ValueUSD,//$item->Value
|
36 |
-
'label'=> $item->Concept,
|
37 |
)), 'subtotal', 'tax');
|
38 |
}
|
39 |
}
|
40 |
-
if($order->getShippingAmount() == 0){
|
41 |
$this->getParentBlock()->removeTotal('shipping');
|
42 |
}
|
43 |
}
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
9 |
*/
|
10 |
class Skybox_Checkout_Block_Sales_Order_Total extends Mage_Sales_Block_Order_Totals
|
11 |
{
|
12 |
+
public function initTotals()
|
13 |
+
{
|
14 |
+
parent::_initTotals();
|
15 |
|
16 |
+
if ($this->isEnable()) {
|
17 |
+
return $this;
|
18 |
+
}
|
19 |
|
20 |
+
$order = $this->getOrder();
|
|
|
21 |
|
22 |
//Mage::log('$order', null, 'tracer.log', true);
|
23 |
//Mage::log(print_r($order->debug(), true), null, 'tracer.log', true);
|
24 |
|
25 |
+
$ConceptsSkyboxjson = json_decode($order->getConceptsSkybox());
|
26 |
|
27 |
//Mage::log('$ConceptsSkyboxjson', null, 'tracer.log', true);
|
28 |
// Mage::log(print_r($ConceptsSkyboxjson, true), null, 'tracer.log', true);
|
29 |
+
if (count($ConceptsSkyboxjson) > 0) {
|
|
|
30 |
$i = 0;
|
31 |
foreach ($ConceptsSkyboxjson as $item) {
|
32 |
+
if ($item->Visible != 0) {
|
33 |
+
$i += 1;
|
|
|
34 |
$this->getParentBlock()->addTotal(new Varien_Object(array(
|
35 |
+
'code' => 'checkout_total' . $i,
|
36 |
+
'value' => $item->ValueUSD,//$item->Value
|
37 |
+
'base_value' => $item->ValueUSD,//$item->Value
|
38 |
+
'label' => $item->Concept,
|
39 |
)), 'subtotal', 'tax');
|
40 |
}
|
41 |
}
|
42 |
+
if ($order->getShippingAmount() == 0) {
|
43 |
$this->getParentBlock()->removeTotal('shipping');
|
44 |
}
|
45 |
}
|
46 |
+
|
47 |
+
return $this;
|
48 |
+
}
|
49 |
+
|
50 |
+
private function isEnable()
|
51 |
+
{
|
52 |
+
/** @var Skybox_Core_Model_Api_Restful $api_restful */
|
53 |
+
$api_restful = Mage::getModel('skyboxcore/api_restful');
|
54 |
+
$activation = $api_restful->isModuleEnable();
|
55 |
+
|
56 |
+
if (!$activation) {
|
57 |
+
return false;
|
58 |
+
}
|
59 |
+
|
60 |
+
/** @var Skybox_Core_Helper_Allow $allowHelper */
|
61 |
+
$allowHelper = Mage::helper('skyboxcore/allow');
|
62 |
+
|
63 |
+
$locationAllow = $allowHelper->getLocationAllow();
|
64 |
+
|
65 |
+
if (!$locationAllow) {
|
66 |
+
return false;
|
67 |
+
}
|
68 |
+
|
69 |
+
return true;
|
70 |
+
}
|
71 |
}
|
app/code/community/Skybox/Checkout/Model/Quote/Address/Total/Rmt.php
CHANGED
@@ -48,14 +48,12 @@ class Skybox_Checkout_Model_Quote_Address_Total_Rmt extends Mage_Sales_Model_Quo
|
|
48 |
*/
|
49 |
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
50 |
{
|
51 |
-
|
52 |
|
53 |
-
if (!$
|
54 |
return $this;
|
55 |
}
|
56 |
|
57 |
-
parent::fetch($address);
|
58 |
-
|
59 |
$quote = $address->getQuote();
|
60 |
if (!$quote->isVirtual() && $address->getAddressType() == 'billing') {
|
61 |
return $this;
|
@@ -89,4 +87,26 @@ class Skybox_Checkout_Model_Quote_Address_Total_Rmt extends Mage_Sales_Model_Quo
|
|
89 |
}
|
90 |
return $this;
|
91 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
}
|
48 |
*/
|
49 |
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
50 |
{
|
51 |
+
parent::fetch($address);
|
52 |
|
53 |
+
if (!$this->isEnable()) {
|
54 |
return $this;
|
55 |
}
|
56 |
|
|
|
|
|
57 |
$quote = $address->getQuote();
|
58 |
if (!$quote->isVirtual() && $address->getAddressType() == 'billing') {
|
59 |
return $this;
|
87 |
}
|
88 |
return $this;
|
89 |
}
|
90 |
+
|
91 |
+
private function isEnable()
|
92 |
+
{
|
93 |
+
/** @var Skybox_Core_Model_Api_Restful $api_restful */
|
94 |
+
$api_restful = Mage::getModel('skyboxcore/api_restful');
|
95 |
+
$activation = $api_restful->isModuleEnable();
|
96 |
+
|
97 |
+
if (!$activation) {
|
98 |
+
return false;
|
99 |
+
}
|
100 |
+
|
101 |
+
/** @var Skybox_Core_Helper_Allow $allowHelper */
|
102 |
+
$allowHelper = Mage::helper('skyboxcore/allow');
|
103 |
+
|
104 |
+
$locationAllow = $allowHelper->getLocationAllow();
|
105 |
+
|
106 |
+
if (!$locationAllow) {
|
107 |
+
return false;
|
108 |
+
}
|
109 |
+
|
110 |
+
return true;
|
111 |
+
}
|
112 |
}
|
app/code/community/Skybox/Checkout/Model/Quote/SubTotal.php
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class Skybox_Checkout_Model_Quote_SubTotal extends Mage_Sales_Model_Quote_Address_Total_Abstract
|
4 |
-
|
|
|
5 |
// Cantidad del recargo sin impuestos
|
6 |
var $_amount;
|
7 |
-
|
8 |
protected $_api = null;
|
9 |
protected $_product = null;
|
10 |
|
@@ -34,27 +35,27 @@ class Skybox_Checkout_Model_Quote_SubTotal extends Mage_Sales_Model_Quote_Addres
|
|
34 |
* Esta función es llamada cada vez que Magento requiere calcular los
|
35 |
* totales por cualquier motivo: carrito actualizado, usuario se logea,
|
36 |
* aplicar un cupón, selección de medios de envío, de pago, etc.
|
37 |
-
*
|
38 |
* Se trata de calcular lo que queremos añadir de recargo y actualizar
|
39 |
* el total del carrito (Magento itera sobre los totales y cada uno añade
|
40 |
* su parte)
|
41 |
**/
|
42 |
-
public function collect(Mage_Sales_Model_Quote_Address $address)
|
43 |
-
|
|
|
44 |
parent::collect($address); //Comentado por verificar
|
45 |
-
|
46 |
// Si no hay items, no hay nada que hacer
|
47 |
$items = $this->_getAddressItems($address);
|
48 |
if (!count($items)) {
|
49 |
return $this;
|
50 |
}
|
51 |
|
52 |
-
$quote= $address->getQuote();
|
53 |
-
if(!$quote->isVirtual() && $address->getAddressType() == 'billing'){
|
54 |
return $this;
|
55 |
}
|
56 |
|
57 |
-
|
58 |
|
59 |
//$address->setSubTotal(100);
|
60 |
//$address->setBaseSubTotal(100);
|
@@ -64,40 +65,72 @@ class Skybox_Checkout_Model_Quote_SubTotal extends Mage_Sales_Model_Quote_Addres
|
|
64 |
//$address->setTaxAmount(0);
|
65 |
|
66 |
//$address->save(); //Guardamos los Cambios
|
67 |
-
Mage::log("quote->address->collect->getSubTotal->" . $address->getSubTotal(), null, 'SubTotalSales.log', true);
|
68 |
-
Mage::log("quote->address->collect->getGrandTotal->" . $address->getGrandTotal(), null, 'SubTotalSales.log',
|
|
|
69 |
|
70 |
-
Mage::log("quote->address->collect->Total->" . $totalskybox, null, 'SubTotalSales.log', true);
|
71 |
-
Mage::log("quote->address->collect : fin", null, 'SubTotalSales.log', true);
|
72 |
|
73 |
return $this;
|
74 |
}
|
75 |
-
|
76 |
/**
|
77 |
* Esta función es llamada por Magento cuando quiere mostrar los totales en pantalla.
|
78 |
-
*
|
79 |
* El cálculo ya se habrá hecho y deberíamos guardarlo en algún sitio para aquí,
|
80 |
* simplemente retornar el valor formateado y que Magento lo muestre.
|
81 |
*/
|
82 |
-
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
83 |
-
|
84 |
parent::fetch($address); //Comentado por verificar
|
85 |
|
86 |
-
|
87 |
-
if(!$quote->isVirtual() && $address->getAddressType() == 'billing'){
|
88 |
return $this;
|
89 |
}
|
90 |
-
|
91 |
-
$
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
return $this;
|
101 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
|
1 |
<?php
|
2 |
|
3 |
+
class Skybox_Checkout_Model_Quote_SubTotal extends Mage_Sales_Model_Quote_Address_Total_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
// Cantidad del recargo sin impuestos
|
7 |
var $_amount;
|
8 |
+
|
9 |
protected $_api = null;
|
10 |
protected $_product = null;
|
11 |
|
35 |
* Esta función es llamada cada vez que Magento requiere calcular los
|
36 |
* totales por cualquier motivo: carrito actualizado, usuario se logea,
|
37 |
* aplicar un cupón, selección de medios de envío, de pago, etc.
|
38 |
+
*
|
39 |
* Se trata de calcular lo que queremos añadir de recargo y actualizar
|
40 |
* el total del carrito (Magento itera sobre los totales y cada uno añade
|
41 |
* su parte)
|
42 |
**/
|
43 |
+
public function collect(Mage_Sales_Model_Quote_Address $address)
|
44 |
+
{
|
45 |
+
|
46 |
parent::collect($address); //Comentado por verificar
|
47 |
+
|
48 |
// Si no hay items, no hay nada que hacer
|
49 |
$items = $this->_getAddressItems($address);
|
50 |
if (!count($items)) {
|
51 |
return $this;
|
52 |
}
|
53 |
|
54 |
+
$quote = $address->getQuote();
|
55 |
+
if (!$quote->isVirtual() && $address->getAddressType() == 'billing') {
|
56 |
return $this;
|
57 |
}
|
58 |
|
|
|
59 |
|
60 |
//$address->setSubTotal(100);
|
61 |
//$address->setBaseSubTotal(100);
|
65 |
//$address->setTaxAmount(0);
|
66 |
|
67 |
//$address->save(); //Guardamos los Cambios
|
68 |
+
Mage::log("quote->address->collect->getSubTotal->" . $address->getSubTotal(), null, 'SubTotalSales.log', true);
|
69 |
+
Mage::log("quote->address->collect->getGrandTotal->" . $address->getGrandTotal(), null, 'SubTotalSales.log',
|
70 |
+
true);
|
71 |
|
72 |
+
Mage::log("quote->address->collect->Total->" . $totalskybox, null, 'SubTotalSales.log', true);
|
73 |
+
Mage::log("quote->address->collect : fin", null, 'SubTotalSales.log', true);
|
74 |
|
75 |
return $this;
|
76 |
}
|
77 |
+
|
78 |
/**
|
79 |
* Esta función es llamada por Magento cuando quiere mostrar los totales en pantalla.
|
80 |
+
*
|
81 |
* El cálculo ya se habrá hecho y deberíamos guardarlo en algún sitio para aquí,
|
82 |
* simplemente retornar el valor formateado y que Magento lo muestre.
|
83 |
*/
|
84 |
+
public function fetch(Mage_Sales_Model_Quote_Address $address)
|
85 |
+
{
|
86 |
parent::fetch($address); //Comentado por verificar
|
87 |
|
88 |
+
if (!$this->isEnable()) {
|
|
|
89 |
return $this;
|
90 |
}
|
91 |
+
|
92 |
+
$quote = $address->getQuote();
|
93 |
+
if (!$quote->isVirtual() && $address->getAddressType() == 'billing') {
|
94 |
+
return $this;
|
95 |
+
}
|
96 |
+
|
97 |
+
$_conceptsSkybox = $address->getConceptsSkybox();
|
98 |
+
|
99 |
+
if ($_conceptsSkybox) {
|
100 |
+
|
101 |
+
$ConceptsSkyboxjson = json_decode($address->getConceptsSkybox());
|
102 |
+
|
103 |
+
$address->addTotal(array(
|
104 |
+
'code' => 'subtotal',
|
105 |
+
'title' => 'Sub Total',
|
106 |
+
'value' => 150
|
107 |
+
));
|
108 |
+
Mage::log("quote->address->fetch : fin", null, 'SubTotalSales.log', true);
|
109 |
+
}
|
110 |
+
|
111 |
return $this;
|
112 |
}
|
113 |
+
|
114 |
+
private function isEnable()
|
115 |
+
{
|
116 |
+
/** @var Skybox_Core_Model_Api_Restful $api_restful */
|
117 |
+
$api_restful = Mage::getModel('skyboxcore/api_restful');
|
118 |
+
$activation = $api_restful->isModuleEnable();
|
119 |
+
|
120 |
+
if (!$activation) {
|
121 |
+
return false;
|
122 |
+
}
|
123 |
+
|
124 |
+
/** @var Skybox_Core_Helper_Allow $allowHelper */
|
125 |
+
$allowHelper = Mage::helper('skyboxcore/allow');
|
126 |
+
|
127 |
+
$locationAllow = $allowHelper->getLocationAllow();
|
128 |
+
|
129 |
+
if (!$locationAllow) {
|
130 |
+
return false;
|
131 |
+
}
|
132 |
+
|
133 |
+
return true;
|
134 |
+
}
|
135 |
}
|
136 |
|
app/code/community/Skybox/Checkout/controllers/ProcessController.php
CHANGED
@@ -309,12 +309,17 @@ class Skybox_Checkout_ProcessController extends Mage_Core_Controller_Front_Actio
|
|
309 |
|
310 |
$quote->save();
|
311 |
|
|
|
|
|
|
|
312 |
// @note: Force to load Home Page due cache issue. (minicart)
|
313 |
if (strpos($return_url, 'force_reload')) {
|
314 |
$return_url = str_replace('force_reload', '', $return_url);
|
|
|
315 |
/** @var Skybox_Core_Model_Config $config */
|
316 |
$config = Mage::getModel("skyboxcore/config");
|
317 |
-
$
|
|
|
318 |
}
|
319 |
|
320 |
//$this->getResponse()->setRedirect($return_url);
|
309 |
|
310 |
$quote->save();
|
311 |
|
312 |
+
$_getSession = Mage::getSingleton('checkout/session');
|
313 |
+
$_getSession->setCartWasUpdated(true);
|
314 |
+
|
315 |
// @note: Force to load Home Page due cache issue. (minicart)
|
316 |
if (strpos($return_url, 'force_reload')) {
|
317 |
$return_url = str_replace('force_reload', '', $return_url);
|
318 |
+
|
319 |
/** @var Skybox_Core_Model_Config $config */
|
320 |
$config = Mage::getModel("skyboxcore/config");
|
321 |
+
$forceReload = 1;
|
322 |
+
$config->getSession()->setChangeCountryHomePage($forceReload);
|
323 |
}
|
324 |
|
325 |
//$this->getResponse()->setRedirect($return_url);
|
app/code/community/Skybox/Checkout/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Skybox_Checkout>
|
5 |
-
<version>1.2.6</version>
|
6 |
<codePool>community</codePool>
|
7 |
</Skybox_Checkout>
|
8 |
</modules>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Skybox_Checkout>
|
5 |
+
<version>1.2.6.2</version>
|
6 |
<codePool>community</codePool>
|
7 |
</Skybox_Checkout>
|
8 |
</modules>
|
app/code/community/Skybox/Core/Helper/Allow.php
CHANGED
@@ -210,7 +210,7 @@ class Skybox_Core_Helper_Allow extends Mage_Core_Helper_Abstract
|
|
210 |
/*
|
211 |
* Get LocationAllow
|
212 |
*/
|
213 |
-
|
214 |
{
|
215 |
if ($this->_locationAllow == null) {
|
216 |
$_checkout = Mage::getModel('skyboxcheckout/api_checkout');
|
210 |
/*
|
211 |
* Get LocationAllow
|
212 |
*/
|
213 |
+
public function getLocationAllow()
|
214 |
{
|
215 |
if ($this->_locationAllow == null) {
|
216 |
$_checkout = Mage::getModel('skyboxcheckout/api_checkout');
|
app/code/community/Skybox/Core/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Skybox_Core>
|
5 |
-
<version>1.2.
|
6 |
<codePool>community</codePool>
|
7 |
</Skybox_Core>
|
8 |
</modules>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Skybox_Core>
|
5 |
+
<version>1.2.6.2</version>
|
6 |
<codePool>community</codePool>
|
7 |
</Skybox_Core>
|
8 |
</modules>
|
app/code/community/Skybox/International/Model/StoreType.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Skybox_International_Model_StoreType
|
4 |
+
{
|
5 |
+
public function toOptionArray()
|
6 |
+
{
|
7 |
+
return array(
|
8 |
+
array('value' => '1', 'label' => "Store Type 1"),
|
9 |
+
array('value' => '3', 'label' => "Store Type 3"),
|
10 |
+
);
|
11 |
+
}
|
12 |
+
}
|
app/code/community/Skybox/International/etc/config.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<config>
|
2 |
<modules>
|
3 |
<Skybox_International>
|
4 |
-
<version>1.2.
|
5 |
<codePool>community</codePool>
|
6 |
</Skybox_International>
|
7 |
</modules>
|
1 |
<config>
|
2 |
<modules>
|
3 |
<Skybox_International>
|
4 |
+
<version>1.2.6.2</version>
|
5 |
<codePool>community</codePool>
|
6 |
</Skybox_International>
|
7 |
</modules>
|
app/code/community/Skybox/International/etc/system.xml
CHANGED
@@ -81,8 +81,10 @@
|
|
81 |
<skyboxintegration translate="label">
|
82 |
<label>SkyBox Itegration:</label>
|
83 |
<comment>SkyBox Integration</comment>
|
84 |
-
<frontend_type>
|
85 |
-
|
|
|
|
|
86 |
<sort_order>7</sort_order>
|
87 |
<show_in_default>1</show_in_default>
|
88 |
<show_in_website>1</show_in_website>
|
81 |
<skyboxintegration translate="label">
|
82 |
<label>SkyBox Itegration:</label>
|
83 |
<comment>SkyBox Integration</comment>
|
84 |
+
<frontend_type>select</frontend_type>
|
85 |
+
<!--<source_model>adminhtml/system_config_source_yesno</source_model>-->
|
86 |
+
<source_model>Skybox_International_Model_StoreType</source_model>
|
87 |
+
<!--<frontend_type>text</frontend_type>-->
|
88 |
<sort_order>7</sort_order>
|
89 |
<show_in_default>1</show_in_default>
|
90 |
<show_in_website>1</show_in_website>
|
app/code/community/Skybox/Services/etc/config.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<modules>
|
4 |
<Skybox_Services>
|
5 |
<active>true</active>
|
6 |
-
<version>1.2.
|
7 |
<codePool>community</codePool>
|
8 |
</Skybox_Services>
|
9 |
</modules>
|
3 |
<modules>
|
4 |
<Skybox_Services>
|
5 |
<active>true</active>
|
6 |
+
<version>1.2.6.2</version>
|
7 |
<codePool>community</codePool>
|
8 |
</Skybox_Services>
|
9 |
</modules>
|
app/design/frontend/base/default/template/skybox/checkout/cart.phtml
CHANGED
@@ -20,7 +20,6 @@ if ($_helper->getActive()) {
|
|
20 |
$template = "";
|
21 |
$cartId = $_helper->getCartId();
|
22 |
|
23 |
-
Mage::log("InitializeBarSkybox ", null, 'cartphtml.log', true);
|
24 |
$_checkout->InitializeBarSkybox();
|
25 |
|
26 |
$change_country = false;
|
@@ -33,17 +32,8 @@ if ($_helper->getActive()) {
|
|
33 |
$urlCheckCart = Mage::getUrl("checkout/cart");
|
34 |
|
35 |
$cart = $_config->getSession()->getCartSkybox();
|
36 |
-
|
37 |
-
|
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'> </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();
|
@@ -78,16 +68,16 @@ if ($_helper->getActive()) {
|
|
78 |
echo $template;
|
79 |
endif;
|
80 |
|
81 |
-
|
82 |
-
if($allowHelper->isPriceEnabled()){
|
83 |
$productConfigurable = $this->getSkinUrl('js/skybox/catalog.product.configurable.js');
|
84 |
-
echo '<script type="text/javascript" src="'
|
85 |
}
|
86 |
|
87 |
$skyBoxUrlClientBase = $_helper->getSkyBoxUrlAPI();
|
88 |
$storeCode = Mage::getModel('skyboxcatalog/api_product')->getStoreCode();
|
89 |
$skyBoxUrlClientGet = str_replace("apirest/", "", $skyBoxUrlClientBase);
|
90 |
$skyBoxUrlClient = $skyBoxUrlClientGet . "multiplecalculate/" . $storeCode . "/calc-";
|
|
|
91 |
?>
|
92 |
<link rel="stylesheet" type="text/css" href="<?php echo $api_css_button_international; ?>"/>
|
93 |
<link rel="stylesheet" type="text/css"
|
@@ -105,184 +95,57 @@ if ($_helper->getActive()) {
|
|
105 |
var IS_SKYBOX_VISIBLE = "<?php echo $_checkout->getLocationAllow(); ?>";
|
106 |
var URL_BASE_MAGENTO = "<?php echo Mage::getBaseUrl() ?>";
|
107 |
var IS_REGISTRATION_DISABLED_SKYBOX = 1;
|
|
|
|
|
108 |
|
109 |
-
jQuery(document).ready(function () {
|
110 |
-
if (!jQuery().fancybox) {
|
111 |
-
var fileref = document.createElement("link");
|
112 |
-
fileref.rel = "stylesheet";
|
113 |
-
fileref.type = "text/css";
|
114 |
-
fileref.href = "<?php echo $this->getSkinUrl('css/skybox/jquery.fancybox.css');?>";
|
115 |
-
document.getElementsByTagName("head")[0].appendChild(fileref);
|
116 |
-
jQuery('head').append(jQuery('<script />').attr('src', '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'js/skybox/jquery.fancybox.js'; ?>'));
|
117 |
-
}
|
118 |
-
jQuery(".skybox-price-set").each(function (index) {
|
119 |
-
var SkyBoxUrlClient = "<?php echo $skyBoxUrlClient;?>";
|
120 |
-
var dataId = jQuery(this).attr("id");
|
121 |
-
var id = jQuery(this).attr("product-id");
|
122 |
-
var url = SkyBoxUrlClient + id + ".html";
|
123 |
-
console.log("URL : " + url);
|
124 |
-
var content = jQuery.get(url, function (data) {
|
125 |
-
jQuery("#" + dataId).html(data);
|
126 |
-
});
|
127 |
-
});
|
128 |
-
});
|
129 |
-
</script>
|
130 |
-
<script src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'js/skybox/main.js'; ?>"></script>
|
131 |
-
<script type="text/javascript">
|
132 |
(function ($) {
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
function goToCart() {
|
142 |
-
document.location = URL_CHECK_CART;
|
143 |
-
}
|
144 |
-
|
145 |
-
function goToInitializeSession() {
|
146 |
-
var idCart = CART_ID;
|
147 |
-
var datos = CART_DATA_URL_SKYBOX;
|
148 |
-
var merchant = MERCHANT_ID_SKYBOX;
|
149 |
-
var actualUri = ACTUAL_URI + "?LoadFrame=1";
|
150 |
-
var url = SKYBOX_URL + "WebForms/PublicSite/Tracking.aspx?" + datos + "&merchant=" + merchant + "&idCart=" + idCart + "&ReLoad=1&uri=" + actualUri;
|
151 |
-
var name = 'initSession' + Date.now();
|
152 |
-
callAlphacube();
|
153 |
-
}
|
154 |
-
|
155 |
-
function getReturnUrl() {
|
156 |
-
var result = document.URL;
|
157 |
-
<?php $forceReload = (Mage::getBlockSingleton('page/html_header')->getIsHomePage()) ? 'force_reload' : '';?>
|
158 |
-
result += '<?php echo $forceReload; ?>';
|
159 |
-
return result;
|
160 |
-
}
|
161 |
-
|
162 |
-
function callAlphacube() {
|
163 |
-
var alphacube_ = document.querySelectorAll('.alphacube_close');
|
164 |
-
if (alphacube_.length > 0) {
|
165 |
-
var overlay_ = document.getElementById("overlay_modal");
|
166 |
-
if (overlay_ !== null) overlay_.style.display = '';
|
167 |
-
var id_modal = (alphacube_[1]) ? alphacube_[1].parentNode.getAttribute('id') : '';
|
168 |
-
try {
|
169 |
-
document.getElementById(id_modal).remove();
|
170 |
-
} catch (e) {
|
171 |
-
}
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
-
function goToLocation() {
|
176 |
-
win = 'resync';
|
177 |
-
var datos = CART_DATA_URL_SKYBOX;
|
178 |
-
var process_url = GET_HOME_URL + "skbcheckout/process";
|
179 |
-
var return_url = getReturnUrl();
|
180 |
-
var change_country_status = CHANGE_COUNTRY;
|
181 |
-
var url = SKYBOX_URL + "Webforms/PublicSite/ReSync.aspx?" + datos;
|
182 |
-
url += "&process_url=" + process_url;
|
183 |
-
url += "&return_url=" + return_url;
|
184 |
-
url += "&change_country=" + change_country_status;
|
185 |
-
|
186 |
-
var _size = getSizeForPopup();
|
187 |
-
var name = 'selectLocation' + Date.now();
|
188 |
-
callAlphacube();
|
189 |
-
}
|
190 |
-
|
191 |
-
function goToTrackingLocation() {
|
192 |
-
var url = SKYBOX_URL + "Webforms/PublicSite/Tracking.aspx?" + CART_DATA_URL_SKYBOX + "&idCart=" + CART_ID;
|
193 |
-
var name = 'tracking' + Date.now();
|
194 |
-
showPopup(name, '', url, (widthPage - 50 ), ((heightPage < 800) ? heightPage - 50 : 800));
|
195 |
-
}
|
196 |
-
|
197 |
-
function loadIframe() {
|
198 |
-
var actualUri = ACTUAL_URI;
|
199 |
-
var flgLoadIframe = "<?php echo (isset($_GET['LoadFrame'])) ? $_GET['LoadFrame'] : 0; ?>";
|
200 |
-
if (flgLoadIframe === "1") {
|
201 |
-
if (actualUri.indexOf("skbcheckout/international") === -1) goToInitializeSession();
|
202 |
-
}
|
203 |
-
}
|
204 |
-
|
205 |
-
function postMessageIframe() {
|
206 |
-
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
|
207 |
-
var eventer = window[eventMethod];
|
208 |
-
var messageEvent = (eventMethod === "attachEvent") ? "onmessage" : "message";
|
209 |
-
eventer(messageEvent, function (e) {
|
210 |
-
recalculateHeightIframe(e.data);
|
211 |
-
}, false);
|
212 |
-
}
|
213 |
-
|
214 |
-
function recalculateHeightIframe(data) {
|
215 |
-
if (data.win === 'resync') {
|
216 |
-
popupHeight = data.height;
|
217 |
-
var _size = getSizeForPopup();
|
218 |
-
try {
|
219 |
-
popup.setSize(_size.width, _size.height);
|
220 |
-
}
|
221 |
-
catch (e) {
|
222 |
-
}
|
223 |
}
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
|
|
232 |
});
|
233 |
-
}
|
234 |
-
|
235 |
-
function getSizeForPopup() {
|
236 |
-
var _width = jQuery(window).width();
|
237 |
-
var _height = jQuery(window).height();
|
238 |
-
_width = (_width < popupWidth) ? _width - 30 : popupWidth;
|
239 |
-
return {width: _width, height: popupHeight};
|
240 |
-
}
|
241 |
-
|
242 |
-
$(".skx_position_option_country").unbind().click(function () {
|
243 |
-
goToLocation();
|
244 |
-
});
|
245 |
-
|
246 |
-
$(".skx_banner_image_account").unbind().click(function () {
|
247 |
-
goToInitializeSession();
|
248 |
-
});
|
249 |
-
|
250 |
-
$(".skx_banner_image_car").unbind().click(function () {
|
251 |
-
goToCart();
|
252 |
-
});
|
253 |
-
|
254 |
-
$(".skx_banner_image_tracking").unbind().click(function () {
|
255 |
-
goToTrackingLocation();
|
256 |
-
});
|
257 |
-
|
258 |
-
$("#link_choise_country").unbind().click(function () {
|
259 |
-
goToCart();
|
260 |
-
});
|
261 |
-
|
262 |
-
$(document).ready(function () {
|
263 |
-
widthPage = $(window).width();
|
264 |
-
heightPage = $(window).height();
|
265 |
-
postMessageIframe();
|
266 |
-
loadIframe();
|
267 |
-
browserResize();
|
268 |
-
<?php
|
269 |
-
// note: Just to force reload page on Home Page.
|
270 |
-
$forceReload = $_config->getSession()->getChangeCountryHomePage();
|
271 |
-
if (Mage::getBlockSingleton('page/html_header')->getIsHomePage() && $forceReload) :
|
272 |
-
$_config->getSession()->setChangeCountryHomePage(null);
|
273 |
-
echo 'window.location.reload(false);';
|
274 |
-
endif;
|
275 |
-
?>
|
276 |
});
|
277 |
})(jQuery);
|
278 |
</script>
|
279 |
-
|
280 |
<script type="text/javascript">
|
281 |
//<![CDATA[
|
282 |
var SKYBOX_OPTIONS_PRICE_URL = '<?php echo Mage::getUrl(); ?>skbcheckout/calculate';
|
283 |
//]]>
|
284 |
</script>
|
285 |
<script type="text/javascript" src="<?php echo $api_js_button_international; ?>"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
<script>
|
287 |
setTimeout(function () {
|
288 |
var country_change = "<?php echo $countryChange?>";
|
20 |
$template = "";
|
21 |
$cartId = $_helper->getCartId();
|
22 |
|
|
|
23 |
$_checkout->InitializeBarSkybox();
|
24 |
|
25 |
$change_country = false;
|
32 |
$urlCheckCart = Mage::getUrl("checkout/cart");
|
33 |
|
34 |
$cart = $_config->getSession()->getCartSkybox();
|
35 |
+
|
36 |
+
// Load CSS & JS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
$skybox_url = $_helper->getSkyboxUrlMain();// $_config->skyboxDefaultUrl;
|
38 |
$api_css_button_international = $skybox_url . 'widgets/api-button/css/api-button-international-css.ashx';
|
39 |
$api_css_button_international .= '?s=' . $_helper->getMerchantCode();
|
68 |
echo $template;
|
69 |
endif;
|
70 |
|
71 |
+
if ($allowHelper->isPriceEnabled()) {
|
|
|
72 |
$productConfigurable = $this->getSkinUrl('js/skybox/catalog.product.configurable.js');
|
73 |
+
echo '<script type="text/javascript" src="' . $productConfigurable . '"></script>';
|
74 |
}
|
75 |
|
76 |
$skyBoxUrlClientBase = $_helper->getSkyBoxUrlAPI();
|
77 |
$storeCode = Mage::getModel('skyboxcatalog/api_product')->getStoreCode();
|
78 |
$skyBoxUrlClientGet = str_replace("apirest/", "", $skyBoxUrlClientBase);
|
79 |
$skyBoxUrlClient = $skyBoxUrlClientGet . "multiplecalculate/" . $storeCode . "/calc-";
|
80 |
+
$skyboxForceReload = intval(Mage::getBlockSingleton('page/html_header')->getIsHomePage());
|
81 |
?>
|
82 |
<link rel="stylesheet" type="text/css" href="<?php echo $api_css_button_international; ?>"/>
|
83 |
<link rel="stylesheet" type="text/css"
|
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 |
+
var SKYBOX_FORCE_RELOAD = "<?php echo $skyboxForceReload; ?>";
|
99 |
+
var LOADING_IMAGE = "<?php echo $this->getSkinUrl('images/skybox/ajax-loading.gif')?>";
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
(function ($) {
|
102 |
+
$(document).ready(function () {
|
103 |
+
if (typeof $.fancybox != "function") {
|
104 |
+
var fileref = document.createElement("link");
|
105 |
+
fileref.rel = "stylesheet";
|
106 |
+
fileref.type = "text/css";
|
107 |
+
fileref.href = "<?php echo $this->getSkinUrl('css/skybox/jquery.fancybox.css');?>";
|
108 |
+
document.getElementsByTagName("head")[0].appendChild(fileref);
|
109 |
+
$('head').append($('<script />').attr('src', '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'js/skybox/jquery.fancybox.js'; ?>'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
}
|
111 |
+
$(".skybox-price-set").each(function (index) {
|
112 |
+
var SkyBoxUrlClient = "<?php echo $skyBoxUrlClient;?>";
|
113 |
+
var dataId = $(this).attr("id");
|
114 |
+
var id = $(this).attr("product-id");
|
115 |
+
var url = SkyBoxUrlClient + id + ".html";
|
116 |
+
// console.log("URL : " + url);
|
117 |
+
var content = $.get(url, function (data) {
|
118 |
+
$("#" + dataId).html(data);
|
119 |
+
});
|
120 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
});
|
122 |
})(jQuery);
|
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 |
//<![CDATA[
|
127 |
var SKYBOX_OPTIONS_PRICE_URL = '<?php echo Mage::getUrl(); ?>skbcheckout/calculate';
|
128 |
//]]>
|
129 |
</script>
|
130 |
<script type="text/javascript" src="<?php echo $api_js_button_international; ?>"></script>
|
131 |
+
<?php
|
132 |
+
// note: Just to force reload page on Home Page.
|
133 |
+
$forceReload = $_config->getSession()->getChangeCountryHomePage();
|
134 |
+
$forceReload = isset($forceReload) ? $forceReload : 0;
|
135 |
+
|
136 |
+
if (Mage::getBlockSingleton('page/html_header')->getIsHomePage()) :
|
137 |
+
if ($forceReload == 1):
|
138 |
+
$forceReload = 0;
|
139 |
+
$_config->getSession()->setChangeCountryHomePage($forceReload);
|
140 |
+
?>
|
141 |
+
<script type="text/javascript">
|
142 |
+
// console.log("[Skybox] Reloading page...");
|
143 |
+
window.location.reload(false);
|
144 |
+
</script>
|
145 |
+
<?php
|
146 |
+
endif;
|
147 |
+
endif;
|
148 |
+
?>
|
149 |
<script>
|
150 |
setTimeout(function () {
|
151 |
var country_change = "<?php echo $countryChange?>";
|
js/skybox/main.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
(function($) {
|
2 |
// var SKYBOX_URL = 'https://www.skyboxcheckout.com/';
|
3 |
var widthPage = 0;
|
4 |
var heightPage = 0;
|
@@ -6,92 +6,93 @@
|
|
6 |
var merchant = '';
|
7 |
var urlStore = '';
|
8 |
|
9 |
-
var main =
|
10 |
-
__init
|
11 |
widthPage = window.outerWidth; //$(window).width();
|
12 |
-
heightPage = window.outerHeight
|
13 |
//currentUri = window.location.href;
|
14 |
merchant = MERCHANT_ID_SKYBOX;
|
15 |
//cartDataURL = CART_DATA_URL_SKYBOX;
|
16 |
// urlStore = window.location.protocol+'//'+window.location.host;
|
17 |
urlStore = URL_BASE_MAGENTO;
|
18 |
},
|
19 |
-
dataMain
|
20 |
merchant = MERCHANT_ID_SKYBOX;
|
21 |
return {
|
22 |
-
cartDataURL
|
23 |
-
IsRegistrationDisabled
|
24 |
-
currentUri
|
|
|
25 |
};
|
26 |
},
|
27 |
-
load
|
28 |
$(document).ready(function () {
|
29 |
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Ready document');
|
30 |
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get load');
|
31 |
-
$(document).on('click', '.skx_banner_image_car', function(){
|
32 |
main.goToCart();
|
33 |
});
|
34 |
-
$(document).on('click', '.skx_position_option_country', function(){
|
35 |
main.goToLocation(main.dataMain());
|
36 |
});
|
37 |
-
$(document).on('click', '.skx_banner_image_account', function(){
|
38 |
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: get dataMain: ');
|
39 |
-
console.dir(main.dataMain());
|
40 |
main.goToInitializeSession(main.dataMain());
|
41 |
});
|
42 |
-
$(document).on('click', '.skx_banner_image_tracking', function(){
|
43 |
main.goToTrackingLocation(main.dataMain());
|
44 |
});
|
45 |
-
$(document).on('click', '#link_choise_country', function(){
|
46 |
main.goToCart();
|
47 |
});
|
48 |
//main.loadIframe(data);
|
49 |
});
|
50 |
},
|
51 |
-
showPopup
|
52 |
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get showPopup');
|
53 |
-
console.info(
|
54 |
$.fancybox({
|
55 |
-
href
|
56 |
-
closeBtn
|
57 |
-
width
|
58 |
-
height: (h+28),
|
59 |
-
type
|
60 |
-
iframe
|
61 |
-
scrolling
|
62 |
-
preload
|
63 |
},
|
64 |
-
loop
|
65 |
-
afterClose: function(current) {
|
66 |
-
console.info(
|
67 |
// var actualUri = window.location.href;
|
68 |
// indexParams = actualUri.indexOf('?');
|
69 |
// top.location = actualUri.substring(0, indexParams);
|
70 |
},
|
71 |
padding: 0,
|
72 |
-
helpers
|
73 |
-
overlay
|
74 |
-
css
|
75 |
-
'background'
|
76 |
}
|
77 |
}
|
78 |
}
|
79 |
});
|
80 |
},
|
81 |
-
goToCart: function() {
|
82 |
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToCart');
|
83 |
document.location = urlStore + '/checkout/cart/';
|
84 |
},
|
85 |
-
goToInitializeSession: function(data){
|
86 |
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToInitializeSession');
|
87 |
-
if(data.IsRegistrationDisabled === 1){
|
88 |
main.goToTrackingLocation(data)
|
89 |
-
}else{
|
90 |
main.goToLoginLocation(data)
|
91 |
}
|
92 |
},
|
93 |
-
goToLoginLocation: function(data){
|
94 |
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToLoginLocation');
|
95 |
var idCart = "";
|
96 |
var datos = data.cartDataURL;
|
97 |
var actualUri = data.currentUri + "?LoadFrame=1";
|
@@ -100,19 +101,21 @@
|
|
100 |
+ "&idCart=" + idCart + "&ReLoad=1&uri=" + actualUri;
|
101 |
main.showPopup('initSession', '', url, (widthPage - 50 ), ((heightPage < 800) ? heightPage - 50 : 800));
|
102 |
},
|
103 |
-
goToLocation: function(data) {
|
104 |
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToLocation');
|
105 |
var datos = data.cartDataURL;
|
106 |
-
var process_url =
|
107 |
var return_url = document.URL;
|
108 |
-
|
|
|
|
|
109 |
var url = SKYBOX_URL + "Webforms/PublicSite/ReSync.aspx?" + datos + "&process_url=" + process_url + "&return_url=" + return_url;
|
110 |
//console.log(url);
|
111 |
//showPopup('selectLocation', 'Select your location', url, 400, 370);
|
112 |
main.showPopup('selectLocation', '', url, 540, 640);
|
113 |
},
|
114 |
-
goToTrackingLocation: function(data) {
|
115 |
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToTrackingLocation');
|
116 |
var idCart = "";
|
117 |
var datos = data.cartDataURL;
|
118 |
//var url = "http://www.skyboxcheckout.com/Tracking.aspx?" + datos;
|
@@ -120,8 +123,8 @@
|
|
120 |
//console.log(url);
|
121 |
main.showPopup('tracking', '', url, (widthPage - 50 ), ((heightPage < 800) ? heightPage - 50 : 800));
|
122 |
},
|
123 |
-
loadIframe: function(data) {
|
124 |
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get loadIframe');
|
125 |
var actualUri = data.currentUri;
|
126 |
var flgLoadIframe = "0";
|
127 |
if (flgLoadIframe === "1") {
|
@@ -134,4 +137,4 @@
|
|
134 |
|
135 |
main.__init();
|
136 |
main.load();
|
137 |
-
})(jQuery);
|
1 |
+
(function ($) {
|
2 |
// var SKYBOX_URL = 'https://www.skyboxcheckout.com/';
|
3 |
var widthPage = 0;
|
4 |
var heightPage = 0;
|
6 |
var merchant = '';
|
7 |
var urlStore = '';
|
8 |
|
9 |
+
var main = {
|
10 |
+
__init: function () {
|
11 |
widthPage = window.outerWidth; //$(window).width();
|
12 |
+
heightPage = window.outerHeight; //$(window).height();
|
13 |
//currentUri = window.location.href;
|
14 |
merchant = MERCHANT_ID_SKYBOX;
|
15 |
//cartDataURL = CART_DATA_URL_SKYBOX;
|
16 |
// urlStore = window.location.protocol+'//'+window.location.host;
|
17 |
urlStore = URL_BASE_MAGENTO;
|
18 |
},
|
19 |
+
dataMain: function () {
|
20 |
merchant = MERCHANT_ID_SKYBOX;
|
21 |
return {
|
22 |
+
cartDataURL: CART_DATA_URL_SKYBOX,
|
23 |
+
IsRegistrationDisabled: IS_REGISTRATION_DISABLED_SKYBOX,
|
24 |
+
currentUri: window.location.href,
|
25 |
+
forceReload: SKYBOX_FORCE_RELOAD,
|
26 |
};
|
27 |
},
|
28 |
+
load: function () {
|
29 |
$(document).ready(function () {
|
30 |
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Ready document');
|
31 |
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get load');
|
32 |
+
$(document).on('click', '.skx_banner_image_car', function () {
|
33 |
main.goToCart();
|
34 |
});
|
35 |
+
$(document).on('click', '.skx_position_option_country', function () {
|
36 |
main.goToLocation(main.dataMain());
|
37 |
});
|
38 |
+
$(document).on('click', '.skx_banner_image_account', function () {
|
39 |
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: get dataMain: ');
|
40 |
+
// console.dir(main.dataMain());
|
41 |
main.goToInitializeSession(main.dataMain());
|
42 |
});
|
43 |
+
$(document).on('click', '.skx_banner_image_tracking', function () {
|
44 |
main.goToTrackingLocation(main.dataMain());
|
45 |
});
|
46 |
+
$(document).on('click', '#link_choise_country', function () {
|
47 |
main.goToCart();
|
48 |
});
|
49 |
//main.loadIframe(data);
|
50 |
});
|
51 |
},
|
52 |
+
showPopup: function (name, t, url, w, h) {
|
53 |
+
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get showPopup');
|
54 |
+
// console.info('URL: ' + url);
|
55 |
$.fancybox({
|
56 |
+
href: url,
|
57 |
+
closeBtn: true,
|
58 |
+
width: w,
|
59 |
+
height: (h + 28),
|
60 |
+
type: 'iframe',
|
61 |
+
iframe: {
|
62 |
+
scrolling: 'auto',
|
63 |
+
preload: true
|
64 |
},
|
65 |
+
loop: false,
|
66 |
+
afterClose: function (current) {
|
67 |
+
// console.info('Current: ' + current.href);
|
68 |
// var actualUri = window.location.href;
|
69 |
// indexParams = actualUri.indexOf('?');
|
70 |
// top.location = actualUri.substring(0, indexParams);
|
71 |
},
|
72 |
padding: 0,
|
73 |
+
helpers: {
|
74 |
+
overlay: {
|
75 |
+
css: {
|
76 |
+
'background': 'none'
|
77 |
}
|
78 |
}
|
79 |
}
|
80 |
});
|
81 |
},
|
82 |
+
goToCart: function () {
|
83 |
+
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToCart');
|
84 |
document.location = urlStore + '/checkout/cart/';
|
85 |
},
|
86 |
+
goToInitializeSession: function (data) {
|
87 |
+
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToInitializeSession');
|
88 |
+
if (data.IsRegistrationDisabled === 1) {
|
89 |
main.goToTrackingLocation(data)
|
90 |
+
} else {
|
91 |
main.goToLoginLocation(data)
|
92 |
}
|
93 |
},
|
94 |
+
goToLoginLocation: function (data) {
|
95 |
+
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToLoginLocation');
|
96 |
var idCart = "";
|
97 |
var datos = data.cartDataURL;
|
98 |
var actualUri = data.currentUri + "?LoadFrame=1";
|
101 |
+ "&idCart=" + idCart + "&ReLoad=1&uri=" + actualUri;
|
102 |
main.showPopup('initSession', '', url, (widthPage - 50 ), ((heightPage < 800) ? heightPage - 50 : 800));
|
103 |
},
|
104 |
+
goToLocation: function (data) {
|
105 |
+
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToLocation');
|
106 |
var datos = data.cartDataURL;
|
107 |
+
var process_url = urlStore + "skbcheckout/process"; // cambiar esta url
|
108 |
var return_url = document.URL;
|
109 |
+
if (data.forceReload) {
|
110 |
+
return_url += 'force_reload';
|
111 |
+
}
|
112 |
var url = SKYBOX_URL + "Webforms/PublicSite/ReSync.aspx?" + datos + "&process_url=" + process_url + "&return_url=" + return_url;
|
113 |
//console.log(url);
|
114 |
//showPopup('selectLocation', 'Select your location', url, 400, 370);
|
115 |
main.showPopup('selectLocation', '', url, 540, 640);
|
116 |
},
|
117 |
+
goToTrackingLocation: function (data) {
|
118 |
+
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get goToTrackingLocation');
|
119 |
var idCart = "";
|
120 |
var datos = data.cartDataURL;
|
121 |
//var url = "http://www.skyboxcheckout.com/Tracking.aspx?" + datos;
|
123 |
//console.log(url);
|
124 |
main.showPopup('tracking', '', url, (widthPage - 50 ), ((heightPage < 800) ? heightPage - 50 : 800));
|
125 |
},
|
126 |
+
loadIframe: function (data) {
|
127 |
+
// console.log('>>>>>>>>>>>>>>>>>>>>>>>>> Log: Get loadIframe');
|
128 |
var actualUri = data.currentUri;
|
129 |
var flgLoadIframe = "0";
|
130 |
if (flgLoadIframe === "1") {
|
137 |
|
138 |
main.__init();
|
139 |
main.load();
|
140 |
+
})(jQuery);
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>SKYBOZ456</name>
|
4 |
-
<version>1.2.6.
|
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; territories and accept payment in 140 local currencies. SkyBOX Checkout is a combination of technology tools &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; 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; territories and accept payment in 140 local currencies. SkyBOX Checkout is a combination of technology tools &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; 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-
|
14 |
-
<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="
|
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.6.2</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; territories and accept payment in 140 local currencies. SkyBOX Checkout is a combination of technology tools &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; 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; territories and accept payment in 140 local currencies. SkyBOX Checkout is a combination of technology tools &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; 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-11</date>
|
14 |
+
<time>19:19:12</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="3c4bbfe539e3fe655c513b3d697e0b0e"/><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="06ac077f3260ad2850eab920b770f594"/></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="ecedc8213b513be7fc4f6ca18dd0fe4e"/></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="aa5a34ab62b198b0759f4494f7018769"/><dir name="Creditmemo"><file name="Total.php" hash="9741bdffba5f4fb93f974ebff5342446"/></dir><dir name="Invoice"><file name="Total.php" hash="bec3b4df14eb5ee06c32d648d230fe6c"/></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="7c664235331af2205137abd89b7745d1"/><file name="Tax.php" hash="d19c997af49305890ec76256537bc274"/></dir></dir><file name="Item.php" hash="94c87cbf798b4f3b1df93df58d0127ff"/><file name="SubTotal.php" hash="712739ad0261862bc3fdd84883e052ce"/><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="15bd7d1e258d43ff3874475ba4ac1557"/><file name="InternationalController.php" hash="f0ffbc37e5e4d0a87108fb1e472944b1"/><file name="ProcessController.php" hash="2befb4e7e3b56d5efe099d2279f776a3"/></dir><dir name="etc"><file name="config.xml" hash="442bd73b244080c51e206cd9f43ff42e"/><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"/><file name="mysql4-upgrade-1.2.5-1.2.5.2.php" hash="46d14b76fc745e8772cde4956d1b1f66"/><file name="mysql4-upgrade-1.2.5.2-1.2.6.php" hash="46d14b76fc745e8772cde4956d1b1f66"/></dir></dir></dir><dir name="Core"><file name="Exception.php" hash="bca15d9d6fff9b215368a2957f2143c2"/><dir name="Helper"><file name="Allow.php" hash="5e0db1850609acb4773cde8910ed7603"/><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="480f8a9ff4d9e90b6e9b56742a3f4d88"/></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"/><file name="StoreType.php" hash="1f6b09a1a6ba5f3cef24eecf2868b233"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a282724808c4a3e46cf9bef869004684"/><file name="config.xml" hash="4e6bcd4448fec812235e6023ac0cc4ac"/><file name="system.xml" hash="f99c4cd46f87a98c6761afbc21cc8c4e"/></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="84e89679bfb7b3cc9f93f15855a5fd20"/><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="a6fa59651a304f8bed3b84a21b3440ce"/></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="23627f4dc79525fc58dbf9ac7d63b627"/><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="15d327661efa77d2c790bf53e28bdfea"/><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="012dbf008ec79f5ba9fe384e48bb1c99"/></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="80c29b6490813a323f61da31c879bb14"/></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="2bddafa1e01c366929dc6f65af72716c"/></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/js/skybox/catalog.product.configurable.js
CHANGED
@@ -44,8 +44,8 @@ if (typeof Product !== 'undefined') {
|
|
44 |
var SkyboxOptionsPrice = Class.create(Product.OptionsPrice, {
|
45 |
|
46 |
makeAjaxCall: function () {
|
47 |
-
|
48 |
-
console.log("Price: " + this.myProductPrice);
|
49 |
var request = $('product_addtocart_form').serialize();
|
50 |
|
51 |
new Ajax.Request(this.url, {
|
@@ -68,7 +68,7 @@ if (typeof Product !== 'undefined') {
|
|
68 |
}
|
69 |
|
70 |
if (price_info) {
|
71 |
-
console.log('price-info');
|
72 |
$$('.price-info')[0].innerHTML = response;
|
73 |
}
|
74 |
|
@@ -80,48 +80,51 @@ if (typeof Product !== 'undefined') {
|
|
80 |
|
81 |
reload: function ($super) {
|
82 |
$super();
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
125 |
}
|
126 |
});
|
127 |
Product.OptionsPrice = SkyboxOptionsPrice;
|
44 |
var SkyboxOptionsPrice = Class.create(Product.OptionsPrice, {
|
45 |
|
46 |
makeAjaxCall: function () {
|
47 |
+
document.getElementsByClassName('price-info')[0].innerHTML = "<img src='" + LOADING_IMAGE + "'/>";
|
48 |
+
// console.log("Price: " + this.myProductPrice);
|
49 |
var request = $('product_addtocart_form').serialize();
|
50 |
|
51 |
new Ajax.Request(this.url, {
|
68 |
}
|
69 |
|
70 |
if (price_info) {
|
71 |
+
// console.log('price-info');
|
72 |
$$('.price-info')[0].innerHTML = response;
|
73 |
}
|
74 |
|
80 |
|
81 |
reload: function ($super) {
|
82 |
$super();
|
83 |
+
if (parseInt(IS_SKYBOX_VISIBLE) === 1) {
|
84 |
+
|
85 |
+
var price;
|
86 |
+
var formattedPrice;
|
87 |
+
var optionPrices = this.getOptionPrices();
|
88 |
+
var nonTaxable = optionPrices[1];
|
89 |
+
var optionOldPrice = optionPrices[2];
|
90 |
+
var priceInclTax = optionPrices[3];
|
91 |
+
optionPrices = optionPrices[0];
|
92 |
+
|
93 |
+
// ...
|
94 |
+
|
95 |
+
var _productPrice;
|
96 |
+
var _plusDisposition;
|
97 |
+
var _minusDisposition;
|
98 |
+
var _priceInclTax;
|
99 |
+
|
100 |
+
_productPrice = this.productPrice;
|
101 |
+
_plusDisposition = this.plusDisposition;
|
102 |
+
_minusDisposition = this.minusDisposition;
|
103 |
+
|
104 |
+
_priceInclTax = priceInclTax;
|
105 |
+
|
106 |
+
// ...
|
107 |
+
|
108 |
+
//price = optionOldPrice+parseFloat(_productPrice);
|
109 |
+
price = optionPrices + parseFloat(_productPrice);
|
110 |
+
_priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100;
|
111 |
+
|
112 |
+
var tax = price * (this.currentTax / 100);
|
113 |
+
var excl = price;
|
114 |
+
// var incl = excl + tax;
|
115 |
+
var incl = excl;
|
116 |
+
var finalPrice = parseFloat(incl);
|
117 |
+
|
118 |
+
// console.log('Price incl tax: ' + _priceInclTax);
|
119 |
+
// console.log('Origin Tax: ' + this.currentTax);
|
120 |
+
// console.log('Tax: ' + tax);
|
121 |
+
// console.log('price reload: ' + price);
|
122 |
+
// console.log('Price + Tax: ' + incl);
|
123 |
+
|
124 |
+
this.url = SKYBOX_OPTIONS_PRICE_URL;
|
125 |
+
this.myProductPrice = finalPrice;
|
126 |
+
this.makeAjaxCall();
|
127 |
+
}
|
128 |
}
|
129 |
});
|
130 |
Product.OptionsPrice = SkyboxOptionsPrice;
|