Version Notes
Bugfixes
Download this release
Release Info
Developer | EasySize IVS |
Extension | easysize |
Version | 1.3.3 |
Comparing to | |
See all releases |
Code changes from version 1.2.4 to 1.3.3
- app/code/community/EasySize/SizeGuide/Block/Data.php +30 -20
- app/code/community/EasySize/SizeGuide/Model/Observer.php +94 -0
- app/code/community/EasySize/SizeGuide/Model/ShopAttributes.php +11 -0
- app/code/community/EasySize/SizeGuide/etc/config.xml +10 -1
- app/code/community/EasySize/SizeGuide/etc/system.xml +68 -10
- app/code/community/EasySize/SizeGuide/sql/sizeguide_setup/{install-1.2.4.php → install-1.3.2.php} +1 -2
- app/design/frontend/base/default/layout/sizeguide.xml +20 -0
- app/design/frontend/base/default/template/sizeguide/sizefilter.phtml +21 -0
- package.xml +5 -5
- skin/frontend/base/default/easysize/css/easysize.sizefilter.css +16 -0
app/code/community/EasySize/SizeGuide/Block/Data.php
CHANGED
@@ -4,7 +4,7 @@ class EasySize_SizeGuide_Block_Data extends Mage_Core_Block_Template {
|
|
4 |
private $size_attribute_id = false;
|
5 |
|
6 |
public function getRequiredAttributes() {
|
7 |
-
$
|
8 |
|
9 |
// product is currently viewed product
|
10 |
$product_id = $this->getRequest()->getParam('id');
|
@@ -13,43 +13,53 @@ class EasySize_SizeGuide_Block_Data extends Mage_Core_Block_Template {
|
|
13 |
// Get all sizeguide settings from shop configurations
|
14 |
$shop_configuration = Mage::getStoreConfig('sizeguide/sizeguide');
|
15 |
|
16 |
-
$
|
17 |
-
$
|
18 |
-
|
19 |
-
|
20 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
// If one gender is set, the shop is selling on gender clothing items
|
23 |
if(strlen($one_gender) > 0) {
|
24 |
-
$
|
25 |
}
|
26 |
|
27 |
-
$
|
28 |
-
$
|
29 |
-
$
|
30 |
-
$
|
31 |
-
$
|
32 |
-
$
|
33 |
-
$
|
34 |
|
35 |
-
return json_encode($
|
36 |
}
|
37 |
|
38 |
/*
|
39 |
* Returns product brand if the brand is amongst categories
|
40 |
*/
|
41 |
-
private function getProductBrandFromCategory($product, $
|
42 |
$categoryCollection = $product->getCategoryCollection();
|
43 |
|
44 |
foreach($categoryCollection as $_productCategory) {
|
45 |
$_parentCategories = $_productCategory->getParentCategories();
|
46 |
|
47 |
-
foreach($
|
48 |
-
if(in_array($
|
49 |
return $_parentCategory->getName();
|
50 |
}
|
51 |
}
|
52 |
}
|
|
|
|
|
53 |
}
|
54 |
|
55 |
/*
|
@@ -67,7 +77,7 @@ class EasySize_SizeGuide_Block_Data extends Mage_Core_Block_Template {
|
|
67 |
|
68 |
/*
|
69 |
* Iterates through all the simple products created from the configurable product
|
70 |
-
* Returns array of
|
71 |
*/
|
72 |
private function getProductSizesInStock($product, $size_attribute_codes) {
|
73 |
$child_products = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product);
|
@@ -113,7 +123,7 @@ class EasySize_SizeGuide_Block_Data extends Mage_Core_Block_Template {
|
|
113 |
}
|
114 |
|
115 |
/*
|
116 |
-
* Custom
|
117 |
*/
|
118 |
public function log($text) {
|
119 |
Mage::log($text, null, 'sizeguide.log');
|
4 |
private $size_attribute_id = false;
|
5 |
|
6 |
public function getRequiredAttributes() {
|
7 |
+
$required_attributes = new stdClass();
|
8 |
|
9 |
// product is currently viewed product
|
10 |
$product_id = $this->getRequest()->getParam('id');
|
13 |
// Get all sizeguide settings from shop configurations
|
14 |
$shop_configuration = Mage::getStoreConfig('sizeguide/sizeguide');
|
15 |
|
16 |
+
$required_attributes->order_button_id = $shop_configuration['sizeguide_add_to_cart_button'];
|
17 |
+
$required_attributes->product_id = $product_id;
|
18 |
+
|
19 |
+
// This parts distinguishes whether the brand is saved as category or product attribute
|
20 |
+
$brandFromCategory = Mage::getModel('catalog/category')->load($shop_configuration['sizeguide_brand_attribute']);
|
21 |
+
if($brandFromCategory->getId()) {
|
22 |
+
$required_attributes->product_brand = $this->getProductBrandFromCategory($product, $brandFromCategory->getId());
|
23 |
+
} else {
|
24 |
+
$required_attributes->product_brand = $product->getAttributeText($shop_configuration['sizeguide_brand_attribute']);
|
25 |
+
}
|
26 |
+
|
27 |
+
$required_attributes->product_gender = isset($shop_configuration['sizeguide_gender_attribute']) ? $product->getAttributeText($shop_configuration['sizeguide_gender_attribute']) : '';
|
28 |
+
$one_gender = isset($shop_configuration['sizeguide_gender_one_attribute']) ? $shop_configuration['sizeguide_gender_one_attribute'] : '';
|
29 |
|
30 |
// If one gender is set, the shop is selling on gender clothing items
|
31 |
if(strlen($one_gender) > 0) {
|
32 |
+
$required_attributes->product_gender = $one_gender;
|
33 |
}
|
34 |
|
35 |
+
$required_attributes->product_type = implode(',', $this->getProductCategoriesNames($product));
|
36 |
+
$required_attributes->sizes_in_stock = $this->getProductSizesInStock($product, $shop_configuration['sizeguide_size_attributes']);
|
37 |
+
$required_attributes->shop_id = $shop_configuration['sizeguide_shopid'];
|
38 |
+
$required_attributes->placeholder = $shop_configuration['sizeguide_button_placeholder'];
|
39 |
+
$required_attributes->size_selector = "attribute{$this->size_attribute_id}";
|
40 |
+
$required_attributes->user_id = $this->getCustomerId();
|
41 |
+
$required_attributes->image_url = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage());
|
42 |
|
43 |
+
return json_encode($required_attributes);
|
44 |
}
|
45 |
|
46 |
/*
|
47 |
* Returns product brand if the brand is amongst categories
|
48 |
*/
|
49 |
+
private function getProductBrandFromCategory($product, $parentCategoryIdToLookFor) {
|
50 |
$categoryCollection = $product->getCategoryCollection();
|
51 |
|
52 |
foreach($categoryCollection as $_productCategory) {
|
53 |
$_parentCategories = $_productCategory->getParentCategories();
|
54 |
|
55 |
+
foreach($_parentCategories as $_parentCategory) {
|
56 |
+
if($parentCategoryIdToLookFor != $_parentCategory->getId() && in_array($parentCategoryIdToLookFor, $_parentCategory->getPathIds())) {
|
57 |
return $_parentCategory->getName();
|
58 |
}
|
59 |
}
|
60 |
}
|
61 |
+
|
62 |
+
return null;
|
63 |
}
|
64 |
|
65 |
/*
|
77 |
|
78 |
/*
|
79 |
* Iterates through all the simple products created from the configurable product
|
80 |
+
* Returns array of products' sizes in stock.
|
81 |
*/
|
82 |
private function getProductSizesInStock($product, $size_attribute_codes) {
|
83 |
$child_products = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product);
|
123 |
}
|
124 |
|
125 |
/*
|
126 |
+
* Custom debugging function. Not used in production
|
127 |
*/
|
128 |
public function log($text) {
|
129 |
Mage::log($text, null, 'sizeguide.log');
|
app/code/community/EasySize/SizeGuide/Model/Observer.php
CHANGED
@@ -54,4 +54,98 @@ class EasySize_SizeGuide_Model_Observer {
|
|
54 |
public function updateCart($observer) {
|
55 |
// todo. Fix update cart
|
56 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
54 |
public function updateCart($observer) {
|
55 |
// todo. Fix update cart
|
56 |
}
|
57 |
+
|
58 |
+
public function filterProducts($observer)
|
59 |
+
{
|
60 |
+
if(isset($_REQUEST['easysize_sizefilter_products'])) {
|
61 |
+
$observer->getEvent()->getCollection()->addAttributeToFilter('entity_id', array('in' => $_REQUEST['easysize_sizefilter_products']));
|
62 |
+
}
|
63 |
+
|
64 |
+
if (Mage::registry('easysize_sizefilter_applied')) { return; }
|
65 |
+
|
66 |
+
// Get product attribute names for data extraction
|
67 |
+
$shop_configuration = Mage::getStoreConfig('sizeguide/sizeguide');
|
68 |
+
$gender_attribute_name = $shop_configuration['sizeguide_gender_attribute'];
|
69 |
+
$easysize_shop_id = $shop_configuration['sizeguide_shopid'];
|
70 |
+
$easysize_user_id = $_COOKIE['esui'];
|
71 |
+
|
72 |
+
if(!is_numeric($easysize_user_id) || is_numeric($easysize_user_id) && $easysize_user_id < 0) {
|
73 |
+
Mage::register('easysize_sizefilter_applied', true);
|
74 |
+
return;
|
75 |
+
}
|
76 |
+
|
77 |
+
$collection = $observer->getEvent()->getCollection()
|
78 |
+
->addAttributeToSelect('manufacturer');
|
79 |
+
$collection_product_ids = $collection->getAllIds();
|
80 |
+
$first_item = Mage::getModel('catalog/product')->getCollection()
|
81 |
+
->addAttributeToSelect($gender_attribute_name)
|
82 |
+
->addAttributeToFilter('entity_id', array('in' => $collection_product_ids))
|
83 |
+
->addAttributeToFilter('type_id', 'configurable')
|
84 |
+
->getFirstItem();
|
85 |
+
|
86 |
+
$current_store = Mage::app()->getRequest()->getParam('store');
|
87 |
+
|
88 |
+
// Using first item from collection, get gender and category of items
|
89 |
+
if(strlen($shop_configuration['sizeguide_gender_one_attribute']) > 0) {
|
90 |
+
$product_gender = $shop_configuration['sizeguide_gender_one_attribute'];
|
91 |
+
} else {
|
92 |
+
$product_gender = $first_item->getAttributeText($gender_attribute_name);
|
93 |
+
}
|
94 |
+
|
95 |
+
$params = [];
|
96 |
+
$params[] = "shop_id={$easysize_shop_id}";
|
97 |
+
$params[] = "gender={$product_gender}";
|
98 |
+
$params[] = "easysize_user_id={$easysize_user_id}";
|
99 |
+
|
100 |
+
$product_type = $first_item->getCategory()->getName();
|
101 |
+
$product_type_decoded = urlencode($product_type);
|
102 |
+
if($this->isCategoryABrand($first_item->getCategory())) {
|
103 |
+
$params[] = "brand={$product_type_decoded}";
|
104 |
+
} else {
|
105 |
+
$params[] = "category={$product_type_decoded}";
|
106 |
+
}
|
107 |
+
|
108 |
+
$params = implode('&', $params);
|
109 |
+
$url = "https://popup.easysize.me/filterProductsBySize?${params}";
|
110 |
+
$curl = curl_init();
|
111 |
+
curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $url ));
|
112 |
+
$data = json_decode(curl_exec($curl), true);
|
113 |
+
curl_close($curl);
|
114 |
+
|
115 |
+
$filtered_product_ids = [];
|
116 |
+
foreach ($data as $item) {
|
117 |
+
$filtered_product_ids[] = $item['product_id'];
|
118 |
+
}
|
119 |
+
|
120 |
+
if(sizeof($filtered_product_ids) > 0) {
|
121 |
+
$_REQUEST['easysize_sizefilter_has_products'] = true;
|
122 |
+
|
123 |
+
if (
|
124 |
+
isset($_POST['easysize_sizefilter']) && $_POST['easysize_sizefilter'] == "enable"
|
125 |
+
|| isset($_SESSION['easysize_sizefilter']) && $_SESSION['easysize_sizefilter'] == 1 && $_POST['easysize_sizefilter'] != "disable") {
|
126 |
+
|
127 |
+
$_SESSION['easysize_sizefilter'] = 1;
|
128 |
+
$_REQUEST['easysize_sizefilter_applied'] = true;
|
129 |
+
$_REQUEST['easysize_sizefilter_products'] = $filtered_product_ids;
|
130 |
+
} elseif(isset($_POST['easysize_sizefilter']) && $_POST['easysize_sizefilter'] === "disable") {
|
131 |
+
$_SESSION['easysize_sizefilter'] = 0;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
Mage::register('easysize_sizefilter_applied', true);
|
136 |
+
}
|
137 |
+
|
138 |
+
private function isCategoryABrand($category) {
|
139 |
+
$brandFromCategory = Mage::getModel('catalog/category')->load(Mage::getStoreConfig('sizeguide/sizeguide/sizeguide_brand_attribute'));
|
140 |
+
if($brandFromCategory->getId()) {
|
141 |
+
$_parentCategories = $category->getParentCategories();
|
142 |
+
foreach($_parentCategories as $_parentCategory) {
|
143 |
+
if($brandFromCategory->getId() != $_parentCategory->getId() && in_array($brandFromCategory->getId(), $_parentCategory->getPathIds())) {
|
144 |
+
return true;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
} else {
|
148 |
+
return false;
|
149 |
+
}
|
150 |
+
}
|
151 |
}
|
app/code/community/EasySize/SizeGuide/Model/ShopAttributes.php
CHANGED
@@ -18,6 +18,17 @@ class EasySize_SizeGuide_Model_ShopAttributes {
|
|
18 |
$result[] = array('value'=>$code, 'label'=>$label);
|
19 |
}
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
return $result;
|
22 |
}
|
23 |
}
|
18 |
$result[] = array('value'=>$code, 'label'=>$label);
|
19 |
}
|
20 |
|
21 |
+
$shopCategories = Mage::getModel('catalog/category')
|
22 |
+
->getCollection()
|
23 |
+
->addAttributeToSelect('name');
|
24 |
+
|
25 |
+
foreach($shopCategories as $category) {
|
26 |
+
$id = $category->getId();
|
27 |
+
$label = $category->getName();
|
28 |
+
|
29 |
+
$result[] = array('value'=>$id, 'label'=>$label);
|
30 |
+
}
|
31 |
+
|
32 |
return $result;
|
33 |
}
|
34 |
}
|
app/code/community/EasySize/SizeGuide/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<EasySize_SizeGuide>
|
5 |
-
<version>1.2
|
6 |
</EasySize_SizeGuide>
|
7 |
</modules>
|
8 |
|
@@ -65,6 +65,15 @@
|
|
65 |
</easysize_sizeguide_update_cart>
|
66 |
</observers>
|
67 |
</checkout_cart_update_item_complete>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
</events>
|
69 |
</frontend>
|
70 |
|
2 |
<config>
|
3 |
<modules>
|
4 |
<EasySize_SizeGuide>
|
5 |
+
<version>1.3.2</version>
|
6 |
</EasySize_SizeGuide>
|
7 |
</modules>
|
8 |
|
65 |
</easysize_sizeguide_update_cart>
|
66 |
</observers>
|
67 |
</checkout_cart_update_item_complete>
|
68 |
+
|
69 |
+
<catalog_product_collection_apply_limitations_after>
|
70 |
+
<observers>
|
71 |
+
<easysize_sizefilter_product_filter>
|
72 |
+
<class>EasySize_SizeGuide_Model_Observer</class>
|
73 |
+
<method>filterProducts</method>
|
74 |
+
</easysize_sizefilter_product_filter>
|
75 |
+
</observers>
|
76 |
+
</catalog_product_collection_apply_limitations_after>
|
77 |
</events>
|
78 |
</frontend>
|
79 |
|
app/code/community/EasySize/SizeGuide/etc/system.xml
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<config>
|
2 |
<tabs>
|
3 |
-
<easysize
|
4 |
<label>EasySize</label>
|
5 |
<sort_order>99999</sort_order>
|
6 |
</easysize>
|
7 |
</tabs>
|
8 |
<sections>
|
9 |
-
<sizeguide
|
10 |
<label>Settings</label>
|
11 |
<tab>easysize</tab>
|
12 |
<frontend_type>text</frontend_type>
|
@@ -15,7 +15,7 @@
|
|
15 |
<show_in_website>1</show_in_website>
|
16 |
<show_in_store>1</show_in_store>
|
17 |
<groups>
|
18 |
-
<sizeguide
|
19 |
<label>Required fields</label>
|
20 |
<comment>Please consult your developers or EasySize team if you are not sure about the right value to be selected.</comment>
|
21 |
<frontend_type>text</frontend_type>
|
@@ -24,9 +24,18 @@
|
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>1</show_in_store>
|
26 |
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
<sizeguide_shopid>
|
28 |
<label>Shop ID</label>
|
29 |
-
<comment>Provided by EasySize</comment>
|
30 |
<frontend_type>text</frontend_type>
|
31 |
<sort_order>1</sort_order>
|
32 |
<show_in_default>1</show_in_default>
|
@@ -47,7 +56,7 @@
|
|
47 |
|
48 |
<sizeguide_gender_one_attribute>
|
49 |
<label>Gender</label>
|
50 |
-
<comment>
|
51 |
<frontend_type>text</frontend_type>
|
52 |
<sort_order>3</sort_order>
|
53 |
<show_in_default>1</show_in_default>
|
@@ -57,7 +66,16 @@
|
|
57 |
|
58 |
<sizeguide_brand_attribute>
|
59 |
<label>Brand attribute code</label>
|
60 |
-
<comment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
<frontend_type>select</frontend_type>
|
62 |
<source_model>sizeguide/shopAttributes</source_model>
|
63 |
<sort_order>4</sort_order>
|
@@ -77,9 +95,18 @@
|
|
77 |
<show_in_store>1</show_in_store>
|
78 |
</sizeguide_size_attributes>
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
<sizeguide_button_placeholder>
|
81 |
<label>EasySize button placeholder</label>
|
82 |
-
<comment>Selector of the element where EasySize will be appended
|
83 |
<frontend_type>text</frontend_type>
|
84 |
<sort_order>6</sort_order>
|
85 |
<show_in_default>1</show_in_default>
|
@@ -89,17 +116,48 @@
|
|
89 |
|
90 |
<sizeguide_add_to_cart_button>
|
91 |
<label>Add to cart button</label>
|
92 |
-
<comment>Selector of your add to cart button</comment>
|
93 |
<frontend_type>text</frontend_type>
|
94 |
<sort_order>7</sort_order>
|
95 |
<show_in_default>1</show_in_default>
|
96 |
<show_in_website>1</show_in_website>
|
97 |
<show_in_store>1</show_in_store>
|
98 |
</sizeguide_add_to_cart_button>
|
99 |
-
|
100 |
-
<!-- TODO thing about the button design, should we load it dynamically instead? -->
|
101 |
</fields>
|
102 |
</sizeguide>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
</groups>
|
104 |
</sizeguide>
|
105 |
</sections>
|
1 |
<config>
|
2 |
<tabs>
|
3 |
+
<easysize module="sizeguide">
|
4 |
<label>EasySize</label>
|
5 |
<sort_order>99999</sort_order>
|
6 |
</easysize>
|
7 |
</tabs>
|
8 |
<sections>
|
9 |
+
<sizeguide module="sizeguide">
|
10 |
<label>Settings</label>
|
11 |
<tab>easysize</tab>
|
12 |
<frontend_type>text</frontend_type>
|
15 |
<show_in_website>1</show_in_website>
|
16 |
<show_in_store>1</show_in_store>
|
17 |
<groups>
|
18 |
+
<sizeguide>
|
19 |
<label>Required fields</label>
|
20 |
<comment>Please consult your developers or EasySize team if you are not sure about the right value to be selected.</comment>
|
21 |
<frontend_type>text</frontend_type>
|
24 |
<show_in_website>1</show_in_website>
|
25 |
<show_in_store>1</show_in_store>
|
26 |
<fields>
|
27 |
+
<sizeguide_size_config_header>
|
28 |
+
<label>EasySize configuration</label>
|
29 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
30 |
+
<sort_order>1</sort_order>
|
31 |
+
<show_in_default>1</show_in_default>
|
32 |
+
<show_in_website>1</show_in_website>
|
33 |
+
<show_in_store>1</show_in_store>
|
34 |
+
</sizeguide_size_config_header>
|
35 |
+
|
36 |
<sizeguide_shopid>
|
37 |
<label>Shop ID</label>
|
38 |
+
<comment><![CDATA[<h4>Provided by EasySize</h4>]]></comment>
|
39 |
<frontend_type>text</frontend_type>
|
40 |
<sort_order>1</sort_order>
|
41 |
<show_in_default>1</show_in_default>
|
56 |
|
57 |
<sizeguide_gender_one_attribute>
|
58 |
<label>Gender</label>
|
59 |
+
<comment><![CDATA[<strong style="color:red">Note!</strong> Only fill this in, if you are selling one gender items <em>(E.g Male or Female)</em>. <strong>Leave blank otherwise!</strong>]]></comment>
|
60 |
<frontend_type>text</frontend_type>
|
61 |
<sort_order>3</sort_order>
|
62 |
<show_in_default>1</show_in_default>
|
66 |
|
67 |
<sizeguide_brand_attribute>
|
68 |
<label>Brand attribute code</label>
|
69 |
+
<comment><![CDATA[
|
70 |
+
<strong style="color:red">Note!</strong>
|
71 |
+
<hr/>
|
72 |
+
<p>If your product brand is stored as an attribute, select that attribute!</p>
|
73 |
+
<hr/>
|
74 |
+
<p>If your product brand is stored as category, select the parent category, under which all the brands are stored</p>
|
75 |
+
<hr/>
|
76 |
+
<em>Contact EasySize if you are unsure about the selection</em>
|
77 |
+
]]>
|
78 |
+
</comment>
|
79 |
<frontend_type>select</frontend_type>
|
80 |
<source_model>sizeguide/shopAttributes</source_model>
|
81 |
<sort_order>4</sort_order>
|
95 |
<show_in_store>1</show_in_store>
|
96 |
</sizeguide_size_attributes>
|
97 |
|
98 |
+
<sizeguide_size_placemenet_header>
|
99 |
+
<label>EasySize appearance on page</label>
|
100 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
101 |
+
<sort_order>5</sort_order>
|
102 |
+
<show_in_default>1</show_in_default>
|
103 |
+
<show_in_website>1</show_in_website>
|
104 |
+
<show_in_store>1</show_in_store>
|
105 |
+
</sizeguide_size_placemenet_header>
|
106 |
+
|
107 |
<sizeguide_button_placeholder>
|
108 |
<label>EasySize button placeholder</label>
|
109 |
+
<comment><![CDATA[<em>NOTE! Some technical knowledge required!</em><p>Selector of the element where EasySize will be appended.</p>]]></comment>
|
110 |
<frontend_type>text</frontend_type>
|
111 |
<sort_order>6</sort_order>
|
112 |
<show_in_default>1</show_in_default>
|
116 |
|
117 |
<sizeguide_add_to_cart_button>
|
118 |
<label>Add to cart button</label>
|
119 |
+
<comment><![CDATA[<em>NOTE! Some technical knowledge required!</em><p>Selector of your add to cart button. <em>(<strong>.btn-cart</strong> on default templates, might be different on 3rd party templates)</em>]]></comment>
|
120 |
<frontend_type>text</frontend_type>
|
121 |
<sort_order>7</sort_order>
|
122 |
<show_in_default>1</show_in_default>
|
123 |
<show_in_website>1</show_in_website>
|
124 |
<show_in_store>1</show_in_store>
|
125 |
</sizeguide_add_to_cart_button>
|
|
|
|
|
126 |
</fields>
|
127 |
</sizeguide>
|
128 |
+
|
129 |
+
<sizefilter>
|
130 |
+
<label>Size Filter</label>
|
131 |
+
<frontend_type>text</frontend_type>
|
132 |
+
<sort_order>2</sort_order>
|
133 |
+
<show_in_default>2</show_in_default>
|
134 |
+
<show_in_website>2</show_in_website>
|
135 |
+
<show_in_store>2</show_in_store>
|
136 |
+
<fields>
|
137 |
+
<sizefilter_header>
|
138 |
+
<label>Size filter feature config</label>
|
139 |
+
<comment>This part requires some technical knowledge. Please contact EasySize if you need assistance settings this up.</comment>
|
140 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
141 |
+
<sort_order>1</sort_order>
|
142 |
+
<show_in_default>1</show_in_default>
|
143 |
+
<show_in_website>1</show_in_website>
|
144 |
+
<show_in_store>1</show_in_store>
|
145 |
+
</sizefilter_header>
|
146 |
+
|
147 |
+
<sizefilter_enabled>
|
148 |
+
<label>Enabled</label>
|
149 |
+
<comment>
|
150 |
+
<![CDATA[Enable or Disable size filter feature.]]>
|
151 |
+
</comment>
|
152 |
+
<frontend_type>select</frontend_type>
|
153 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
154 |
+
<sort_order>2</sort_order>
|
155 |
+
<show_in_default>2</show_in_default>
|
156 |
+
<show_in_website>2</show_in_website>
|
157 |
+
<show_in_store>2</show_in_store>
|
158 |
+
</sizefilter_enabled>
|
159 |
+
</fields>
|
160 |
+
</sizefilter>
|
161 |
</groups>
|
162 |
</sizeguide>
|
163 |
</sections>
|
app/code/community/EasySize/SizeGuide/sql/sizeguide_setup/{install-1.2.4.php → install-1.3.2.php}
RENAMED
@@ -19,8 +19,7 @@ curl_setopt_array($curl, array(
|
|
19 |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
20 |
CURLOPT_CUSTOMREQUEST => "GET",
|
21 |
CURLOPT_HTTPHEADER => array(
|
22 |
-
"cache-control: no-cache"
|
23 |
-
"postman-token: 6e549668-2f0a-1bad-3f47-a21f34bab086"
|
24 |
),
|
25 |
));
|
26 |
|
19 |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
20 |
CURLOPT_CUSTOMREQUEST => "GET",
|
21 |
CURLOPT_HTTPHEADER => array(
|
22 |
+
"cache-control: no-cache"
|
|
|
23 |
),
|
24 |
));
|
25 |
|
app/design/frontend/base/default/layout/sizeguide.xml
CHANGED
@@ -9,4 +9,24 @@
|
|
9 |
template="sizeguide/easysize.phtml" />
|
10 |
</reference>
|
11 |
</catalog_product_view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
</layout>
|
9 |
template="sizeguide/easysize.phtml" />
|
10 |
</reference>
|
11 |
</catalog_product_view>
|
12 |
+
|
13 |
+
<catalog_category_view>
|
14 |
+
<block
|
15 |
+
type="sizeguide/data"
|
16 |
+
before="product_list"
|
17 |
+
name="sizefilter"
|
18 |
+
template="sizeguide/sizefilter.phtml"/>
|
19 |
+
|
20 |
+
<reference name="left">
|
21 |
+
<action method="append" ifconfig="sizeguide/sizefilter/sizefilter_enabled">
|
22 |
+
<block>sizefilter</block>
|
23 |
+
</action>
|
24 |
+
</reference>
|
25 |
+
|
26 |
+
<reference name="head">
|
27 |
+
<action method="addCss">
|
28 |
+
<stylesheet>easysize/css/easysize.sizefilter.css</stylesheet>
|
29 |
+
</action>
|
30 |
+
</reference>
|
31 |
+
</catalog_category_view>
|
32 |
</layout>
|
app/design/frontend/base/default/template/sizeguide/sizefilter.phtml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if(isset($_REQUEST['easysize_sizefilter_has_products']) && $_REQUEST['easysize_sizefilter_has_products'] == true): ?>
|
2 |
+
<form class="easysize-sizefilter easysize-sizefilter-custom" method="POST">
|
3 |
+
<?php if(isset($_POST['easysize_sizefilter'])): ?>
|
4 |
+
<?php if($_POST['easysize_sizefilter'] == 'disable'): ?>
|
5 |
+
<input type="hidden" name="easysize_sizefilter" value="enable"/>
|
6 |
+
<input type="submit" value="Shop by size"/>
|
7 |
+
<?php else: ?>
|
8 |
+
<input type="hidden" name="easysize_sizefilter" value="disable"/>
|
9 |
+
<input class="easysize-sizefilter-turn-off" type="submit" value="Turn off 'shop by size'"/>
|
10 |
+
<?php endif; ?>
|
11 |
+
<?php else: ?>
|
12 |
+
<?php if($_SESSION['easysize_sizefilter'] != 1): ?>
|
13 |
+
<input type="hidden" name="easysize_sizefilter" value="enable"/>
|
14 |
+
<input type="submit" value="Shop by size"/>
|
15 |
+
<?php else: ?>
|
16 |
+
<input type="hidden" name="easysize_sizefilter" value="disable"/>
|
17 |
+
<input class="easysize-sizefilter-turn-off" type="submit" value="Turn off 'shop by size'"/>
|
18 |
+
<?php endif; ?>
|
19 |
+
<?php endif; ?>
|
20 |
+
</form>
|
21 |
+
<?php endif; ?>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>easysize</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.easysize.me/terms-of-use/">EasySize</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>EasySize sizing solution</summary>
|
10 |
<description>EasySize was founded in October 2014 by Gulnaz Khusainova and is currently based in Copenhagen, Denmark. EasySize’s aim is to improve the online shopping experience for customers and empower retailers to grow their online businesses by using smart technology to accurately understand what a customer’s ideal fit is. To date, EasySize has helped over 400,000 unique users find their ideal fit all over the world. Please visit easysize.me for more information.</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>EasySize IVS</name><user>EasySize</user><email>gk@easysize.me</email></author></authors>
|
13 |
-
<date>2016-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="EasySize"><dir name="SizeGuide"><dir name="Block"><file name="Data.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>easysize</name>
|
4 |
+
<version>1.3.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.easysize.me/terms-of-use/">EasySize</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>EasySize sizing solution</summary>
|
10 |
<description>EasySize was founded in October 2014 by Gulnaz Khusainova and is currently based in Copenhagen, Denmark. EasySize’s aim is to improve the online shopping experience for customers and empower retailers to grow their online businesses by using smart technology to accurately understand what a customer’s ideal fit is. To date, EasySize has helped over 400,000 unique users find their ideal fit all over the world. Please visit easysize.me for more information.</description>
|
11 |
+
<notes>Bugfixes</notes>
|
12 |
<authors><author><name>EasySize IVS</name><user>EasySize</user><email>gk@easysize.me</email></author></authors>
|
13 |
+
<date>2016-08-10</date>
|
14 |
+
<time>07:14:53</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="EasySize"><dir name="SizeGuide"><dir name="Block"><file name="Data.php" hash="7d63c155296507f45dc7c1b64ac98738"/></dir><dir name="Helper"><file name="Data.php" hash="e1f1c548146a5eedc58222620232a758"/></dir><dir name="Model"><file name="Observer.php" hash="4f2c957fb064a7656da69423780d8715"/><dir name="Resource"><file name="Setup.php" hash="db68d16089806da3849ab919e4e35a01"/></dir><file name="ShopAttributes.php" hash="f53c64e27f9a3c7f2b2a11ea74afe01e"/></dir><dir name="etc"><file name="config.xml" hash="3ad377cb124d49565e7fff17482bcf14"/><file name="system.xml" hash="3b9d574c828581df0c306608eb0aeae1"/></dir><dir name="sql"><dir name="sizeguide_setup"><file name="install-1.3.2.php" hash="1eedf0393e809afca2e652cfc051a8b9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="sizeguide"><file name="easysize.phtml" hash="04a9b0118af89064f1ceb527289f1f6d"/><file name="sizefilter.phtml" hash="5a69281f7936b57eb1b363568e7b8a50"/></dir></dir><dir name="layout"><file name="sizeguide.xml" hash="abb47cb6331cc1271de76dd485bc374f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EasySize_SizeGuide.xml" hash="2397289fc71f8ddb23dec37aefdf4779"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="easysize"><dir name="css"><file name="easysize.sizefilter.css" hash="939a9901108e5daa86252cd98d8b9824"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
skin/frontend/base/default/easysize/css/easysize.sizefilter.css
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.easysize-sizefilter {
|
2 |
+
width: 100%;
|
3 |
+
}
|
4 |
+
|
5 |
+
.easysize-sizefilter input {
|
6 |
+
width: 100%;
|
7 |
+
border: 1px solid #6cac46;
|
8 |
+
background: white;
|
9 |
+
outline: none;
|
10 |
+
padding: 10px 15px;
|
11 |
+
}
|
12 |
+
|
13 |
+
.easysize-sizefilter .easysize-sizefilter-turn-off {
|
14 |
+
border: 1px solid #be2c00;
|
15 |
+
background: white;
|
16 |
+
}
|