Version Notes
- Corrected an issue which caused the categories API to fail
Download this release
Release Info
Developer | Christian Apers |
Extension | Highstreet |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- app/code/local/Highstreet/.DS_Store +0 -0
- app/code/local/Highstreet/Hsapi/.DS_Store +0 -0
- app/code/local/Highstreet/Hsapi/Helper/.DS_Store +0 -0
- app/code/local/Highstreet/Hsapi/Helper/Config.php +68 -0
- app/code/local/Highstreet/Hsapi/Model/.DS_Store +0 -0
- app/code/local/Highstreet/Hsapi/Model/Products.php +10 -2
- app/code/local/Highstreet/Hsapi/etc/Configuration.json +1 -3
- app/locale/en_US/Highstreet_Hsapi.csv +4 -0
- app/locale/nl_NL/Highstreet_Hsapi.csv +4 -0
- package.xml +5 -5
app/code/local/Highstreet/.DS_Store
DELETED
Binary file
|
app/code/local/Highstreet/Hsapi/.DS_Store
DELETED
Binary file
|
app/code/local/Highstreet/Hsapi/Helper/.DS_Store
DELETED
Binary file
|
app/code/local/Highstreet/Hsapi/Helper/Config.php
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Highstreet_HSAPI_module
|
4 |
+
*
|
5 |
+
* @package Highstreet_Hsapi
|
6 |
+
* @author Tim Wachter (tim@touchwonders.com) ~ Touchwonders
|
7 |
+
* @copyright Copyright (c) 2013 Touchwonders b.v. (http://www.touchwonders.com/)
|
8 |
+
*/
|
9 |
+
|
10 |
+
class Highstreet_Hsapi_Helper_Config extends Mage_Core_Helper_Abstract
|
11 |
+
{
|
12 |
+
const HAS_COUPON_CODES_ENABLES = "has_coupon_codes_enabled";
|
13 |
+
const FILTERS_CATEGORIES = "filters_categories";
|
14 |
+
const ALWAYS_ADD_SIMPLE_PRODUCTS_TO_CART = "always_add_simple_products_to_cart";
|
15 |
+
const CHECKOUT_URL = "checkout_url";
|
16 |
+
const CHECKOUT_URL_FALLBACK = "checkout/onepage";
|
17 |
+
const HAS_NEW_CHECKOUT = "new_checkout";
|
18 |
+
const SHIPPING_METHODS_TEMPLATE_PATH = "shipping_methods_template_path";
|
19 |
+
const SHIPPING_METHODS_TEMPLATE_PATH_FALLBACK = "highstreet/checkout/checkout/shipping_method/available.phtml";
|
20 |
+
|
21 |
+
|
22 |
+
public function hasCouponCodeEnabled() {
|
23 |
+
$configurations = $this->_getConfigurations();
|
24 |
+
return $configurations[self::HAS_COUPON_CODES_ENABLES];
|
25 |
+
}
|
26 |
+
|
27 |
+
public function filtersCategories() {
|
28 |
+
$configurations = $this->_getConfigurations();
|
29 |
+
return $configurations[self::FILTERS_CATEGORIES];
|
30 |
+
}
|
31 |
+
|
32 |
+
public function alwaysAddSimpleProductsToCart() {
|
33 |
+
$configurations = $this->_getConfigurations();
|
34 |
+
$addSimpleProducts = $configurations[self::ALWAYS_ADD_SIMPLE_PRODUCTS_TO_CART];
|
35 |
+
return ($addSimpleProducts === NULL) ? false : $addSimpleProducts;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function checkoutUrl() {
|
39 |
+
$configurations = $this->_getConfigurations();
|
40 |
+
$checkoutUrl = $configurations[self::CHECKOUT_URL];
|
41 |
+
return ($checkoutUrl === NULL) ? self::CHECKOUT_URL_FALLBACK : $checkoutUrl;
|
42 |
+
}
|
43 |
+
|
44 |
+
public function hasNewCheckout() {
|
45 |
+
$configurations = $this->_getConfigurations();
|
46 |
+
$hasNewCheckout = $configurations[self::HAS_NEW_CHECKOUT];
|
47 |
+
return ($hasNewCheckout === NULL) ? false : $hasNewCheckout;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function shippingMethodsTemplatePath() {
|
51 |
+
$configurations = $this->_getConfigurations();
|
52 |
+
$shippingMethodsTemplatePath = $configurations[self::SHIPPING_METHODS_TEMPLATE_PATH];
|
53 |
+
return ($shippingMethodsTemplatePath === NULL) ? self::SHIPPING_METHODS_TEMPLATE_PATH_FALLBACK : $shippingMethodsTemplatePath;
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Loads the configuration JSON and returns an array of
|
58 |
+
*
|
59 |
+
* @return array Array of the settings
|
60 |
+
*/
|
61 |
+
private function _getConfigurations() {
|
62 |
+
$file = file_get_contents(Mage::getBaseDir('code') . "/local/Highstreet/Hsapi/etc/Configuration.json");
|
63 |
+
return json_decode($file, true);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
|
app/code/local/Highstreet/Hsapi/Model/.DS_Store
DELETED
Binary file
|
app/code/local/Highstreet/Hsapi/Model/Products.php
CHANGED
@@ -373,7 +373,10 @@ class Highstreet_Hsapi_Model_Products extends Mage_Core_Model_Abstract
|
|
373 |
|
374 |
if($product->getTypeId() == 'configurable') {
|
375 |
$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($product);
|
376 |
-
$simple_collection = $conf->getUsedProductCollection()
|
|
|
|
|
|
|
377 |
$products = $simple_collection;
|
378 |
} else if($product->getTypeId() == 'simple'){
|
379 |
$products[] = $product;
|
@@ -649,7 +652,12 @@ class Highstreet_Hsapi_Model_Products extends Mage_Core_Model_Abstract
|
|
649 |
if(!$child_product_attributes)
|
650 |
$child_product_attributes = "entity_id,created_at,description,special_price,updated_at,image,sku,short_description,price,manufacturer";
|
651 |
|
652 |
-
$
|
|
|
|
|
|
|
|
|
|
|
653 |
$configuration = array();
|
654 |
|
655 |
|
373 |
|
374 |
if($product->getTypeId() == 'configurable') {
|
375 |
$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($product);
|
376 |
+
$simple_collection = $conf->getUsedProductCollection()
|
377 |
+
->addFilterByRequiredOptions()
|
378 |
+
->addAttributeToFilter('status', 1); // Only return products that are active
|
379 |
+
|
380 |
$products = $simple_collection;
|
381 |
} else if($product->getTypeId() == 'simple'){
|
382 |
$products[] = $product;
|
652 |
if(!$child_product_attributes)
|
653 |
$child_product_attributes = "entity_id,created_at,description,special_price,updated_at,image,sku,short_description,price,manufacturer";
|
654 |
|
655 |
+
$resProduct = Mage::getModel('catalog/product')->load($simple_product->getId());
|
656 |
+
if ($resProduct->getData('status') == false) {
|
657 |
+
continue;
|
658 |
+
}
|
659 |
+
|
660 |
+
$simpleProductRepresentation = $this->_getProductAttributes($resProduct, $child_product_attributes);
|
661 |
$configuration = array();
|
662 |
|
663 |
|
app/code/local/Highstreet/Hsapi/etc/Configuration.json
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
{
|
2 |
-
"filters_categories": true,
|
3 |
-
}
|
1 |
+
{}
|
|
|
|
app/locale/en_US/Highstreet_Hsapi.csv
CHANGED
@@ -55,6 +55,10 @@
|
|
55 |
"Something went wrong while trying to get your address trough your zip code and house number. Please fill in your street and city manually.", "Er is iets fout gegaan met het ophalen van het adres via postcode en huisnummer. Vul het adres handmatig in."
|
56 |
"Street name is being retrieved", "Street name is being retrieved"
|
57 |
"City name is being retrieved", "City name is being retrieved"
|
|
|
|
|
|
|
|
|
58 |
|
59 |
"hsapi.index.couponTip", "Do you have a coupon code?<br />You can add your code on the<br />'payment' step."
|
60 |
|
55 |
"Something went wrong while trying to get your address trough your zip code and house number. Please fill in your street and city manually.", "Er is iets fout gegaan met het ophalen van het adres via postcode en huisnummer. Vul het adres handmatig in."
|
56 |
"Street name is being retrieved", "Street name is being retrieved"
|
57 |
"City name is being retrieved", "City name is being retrieved"
|
58 |
+
"No addition is known for this housenumber.", "No addition is known for this housenumber."
|
59 |
+
"Housenumber addition unknown.", "Housenumber addition unknown."
|
60 |
+
"Known addition:", "Known addition:"
|
61 |
+
"Known additions:", "Known additions:"
|
62 |
|
63 |
"hsapi.index.couponTip", "Do you have a coupon code?<br />You can add your code on the<br />'payment' step."
|
64 |
|
app/locale/nl_NL/Highstreet_Hsapi.csv
CHANGED
@@ -55,6 +55,10 @@
|
|
55 |
"Something went wrong while trying to get your address trough your zip code and house number. Please fill in your street and city manually.", "Er is iets fout gegaan met het ophalen van het adres via postcode en huisnummer. Vul het adres handmatig in."
|
56 |
"Street name is being retrieved", "Straatnaam wordt opgehaald"
|
57 |
"City name is being retrieved", "Plaatsnaam wordt opgehaald"
|
|
|
|
|
|
|
|
|
58 |
|
59 |
"hsapi.index.couponTip", "Heb je een tegoedbon?<br />Die kun je straks in de stap<br />'betaalwijze' invoeren."
|
60 |
|
55 |
"Something went wrong while trying to get your address trough your zip code and house number. Please fill in your street and city manually.", "Er is iets fout gegaan met het ophalen van het adres via postcode en huisnummer. Vul het adres handmatig in."
|
56 |
"Street name is being retrieved", "Straatnaam wordt opgehaald"
|
57 |
"City name is being retrieved", "Plaatsnaam wordt opgehaald"
|
58 |
+
"No addition is known for this housenumber.", "Geen toevoeging bekend voor dit huisnummer."
|
59 |
+
"Housenumber addition unknown.", "Huisnummer toevoeging onbekend."
|
60 |
+
"Known addition:", "Bekende toevoeging:"
|
61 |
+
"Known additions:", "Bekende toevoegingen:"
|
62 |
|
63 |
"hsapi.index.couponTip", "Heb je een tegoedbon?<br />Die kun je straks in de stap<br />'betaalwijze' invoeren."
|
64 |
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Highstreet</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>-</license>
|
7 |
<channel>community</channel>
|
@@ -9,11 +9,11 @@
|
|
9 |
<summary>Highstreet Magento Extension. This extension allows the Highstreet iPad app to connect to the store. </summary>
|
10 |
<description>The extension provides read-only access to the catalog (products and categories) by providing a simple API for the app. 
|
11 |
This extension does not modify or affect the Magento installation, nor does it change any catalog data.</description>
|
12 |
-
<notes>-
|
13 |
<authors><author><name>Christian Apers</name><user>Christian</user><email>Christian@Touchwonders.com</email></author><author><name>Tim Wachter</name><user>Tim</user><email>Tim@Touchwonders.com</email></author></authors>
|
14 |
-
<date>2014-08-
|
15 |
-
<time>
|
16 |
-
<contents><target name="magecommunity"><dir name="Technooze"><dir name="Timage"><dir name="Block"><file name="Data.php" hash="02f8402df49abe64716e01746055330e"/></dir><dir name="Helper"><file name="Data.php" hash="4ade060d79bd29a91a524fce9e61e49b"/><file name="Data.php" hash="4ade060d79bd29a91a524fce9e61e49b"/></dir><dir name="etc"><file name="config.xml" hash="ff5675c31f16c03674ae87f19964a59d"/><file name="config.xml" hash="ff5675c31f16c03674ae87f19964a59d"/></dir></dir></dir></target><target name="magelocal"><dir name="Highstreet"><dir name="Hsapi"><dir name="Helper"><file name="
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.0.0.0</min><max>6.0.0.0</max></php><extension><name>gd</name><min>2.0</min><max>3.0</max></extension></required></dependencies>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Highstreet</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>-</license>
|
7 |
<channel>community</channel>
|
9 |
<summary>Highstreet Magento Extension. This extension allows the Highstreet iPad app to connect to the store. </summary>
|
10 |
<description>The extension provides read-only access to the catalog (products and categories) by providing a simple API for the app. 
|
11 |
This extension does not modify or affect the Magento installation, nor does it change any catalog data.</description>
|
12 |
+
<notes>- Corrected an issue which caused the categories API to fail</notes>
|
13 |
<authors><author><name>Christian Apers</name><user>Christian</user><email>Christian@Touchwonders.com</email></author><author><name>Tim Wachter</name><user>Tim</user><email>Tim@Touchwonders.com</email></author></authors>
|
14 |
+
<date>2014-08-13</date>
|
15 |
+
<time>07:40:08</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Technooze"><dir name="Timage"><dir name="Block"><file name="Data.php" hash="02f8402df49abe64716e01746055330e"/></dir><dir name="Helper"><file name="Data.php" hash="4ade060d79bd29a91a524fce9e61e49b"/><file name="Data.php" hash="4ade060d79bd29a91a524fce9e61e49b"/></dir><dir name="etc"><file name="config.xml" hash="ff5675c31f16c03674ae87f19964a59d"/><file name="config.xml" hash="ff5675c31f16c03674ae87f19964a59d"/></dir></dir></dir></target><target name="magelocal"><dir name="Highstreet"><dir name="Hsapi"><dir name="Helper"><file name="Config.php" hash="2ec387f4de4f0869ffb73667db9cbab0"/><file name="Data.php" hash="94ba070797ec9925a331969b012be7f6"/></dir><dir name="Model"><file name="Attributes.php" hash="6ad75fe439bfc6993ff741b2ae452150"/><file name="Categories.php" hash="79c3135fe7d99bf8f2cc1776bf792cb0"/><file name="Checkout.php" hash="b6c4606464818bf9cb4cceb766105c2e"/><file name="Images.php" hash="32d65360440199910c05b1e087c1cee2"/><file name="Observer.php" hash="3797806da488c928c0cbc543ce98763c"/><file name="Products.php" hash="1255dcbc9a9cb6e968c69e8cec48f246"/><file name="SearchSuggestions.php" hash="17e0a008e2f90c0f5f6c5f7c3f010c9c"/></dir><dir name="controllers"><file name="IndexController.php" hash="79797b7b4fbc842a4c63dfaef03ac7f0"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="etc"><file name="Configuration.json" hash="99914b932bd37a50b983c5e7c90ae93b"/><file name="config.xml" hash="b4f33b6ea6e8f24e7bacd85a48763cd4"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Highstreet_Api.xml" hash="97e586a7ef0a274d4f0fda883c646f31"/><file name="Technooze_Timage.xml" hash="bec7a12e3028d25b3a28c6eafe1878b4"/><file name="Highstreet_SmartAppBanner.xml" hash=""/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Highstreet_Hsapi.csv" hash="0246609251f607c5f4119ba56db14c6e"/></dir><dir name="nl_NL"><file name="Highstreet_Hsapi.csv" hash="a2f582408d85509c3de30d26f090fa9a"/></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.0.0.0</min><max>6.0.0.0</max></php><extension><name>gd</name><min>2.0</min><max>3.0</max></extension></required></dependencies>
|
19 |
</package>
|