From 6d88e5e1846713f579f79905dc3ed35112772ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Gr=C3=A4tsch?= Date: Fri, 27 Apr 2012 00:50:06 +0300 Subject: [PATCH 01/41] Added columns group_price and base_group_price to column-list to fix the price indexing error in Magento 1.7.x --- .../Eav/Mysql4/Product/Indexer/Price/Configurable.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php index ca2ef96..5405873 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php @@ -84,6 +84,8 @@ protected function _prepareFinalPriceData($entityIds = null) 'max_price' => new Zend_Db_Expr('pi.final_price'), 'tier_price' => new Zend_Db_Expr('pi.tier_price'), 'base_tier' => new Zend_Db_Expr('pi.tier_price'), + 'group_price' => new Zend_Db_Expr('pi.group_price'), + 'base_group_price' => new Zend_Db_Expr('pi.base_group_price'), )); @@ -126,6 +128,8 @@ protected function _prepareFinalPriceData($entityIds = null) 'max_price' => new Zend_Db_Expr('MAX(inner.max_price)'), 'tier_price', 'base_tier', + 'group_price', + 'base_group_price', #'child_entity_id' )); From 92250c4d332c6647e174d4ecffe0219b8043dec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Gr=C3=A4tsch?= Date: Fri, 27 Apr 2012 12:43:18 +0300 Subject: [PATCH 02/41] Fixed "Unknown column 'pi.base_group_price' in 'field list'" - should be pi.group_price --- .../Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php index 5405873..279a3fa 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php @@ -85,7 +85,7 @@ protected function _prepareFinalPriceData($entityIds = null) 'tier_price' => new Zend_Db_Expr('pi.tier_price'), 'base_tier' => new Zend_Db_Expr('pi.tier_price'), 'group_price' => new Zend_Db_Expr('pi.group_price'), - 'base_group_price' => new Zend_Db_Expr('pi.base_group_price'), + 'base_group_price' => new Zend_Db_Expr('pi.group_price'), )); From 87425921e6bca32de2c3ff257dc158075c622a75 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 18 May 2012 09:39:05 +0930 Subject: [PATCH 03/41] adding modman distribution filewq --- modman | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 modman diff --git a/modman b/modman new file mode 100644 index 0000000..06d67f5 --- /dev/null +++ b/modman @@ -0,0 +1,10 @@ +app/code/community/OrganicInternet app/code/community/OrganicInternet +app/design/frontend/base/default/layout/simpleconfigurableproducts.xml app/design/frontend/base/default/layout/simpleconfigurableproducts.xml +app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml +app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml +app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml +app/design/frontend/base/default/template/page/scpcontentonly.phtml app/design/frontend/base/default/template/page/scpcontentonly.phtml +app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml +app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml +skin/frontend/base/default/images/scp-ajax-loader.gif skin/frontend/base/default/images/scp-ajax-loader.gif +skin/frontend/base/default/js/scp_product_extension.js skin/frontend/base/default/js/scp_product_extension.js From 07f5c015c0ebcf4d17de56457914bb943e8497e6 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 18 May 2012 09:48:26 +0930 Subject: [PATCH 04/41] fix for 1.7/1.12 compatibility re https://github.com/organicinternet/magento-configurable-simple/pull/85 --- .../Eav/Mysql4/Product/Indexer/Price/Configurable.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php index ca2ef96..279a3fa 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php @@ -84,6 +84,8 @@ protected function _prepareFinalPriceData($entityIds = null) 'max_price' => new Zend_Db_Expr('pi.final_price'), 'tier_price' => new Zend_Db_Expr('pi.tier_price'), 'base_tier' => new Zend_Db_Expr('pi.tier_price'), + 'group_price' => new Zend_Db_Expr('pi.group_price'), + 'base_group_price' => new Zend_Db_Expr('pi.group_price'), )); @@ -126,6 +128,8 @@ protected function _prepareFinalPriceData($entityIds = null) 'max_price' => new Zend_Db_Expr('MAX(inner.max_price)'), 'tier_price', 'base_tier', + 'group_price', + 'base_group_price', #'child_entity_id' )); From 5b62204a37ddedbeac6fd41cc39a796195810a91 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 18 May 2012 09:48:26 +0930 Subject: [PATCH 05/41] fix for 1.7/1.12 compatibility re https://github.com/organicinternet/magento-configurable-simple/pull/85 --- .../Eav/Mysql4/Product/Indexer/Price/Configurable.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php index ca2ef96..279a3fa 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php @@ -84,6 +84,8 @@ protected function _prepareFinalPriceData($entityIds = null) 'max_price' => new Zend_Db_Expr('pi.final_price'), 'tier_price' => new Zend_Db_Expr('pi.tier_price'), 'base_tier' => new Zend_Db_Expr('pi.tier_price'), + 'group_price' => new Zend_Db_Expr('pi.group_price'), + 'base_group_price' => new Zend_Db_Expr('pi.group_price'), )); @@ -126,6 +128,8 @@ protected function _prepareFinalPriceData($entityIds = null) 'max_price' => new Zend_Db_Expr('MAX(inner.max_price)'), 'tier_price', 'base_tier', + 'group_price', + 'base_group_price', #'child_entity_id' )); From bba22abd43dd9099d38dcba42f7b01ba77b1157c Mon Sep 17 00:00:00 2001 From: David Ward Date: Fri, 18 May 2012 20:20:37 -0400 Subject: [PATCH 06/41] Resync product stock index resource class override with changes made in 1.7/1.12 and move to same location as in 1.7/1.12 --- .../Indexer/Stock/Configurable.php | 40 ++++++++++++------- .../SimpleConfigurableProducts/etc/config.xml | 10 ++--- 2 files changed, 31 insertions(+), 19 deletions(-) rename app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/{Mysql4 => Resource}/Indexer/Stock/Configurable.php (67%) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php similarity index 67% rename from app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php rename to app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php index 200379a..888b4b3 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php @@ -1,11 +1,24 @@ _getWriteAdapter(); @@ -39,20 +52,20 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f ->where('e.type_id = ?', $this->getTypeId()) ->group(array('e.entity_id', 'cw.website_id', 'cis.stock_id')); - $this->_addProductWebsiteJoinToSelect($select, 'cw.website_id', 'le.entity_id'); #may need to use le.entity_id? + $this->_addProductWebsiteJoinToSelect($select, 'cw.website_id', 'le.entity_id'); $psExpr = $this->_addAttributeToSelect($select, 'status', 'le.entity_id', 'cs.store_id'); $psCond = $adapter->quoteInto($psExpr . '=?', Mage_Catalog_Model_Product_Status::STATUS_ENABLED); if ($this->_isManageStock()) { - $statusExpr = new Zend_Db_Expr('IF(cisi.use_config_manage_stock = 0 AND cisi.manage_stock = 0,' - . ' 1, cisi.is_in_stock)'); + $statusExpr = $adapter->getCheckSql('cisi.use_config_manage_stock = 0 AND cisi.manage_stock = 0', + 1, 'cisi.is_in_stock'); } else { - $statusExpr = new Zend_Db_Expr('IF(cisi.use_config_manage_stock = 0 AND cisi.manage_stock = 1,' - . 'cisi.is_in_stock, 1)'); + $statusExpr = $adapter->getCheckSql('cisi.use_config_manage_stock = 0 AND cisi.manage_stock = 1', + 'cisi.is_in_stock', 1); } - $stockStatusExpr = new Zend_Db_Expr("MAX(LEAST(IF({$psCond}, 1, 0), {$statusExpr}))"); + $stockStatusExpr = new Zend_Db_Expr("MAX(LEAST(IF({$psCond}, 1, 0), {$statusExpr}))"); $select->columns(array( 'status' => $stockStatusExpr @@ -60,8 +73,7 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f if (!is_null($entityIds)) { $select->where('e.entity_id IN(?)', $entityIds); - } - + } return $select; } } diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml index 1e692c1..1a81dca 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml @@ -39,11 +39,11 @@ OrganicInternet_SimpleConfigurableProducts_CatalogIndex_Model_Data_Configurable - - - OrganicInternet_SimpleConfigurableProducts_CatalogInventory_Model_Mysql4_Indexer_Stock_Configurable - - + + + OrganicInternet_SimpleConfigurableProducts_CatalogInventory_Model_Resource_Indexer_Stock_Configurable + + OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Collection From 44855a7b75046bad256c6fdd14e16a9384160da8 Mon Sep 17 00:00:00 2001 From: mediarox Date: Sun, 20 May 2012 16:05:02 +0300 Subject: [PATCH 07/41] Prevent javascript errors if the original select element in catalog/product/view/type/options/configurable.phtml has the attribute "size". --- .../base/default/js/scp_product_extension.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/skin/frontend/base/default/js/scp_product_extension.js b/skin/frontend/base/default/js/scp_product_extension.js index 7e72154..53c4234 100644 --- a/skin/frontend/base/default/js/scp_product_extension.js +++ b/skin/frontend/base/default/js/scp_product_extension.js @@ -385,11 +385,13 @@ Product.Config.prototype.configureElement = function(element) { Product.Config.prototype.reloadOptionLabels = function(element){ var selectedPrice; var childProducts = this.config.childProducts; - - //Don't update elements that have a selected option - if(element.options[element.selectedIndex].config){ - return; - } + + try { + //Don't update elements that have a selected option + if(element.options[element.selectedIndex].config){ + return; + } + } catch(e){} for(var i=0;i Date: Sun, 20 May 2012 22:42:55 -0400 Subject: [PATCH 08/41] Fix bug with group price on cofigurable product in the price index, update overriden code to reflect changes made in parent 1.7/1.12 code --- .../Eav/Mysql4/Product/Collection.php | 40 ---------- .../Model/Resource/Product/Collection.php | 53 +++++++++++++ .../Mysql4 => }/Product/Indexer/Price.php | 74 +++++++++---------- .../SimpleConfigurableProducts/etc/config.xml | 14 ++-- 4 files changed, 96 insertions(+), 85 deletions(-) delete mode 100644 app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php create mode 100644 app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Collection.php rename app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/{Eav/Mysql4 => }/Product/Indexer/Price.php (56%) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php deleted file mode 100644 index 8f85575..0000000 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Collection.php +++ /dev/null @@ -1,40 +0,0 @@ -_productLimitationFilters; - if (empty($filters['use_price_index'])) { - return $this; - } - - $connection = $this->getConnection(); - - $joinCond = $joinCond = join(' AND ', array( - 'price_index.entity_id = e.entity_id', - $connection->quoteInto('price_index.website_id = ?', $filters['website_id']), - $connection->quoteInto('price_index.customer_group_id = ?', $filters['customer_group_id']) - )); - - $fromPart = $this->getSelect()->getPart(Zend_Db_Select::FROM); - if (!isset($fromPart['price_index'])) { - $minimalExpr = new Zend_Db_Expr( - 'IF(`price_index`.`tier_price`, LEAST(`price_index`.`min_price`, `price_index`.`tier_price`), `price_index`.`min_price`)' - ); - $indexedExpr = new Zend_Db_Expr('price_index.price'); - $this->getSelect()->join( - array('price_index' => $this->getTable('catalog/product_index_price')), - $joinCond, - array('indexed_price'=>$indexedExpr,'price', 'final_price', 'minimal_price'=>$minimalExpr , 'min_price', 'max_price', 'tier_price')); - - } else { - $fromPart['price_index']['joinCondition'] = $joinCond; - $this->getSelect()->setPart(Zend_Db_Select::FROM, $fromPart); - } - - return $this; - } -} diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Collection.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Collection.php new file mode 100644 index 0000000..8fbc382 --- /dev/null +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Collection.php @@ -0,0 +1,53 @@ +addPriceData(); + * + * @see Mage_Catalog_Model_Resource_Product_Collection::_productLimitationJoinPrice() + */ + protected function _productLimitationJoinPrice() + { + $filters = $this->_productLimitationFilters; + if (empty($filters['use_price_index'])) { + return $this; + } + + $helper = Mage::getResourceHelper('core'); + $connection = $this->getConnection(); + $select = $this->getSelect(); + $joinCond = join(' AND ', array( + 'price_index.entity_id = e.entity_id', + $connection->quoteInto('price_index.website_id = ?', $filters['website_id']), + $connection->quoteInto('price_index.customer_group_id = ?', $filters['customer_group_id']) + )); + + $fromPart = $select->getPart(Zend_Db_Select::FROM); + if (!isset($fromPart['price_index'])) { + $least = $connection->getLeastSql(array('price_index.min_price', 'price_index.tier_price')); + $minimalExpr = $connection->getCheckSql('price_index.tier_price IS NOT NULL', + $least, 'price_index.min_price'); + $indexedExpr = new Zend_Db_Expr('price_index.price'); + $colls = array('indexed_price'=>$indexedExpr,'price', 'tax_class_id', 'final_price', + 'minimal_price'=>$minimalExpr , 'min_price', 'max_price', 'tier_price'); + $tableName = array('price_index' => $this->getTable('catalog/product_index_price')); + $select->join($tableName, $joinCond, $colls); + + // Set additional field filters + foreach ($this->_priceDataFieldFilters as $filterData) { + $select->where(call_user_func_array('sprintf', $filterData)); + } + + } else { + $fromPart['price_index']['joinCondition'] = $joinCond; + $select->setPart(Zend_Db_Select::FROM, $fromPart); + } + //Clean duplicated fields + $helper->prepareColumnsList($select); + + return $this; + } +} \ No newline at end of file diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Indexer/Price.php similarity index 56% rename from app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php rename to app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Indexer/Price.php index 21eda98..2d24d50 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Indexer/Price.php @@ -1,17 +1,20 @@ child_product type_id + */ private function getChildIdsByParent($parentId) { $read = $this->_getReadAdapter(); $select = $read->select() - #->from(array('pr' => $this->getTable('catalog/product_relation')), array('child_id')) ->from(array('p' => $this->getTable('catalog/product')), array('entity_id')) ->join( - #array('p' => $this->getTable('catalog/product')), array('pr' => $this->getTable('catalog/product_relation')), 'pr.child_id=p.entity_id', array('p.type_id')) @@ -19,6 +22,15 @@ private function getChildIdsByParent($parentId) return $read->fetchPairs($select); } + /** + * Get product type from product id + * + * catalog_product_entity has the product type. Not exactly sure why + * we're using a join here, but it works. + * + * @param integer $id + * @return string Product type + */ private function getProductTypeById($id) { $read = $this->_getReadAdapter(); @@ -30,20 +42,21 @@ private function getProductTypeById($id) array('p.type_id')) ->where('pr.parent_id=?', $id); $data = $read->fetchRow($select); - #Mage::log("SCP: getProductTypeById: result is: " . print_r($data, true)); return $data['type_id']; } - #This is modified to pull in all sibling associated products' tier prices. - #Without this, indexed price updates only consider the tier prices of the specific - #associated product that's being saved, and it's parent - #This will often result in a non-lowest tier price being displayed, or no tier price being - #displayed when there is one (on a sibling) - #It's also updated to reindex child tier prices when a parent is saved - - #Surely it's not just tier prices but all related prices this acts on? - #does copyRelationIndexData followed by reindexEntity do this itself? (just not for tier prices?) + /** + * Modified to pull in all sibling associated products' tier prices and + * to reindex child tier prices when a parent is saved. + * + * Process product save. + * Method is responsible for index support + * when product was saved and changed attribute(s) has an effect on price. + * + * @param Mage_Index_Model_Event $event + * @return Mage_Catalog_Model_Resource_Product_Indexer_Price + */ public function catalogProductSave(Mage_Index_Model_Event $event) { $productId = $event->getEntityPk(); @@ -55,55 +68,40 @@ public function catalogProductSave(Mage_Index_Model_Event $event) if (!isset($data['reindex_price'])) { return $this; } - $this->cloneIndexTable(true); + + $this->clearTemporaryIndexTable(); $this->_prepareWebsiteDateTable(); $indexer = $this->_getIndexer($data['product_type_id']); $processIds = array($productId); - if ($indexer->getIsComposite()) { - #Mage::log("catalogProductSave: " . "saving composite"); if ($this->getProductTypeById($productId) == 'configurable') { - #Mage::log("catalogProductSave: " . "saving composite - is configurable"); $children = $this->getChildIdsByParent($productId); $processIds = array_merge($processIds, array_keys($children)); - #Ignore tier price data for actual configurable product + //Ignore tier and group price data for actual configurable product $tierPriceIds = array_keys($children); } else { $tierPriceIds = $productId; } - #Mage::log("catalogProductSave: " . "copyRelationIndexData for: " . $productId); $this->_copyRelationIndexData($productId); - #Mage::log("catalogProductSave: " . "_prepareTierPriceIndex for: " . print_r($tierPriceIds, true)); $this->_prepareTierPriceIndex($tierPriceIds); - #Mage::log("catalogProductSave: " . "reindexEntity for: " . $productId); + $this->_prepareGroupPriceIndex($tierPriceIds); $indexer->reindexEntity($productId); } else { - #Mage::log("catalogProductSave: " . "saving non-composite"); $parentIds = $this->getProductParentsByChild($productId); - if ($parentIds) { - #Mage::log("catalogProductSave: " . "non-composite product: " . $productId . " has parents: " . print_r($parentIds, true)); - - #Prepare to process parents too $processIds = array_merge($processIds, array_keys($parentIds)); - $siblingIds = array(); foreach (array_keys($parentIds) as $parentId) { $childIds = $this->getChildIdsByParent($parentId); - #Mage::log("catalogProductSave: For parent_id: $parentId, adding childIds of: " . print_r($childIds, true)); $siblingIds = array_merge($siblingIds, array_keys($childIds)); } - #Mage::log("catalogProductSave: siblingIds are: " . print_r($siblingIds, true)); if(count($siblingIds)>0) { $processIds = array_unique(array_merge($processIds, $siblingIds)); } - #Mage::log("catalogProductSave: " . "copyRelationIndexData for: " . print_r(array_keys($parentIds), true) . "ignoring relation: " . $productId); $this->_copyRelationIndexData(array_keys($parentIds), $productId); - - #Mage::log("catalogProductSave: " . "_prepareTierPriceIndex for: " . print_r($processIds, true)); $this->_prepareTierPriceIndex($processIds); - #Mage::log("catalogProductSave: " . "reindexEntity for: " . $productId); + $this->_prepareGroupPriceIndex($processIds); $indexer->reindexEntity($productId); $parentByType = array(); @@ -112,13 +110,11 @@ public function catalogProductSave(Mage_Index_Model_Event $event) } foreach ($parentByType as $parentType => $entityIds) { - #Mage::log("catalogProductSave: " . "reindexEntity using indexer of type: " . $parentType . " for: " . print_r($entityIds, true)); $this->_getIndexer($parentType)->reindexEntity($entityIds); } - } else { - #Mage::log("catalogProductSave: " . "non-composite product: " . $productId . " has no parents"); $this->_prepareTierPriceIndex($productId); + $this->_prepareGroupPriceIndex($productId); $indexer->reindexEntity($productId); } } diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml index 1a81dca..5fc9e12 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml @@ -34,6 +34,14 @@ OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Product + + + OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Product_Indexer_Price + + + OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Product_Collection + + OrganicInternet_SimpleConfigurableProducts_CatalogIndex_Model_Data_Configurable @@ -45,12 +53,6 @@ - - OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Collection - - - OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price_Configurable - OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price From af333e20d62cc8f959eac6d1031ba963b25a4ce0 Mon Sep 17 00:00:00 2001 From: David Ward Date: Fri, 18 May 2012 20:20:37 -0400 Subject: [PATCH 09/41] Resync product stock index resource class override with changes made in 1.7/1.12 and move to same location as in 1.7/1.12 --- .../Indexer/Stock/Configurable.php | 40 ++++++++++++------- .../SimpleConfigurableProducts/etc/config.xml | 10 ++--- 2 files changed, 31 insertions(+), 19 deletions(-) rename app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/{Mysql4 => Resource}/Indexer/Stock/Configurable.php (67%) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php similarity index 67% rename from app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php rename to app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php index 200379a..888b4b3 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Mysql4/Indexer/Stock/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php @@ -1,11 +1,24 @@ _getWriteAdapter(); @@ -39,20 +52,20 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f ->where('e.type_id = ?', $this->getTypeId()) ->group(array('e.entity_id', 'cw.website_id', 'cis.stock_id')); - $this->_addProductWebsiteJoinToSelect($select, 'cw.website_id', 'le.entity_id'); #may need to use le.entity_id? + $this->_addProductWebsiteJoinToSelect($select, 'cw.website_id', 'le.entity_id'); $psExpr = $this->_addAttributeToSelect($select, 'status', 'le.entity_id', 'cs.store_id'); $psCond = $adapter->quoteInto($psExpr . '=?', Mage_Catalog_Model_Product_Status::STATUS_ENABLED); if ($this->_isManageStock()) { - $statusExpr = new Zend_Db_Expr('IF(cisi.use_config_manage_stock = 0 AND cisi.manage_stock = 0,' - . ' 1, cisi.is_in_stock)'); + $statusExpr = $adapter->getCheckSql('cisi.use_config_manage_stock = 0 AND cisi.manage_stock = 0', + 1, 'cisi.is_in_stock'); } else { - $statusExpr = new Zend_Db_Expr('IF(cisi.use_config_manage_stock = 0 AND cisi.manage_stock = 1,' - . 'cisi.is_in_stock, 1)'); + $statusExpr = $adapter->getCheckSql('cisi.use_config_manage_stock = 0 AND cisi.manage_stock = 1', + 'cisi.is_in_stock', 1); } - $stockStatusExpr = new Zend_Db_Expr("MAX(LEAST(IF({$psCond}, 1, 0), {$statusExpr}))"); + $stockStatusExpr = new Zend_Db_Expr("MAX(LEAST(IF({$psCond}, 1, 0), {$statusExpr}))"); $select->columns(array( 'status' => $stockStatusExpr @@ -60,8 +73,7 @@ protected function _getStockStatusSelect($entityIds = null, $usePrimaryTable = f if (!is_null($entityIds)) { $select->where('e.entity_id IN(?)', $entityIds); - } - + } return $select; } } diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml index 1e692c1..1a81dca 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml @@ -39,11 +39,11 @@ OrganicInternet_SimpleConfigurableProducts_CatalogIndex_Model_Data_Configurable - - - OrganicInternet_SimpleConfigurableProducts_CatalogInventory_Model_Mysql4_Indexer_Stock_Configurable - - + + + OrganicInternet_SimpleConfigurableProducts_CatalogInventory_Model_Resource_Indexer_Stock_Configurable + + OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Collection From 1700da28fa289e06d0d80ac2b1f0caea2e6d2ed6 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 22 Jun 2012 09:38:00 +0930 Subject: [PATCH 10/41] applying 44855a7b75046bad256c6fdd14e16a9384160da8 from github.com/mediarox/magento-configurable-simple.git --- .../base/default/js/scp_product_extension.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/skin/frontend/base/default/js/scp_product_extension.js b/skin/frontend/base/default/js/scp_product_extension.js index 7e72154..53c4234 100644 --- a/skin/frontend/base/default/js/scp_product_extension.js +++ b/skin/frontend/base/default/js/scp_product_extension.js @@ -385,11 +385,13 @@ Product.Config.prototype.configureElement = function(element) { Product.Config.prototype.reloadOptionLabels = function(element){ var selectedPrice; var childProducts = this.config.childProducts; - - //Don't update elements that have a selected option - if(element.options[element.selectedIndex].config){ - return; - } + + try { + //Don't update elements that have a selected option + if(element.options[element.selectedIndex].config){ + return; + } + } catch(e){} for(var i=0;i Date: Thu, 12 Jul 2012 17:43:30 +0200 Subject: [PATCH 11/41] Sync product resource and price indexing with Magento CE 1.7 --- .../Model/Resource/Product/Collection.php | 13 ++++++++----- .../Product/Indexer/Price/Configurable.php | 19 ++++++++++++++++++- .../SimpleConfigurableProducts/etc/config.xml | 8 ++++---- 3 files changed, 30 insertions(+), 10 deletions(-) rename app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/{Eav/Mysql4 => }/Product/Indexer/Price/Configurable.php (88%) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Collection.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Collection.php index 8fbc382..bbf6a28 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Collection.php @@ -9,7 +9,7 @@ class OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Product_ * * @see Mage_Catalog_Model_Resource_Product_Collection::_productLimitationJoinPrice() */ - protected function _productLimitationJoinPrice() + protected function _productLimitationPrice($joinLeft = false) { $filters = $this->_productLimitationFilters; if (empty($filters['use_price_index'])) { @@ -18,7 +18,7 @@ protected function _productLimitationJoinPrice() $helper = Mage::getResourceHelper('core'); $connection = $this->getConnection(); - $select = $this->getSelect(); + $select = $this->getSelect(); $joinCond = join(' AND ', array( 'price_index.entity_id = e.entity_id', $connection->quoteInto('price_index.website_id = ?', $filters['website_id']), @@ -34,8 +34,11 @@ protected function _productLimitationJoinPrice() $colls = array('indexed_price'=>$indexedExpr,'price', 'tax_class_id', 'final_price', 'minimal_price'=>$minimalExpr , 'min_price', 'max_price', 'tier_price'); $tableName = array('price_index' => $this->getTable('catalog/product_index_price')); - $select->join($tableName, $joinCond, $colls); - + if ($joinLeft) { + $select->joinLeft($tableName, $joinCond, $colls); + } else { + $select->join($tableName, $joinCond, $colls); + } // Set additional field filters foreach ($this->_priceDataFieldFilters as $filterData) { $select->where(call_user_func_array('sprintf', $filterData)); @@ -50,4 +53,4 @@ protected function _productLimitationJoinPrice() return $this; } -} \ No newline at end of file +} diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php similarity index 88% rename from app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php rename to app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php index 279a3fa..235fedd 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php @@ -1,5 +1,5 @@ __toString()); #Mage::log("SCP Price outer query: " . $outerSelect->__toString()); + /** + * Add possibility modify prices from external events + */ + $select = $write->select() + ->join(array('wd' => $this->_getWebsiteDateTable()), + 'i.website_id = wd.website_id', + array()); + Mage::dispatchEvent('prepare_catalog_product_price_index_table', array( + 'index_table' => array('i' => $this->_getDefaultFinalPriceTable()), + 'select' => $select, + 'entity_id' => 'i.entity_id', + 'customer_group_id' => 'i.customer_group_id', + 'website_id' => 'i.website_id', + 'website_date' => 'wd.website_date', + 'update_fields' => array('price', 'min_price', 'max_price') + )); + return $this; } } diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml index 5fc9e12..3d64ee3 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml @@ -36,7 +36,7 @@ - OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Product_Indexer_Price + OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Product_Indexer_Price_Configurable OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Product_Collection @@ -52,11 +52,11 @@ OrganicInternet_SimpleConfigurableProducts_CatalogInventory_Model_Resource_Indexer_Stock_Configurable - + - OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price + OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Resource_Product_Indexer_Price - + From c01bb3008397de5452e4b5598ff738ce85981121 Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Tue, 17 Jul 2012 17:19:04 +0200 Subject: [PATCH 12/41] Js for reloadPrice doesn't get correct price for text options --- .../base/default/template/catalog/product/view/scpoptions.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml b/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml index c3571bd..f5d5cc7 100644 --- a/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml +++ b/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml @@ -121,7 +121,7 @@ if (count($_options) || $this->getProduct()->isConfigurable()): } } else { if (element.getValue().strip() != '') { - price += parseFloat(this.config[optionId]); + price += parseFloat(this.config[optionId].price); } } } From eddf35ab3ddca227d065a3d789705adf4a3ef825 Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Wed, 18 Jul 2012 16:38:49 +0200 Subject: [PATCH 13/41] Switch CatalogRule to Magento 1.7's way of doing resource classes --- .../CatalogRule/Model/{Mysql4 => Resource}/Rule.php | 4 ++-- .../SimpleConfigurableProducts/etc/config.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/{Mysql4 => Resource}/Rule.php (98%) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Mysql4/Rule.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Resource/Rule.php similarity index 98% rename from app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Mysql4/Rule.php rename to app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Resource/Rule.php index 8935ef4..6e6663f 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Mysql4/Rule.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Resource/Rule.php @@ -5,8 +5,8 @@ #My fix is: only delete pricerule price entries for the rule that fails to validate #It's an odd bug - and maybe there's a good reason, but it's making my rules disappear when I save products, which is pretty annoying -class OrganicInternet_SimpleConfigurableProducts_CatalogRule_Model_Mysql4_Rule extends - Mage_CatalogRule_Model_Mysql4_Rule +class OrganicInternet_SimpleConfigurableProducts_CatalogRule_Model_Resource_Rule extends + Mage_CatalogRule_Model_Resource_Rule { public function applyToProduct($rule, $product, $websiteIds) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml index 3d64ee3..4f53515 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml @@ -12,11 +12,11 @@ - + - OrganicInternet_SimpleConfigurableProducts_CatalogRule_Model_Mysql4_Rule + OrganicInternet_SimpleConfigurableProducts_CatalogRule_Model_Resource_Rule - + OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Product_Type_Configurable_Price From 46bee60b54c1aa143eba0532e89bf251fae2ee0a Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Thu, 19 Jul 2012 16:59:42 +0200 Subject: [PATCH 14/41] remove unneeded logging --- .../Catalog/Model/Product/Type/Simple.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php index fed7bef..7b4a08b 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php @@ -35,7 +35,7 @@ public function prepareForCart(Varien_Object $buyRequest, $product = null) public function hasConfigurableProductParentId() { $cpid = $this->getCpid(); - Mage::log("cpid: ". $cpid); + //Mage::log("cpid: ". $cpid); return !empty($cpid); } From fe0c1f53e0e9b509941178165fa26d760482afdd Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Mon, 23 Jul 2012 17:46:33 +0200 Subject: [PATCH 15/41] Strart to add French localization --- .../SimpleConfigurableProducts/etc/config.xml | 18 ++++++++++++++++++ ...anicInternet_SimpleConfigurableProducts.csv | 1 + ...anicInternet_SimpleConfigurableProducts.csv | 1 + 3 files changed, 20 insertions(+) create mode 100644 app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv create mode 100644 app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml index 4f53515..eff6ca8 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml @@ -119,6 +119,15 @@ + + + + + OrganicInternet_SimpleConfigurableProducts.csv + + + + @@ -140,5 +149,14 @@ + + + + + OrganicInternet_SimpleConfigurableProducts.csv + + + + diff --git a/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv b/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv new file mode 100644 index 0000000..dc26147 --- /dev/null +++ b/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv @@ -0,0 +1 @@ +"Price From:","Price From:" diff --git a/app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv b/app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv new file mode 100644 index 0000000..09a1f17 --- /dev/null +++ b/app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv @@ -0,0 +1 @@ +"Price From:","À partir de:" From 36c074492d0bce8019c3da4777224bd1f6434dbb Mon Sep 17 00:00:00 2001 From: dmtw Date: Tue, 24 Jul 2012 10:57:08 +0300 Subject: [PATCH 16/41] fix price resetting to zero when custom option checkbox is clicked --- .../default/template/catalog/product/view/scpoptions.phtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml b/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml index f5d5cc7..8513d8d 100644 --- a/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml +++ b/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml @@ -95,7 +95,11 @@ if (count($_options) || $this->getProduct()->isConfigurable()): if (element.type == 'checkbox' || element.type == 'radio') { if (element.checked) { if (config[optionId][element.getValue()]) { - price += parseFloat(config[optionId][element.getValue()]); + /* begin DMTW */ + /* fix price resetting to zero when custom option checkbox is clicked */ + // price += parseFloat(config[optionId][element.getValue()]); + price += parseFloat(config[optionId][element.getValue()].price); + /* end DMTW */ } } } else if(element.hasClassName('datetime-picker') && !skipIds.include(optionId)) { From 1c1c0318eed020c0d09f7e1f0b378bb45c69e9bc Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Tue, 24 Jul 2012 11:29:30 +0200 Subject: [PATCH 17/41] Add localization to modman/modgit --- modman | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modman b/modman index 06d67f5..acae221 100644 --- a/modman +++ b/modman @@ -6,5 +6,7 @@ app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml app/design/frontend/base/default/template/page/scpcontentonly.phtml app/design/frontend/base/default/template/page/scpcontentonly.phtml app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml +app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv +app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv skin/frontend/base/default/images/scp-ajax-loader.gif skin/frontend/base/default/images/scp-ajax-loader.gif skin/frontend/base/default/js/scp_product_extension.js skin/frontend/base/default/js/scp_product_extension.js From 8da3c978380c41d424d32abe96bcc605faa780fe Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Thu, 19 Jul 2012 16:59:42 +0200 Subject: [PATCH 18/41] remove unneeded logging --- .../Catalog/Model/Product/Type/Simple.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php index fed7bef..7b4a08b 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php @@ -35,7 +35,7 @@ public function prepareForCart(Varien_Object $buyRequest, $product = null) public function hasConfigurableProductParentId() { $cpid = $this->getCpid(); - Mage::log("cpid: ". $cpid); + //Mage::log("cpid: ". $cpid); return !empty($cpid); } From ec9c821aec6233ca5734e11277f3f025f161c9f5 Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Wed, 18 Jul 2012 16:38:49 +0200 Subject: [PATCH 19/41] Switch CatalogRule to Magento 1.7's way of doing resource classes --- .../CatalogRule/Model/{Mysql4 => Resource}/Rule.php | 4 ++-- .../SimpleConfigurableProducts/etc/config.xml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/{Mysql4 => Resource}/Rule.php (98%) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Mysql4/Rule.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Resource/Rule.php similarity index 98% rename from app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Mysql4/Rule.php rename to app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Resource/Rule.php index 8935ef4..6e6663f 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Mysql4/Rule.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/CatalogRule/Model/Resource/Rule.php @@ -5,8 +5,8 @@ #My fix is: only delete pricerule price entries for the rule that fails to validate #It's an odd bug - and maybe there's a good reason, but it's making my rules disappear when I save products, which is pretty annoying -class OrganicInternet_SimpleConfigurableProducts_CatalogRule_Model_Mysql4_Rule extends - Mage_CatalogRule_Model_Mysql4_Rule +class OrganicInternet_SimpleConfigurableProducts_CatalogRule_Model_Resource_Rule extends + Mage_CatalogRule_Model_Resource_Rule { public function applyToProduct($rule, $product, $websiteIds) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml index 5fc9e12..fe35be4 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml @@ -12,11 +12,11 @@ - + - OrganicInternet_SimpleConfigurableProducts_CatalogRule_Model_Mysql4_Rule + OrganicInternet_SimpleConfigurableProducts_CatalogRule_Model_Resource_Rule - + OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Product_Type_Configurable_Price From 176cc354b294bcfa6d8d29f2f412d7b6706a46e4 Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Tue, 17 Jul 2012 17:19:04 +0200 Subject: [PATCH 20/41] Js for reloadPrice doesn't get correct price for text options --- .../base/default/template/catalog/product/view/scpoptions.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml b/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml index c3571bd..f5d5cc7 100644 --- a/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml +++ b/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml @@ -121,7 +121,7 @@ if (count($_options) || $this->getProduct()->isConfigurable()): } } else { if (element.getValue().strip() != '') { - price += parseFloat(this.config[optionId]); + price += parseFloat(this.config[optionId].price); } } } From ea64a30c8f2aaf75f939621428c8135f097138ac Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 25 Jul 2012 15:28:39 +0930 Subject: [PATCH 21/41] add SKU and stock availability information to spConfig object and update the display based on child product selected --- .../Block/Product/View/Type/Configurable.php | 9 ++++++++- .../SimpleConfigurableProducts/etc/system.xml | 10 ++++++++++ .../catalog/product/view/scpavailability.phtml | 8 ++++++++ modman | 1 + .../base/default/js/scp_product_extension.js | 14 ++++++++++++++ 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php index 7086d24..6209168 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php @@ -14,7 +14,8 @@ public function getJsonConfig() $productId = $product->getId(); $childProducts[$productId] = array( "price" => $this->_registerJsPrice($this->_convertPrice($product->getPrice())), - "finalPrice" => $this->_registerJsPrice($this->_convertPrice($product->getFinalPrice())) + "finalPrice" => $this->_registerJsPrice($this->_convertPrice($product->getFinalPrice())), + "sku" => $product->getSku(), ); if (Mage::getStoreConfig('SCP_options/product_page/change_name')) { @@ -33,6 +34,12 @@ public function getJsonConfig() ->setProduct($product) ->toHtml(); } + + $bChangeStock = Mage::getStoreConfig('SCP_options/product_page/change_stock'); + if ($bChangeStock) { + $oStockBlock = $this->getLayout()->createBlock('catalog/product_view_type_simple')->setTemplate('catalog/product/view/scpavailability.phtml'); + $childProducts[$productId]["stockStatus"] = $oStockBlock->setProduct($product)->toHtml(); + } #if image changing is enabled.. if (Mage::getStoreConfig('SCP_options/product_page/change_image')) { diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/system.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/system.xml index 35c9482..93eb337 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/system.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/system.xml @@ -140,6 +140,16 @@ 1 1 + + + select + adminhtml/system_config_source_yesno + 999 + 1 + 1 + 1 + Takes affect once all configurable options have been selected + diff --git a/app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml b/app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml new file mode 100644 index 0000000..35d79e1 --- /dev/null +++ b/app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml @@ -0,0 +1,8 @@ + +getProduct() ?> + +isAvailable()): ?> +

__('Availability:') ?> __('In stock') ?>

+ +

__('Availability:') ?> __('Out of stock') ?>

+ diff --git a/modman b/modman index 06d67f5..cd77800 100644 --- a/modman +++ b/modman @@ -3,6 +3,7 @@ app/design/frontend/base/default/layout/simpleconfigurableproducts.xml app/desig app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml +app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml app/design/frontend/base/default/template/page/scpcontentonly.phtml app/design/frontend/base/default/template/page/scpcontentonly.phtml app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml diff --git a/skin/frontend/base/default/js/scp_product_extension.js b/skin/frontend/base/default/js/scp_product_extension.js index 53c4234..96153c3 100644 --- a/skin/frontend/base/default/js/scp_product_extension.js +++ b/skin/frontend/base/default/js/scp_product_extension.js @@ -189,6 +189,7 @@ Product.Config.prototype.reloadPrice = function() { this.updateProductShortDescription(false); this.updateProductDescription(false); this.updateProductName(false); + this.updateProductStock(childProductId); this.updateProductAttributes(false); this.showCustomOptionsBlock(false, false); if (usingZoomer) { @@ -253,6 +254,19 @@ Product.Config.prototype.updateProductDescription = function(productId) { }); }; +Product.Config.prototype.updateProductStock = function(productId) { + var stockStatusHtml = this.config.stockStatus; + if (productId && this.config.childProducts[productId].stockStatus) { + stockStatusHtml = this.config.childProducts[productId].stockStatus; + } + //If config product doesn't already have an additional information section, + //it won't be shown for associated product either. It's too hard to work out + //where to place it given that different themes use very different html here + $$('.availability').each(function(el) { + el.replace(stockStatusHtml); + }); +}; + Product.Config.prototype.updateProductAttributes = function(productId) { var productAttributes = this.config.productAttributes; if (productId && this.config.childProducts[productId].productAttributes) { From 9e88b3390c9ff3c0389e08d7a49b79d6fca7c3d6 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 26 Jul 2012 16:25:08 +0930 Subject: [PATCH 22/41] add product alert html to the spConfig object --- .../Block/Product/View/Type/Configurable.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php index 6209168..1b24f92 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php @@ -40,6 +40,14 @@ public function getJsonConfig() $oStockBlock = $this->getLayout()->createBlock('catalog/product_view_type_simple')->setTemplate('catalog/product/view/scpavailability.phtml'); $childProducts[$productId]["stockStatus"] = $oStockBlock->setProduct($product)->toHtml(); } + + $bShowProductAlerts = Mage::getStoreConfig(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW); + if ($bShowProductAlerts && !$product->isAvailable()) { + $oAlertBlock = $this->getLayout()->createBlock('productalert/product_view') + ->setTemplate('productalert/product/view.phtml') + ->setSignupUrl(Mage::helper('productalert')->setProduct($product)->getSaveUrl('stock'));; + $childProducts[$productId]["alertHtml"] = $oAlertBlock->toHtml(); + } #if image changing is enabled.. if (Mage::getStoreConfig('SCP_options/product_page/change_image')) { @@ -89,6 +97,14 @@ public function getJsonConfig() $config["productAttributes"] = $childBlock->setTemplate('catalog/product/view/attributes.phtml') ->setProduct($this->getProduct()) ->toHtml(); + + $bShowProductAlerts = Mage::getStoreConfig(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW); + if ($bShowProductAlerts && !Mage::registry('child_product')->isAvailable()) { + $oAlertBlock = $this->getLayout()->createBlock('productalert/product_view') + ->setTemplate('productalert/product/view.phtml') + ->setSignupUrl(Mage::helper('productalert')->setProduct(Mage::registry('child_product'))->getSaveUrl('stock'));; + $config["alertHtml"] = $oAlertBlock->toHtml(); + } if (Mage::getStoreConfig('SCP_options/product_page/change_image')) { if (Mage::getStoreConfig('SCP_options/product_page/change_image_fancy')) { From 2c06b4fc6bc7c52e279bc1669d828e78568d7ffe Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Thu, 26 Jul 2012 12:14:24 +0200 Subject: [PATCH 23/41] Update french translation --- app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv | 1 + app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv | 1 + 2 files changed, 2 insertions(+) diff --git a/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv b/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv index dc26147..f10a724 100644 --- a/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv +++ b/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv @@ -1 +1,2 @@ "Price From:","Price From:" +"Last ordered items","Last ordered items" diff --git a/app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv b/app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv index 09a1f17..aa9d65d 100644 --- a/app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv +++ b/app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv @@ -1 +1,2 @@ "Price From:","À partir de:" +"Last ordered items","Derniers produits commandés" From 2d70ea083a44bf1608af95f1ba6f07754729f334 Mon Sep 17 00:00:00 2001 From: Joel Kociolek Date: Thu, 26 Jul 2012 12:57:17 +0200 Subject: [PATCH 24/41] JS fixes for price resetting to zero when selecting product option --- .../template/catalog/product/view/scpoptions.phtml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml b/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml index 8513d8d..fac599c 100644 --- a/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml +++ b/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml @@ -95,11 +95,7 @@ if (count($_options) || $this->getProduct()->isConfigurable()): if (element.type == 'checkbox' || element.type == 'radio') { if (element.checked) { if (config[optionId][element.getValue()]) { - /* begin DMTW */ - /* fix price resetting to zero when custom option checkbox is clicked */ - // price += parseFloat(config[optionId][element.getValue()]); - price += parseFloat(config[optionId][element.getValue()].price); - /* end DMTW */ + price += parseFloat(config[optionId][element.getValue()].price); } } } else if(element.hasClassName('datetime-picker') && !skipIds.include(optionId)) { @@ -110,7 +106,7 @@ if (count($_options) || $this->getProduct()->isConfigurable()): } }); if (dateSelected) { - price += parseFloat(this.config[optionId]); + price += parseFloat(this.config[optionId].price); skipIds[optionId] = optionId; } } else if(element.type == 'select-one' || element.type == 'select-multiple') { @@ -118,7 +114,7 @@ if (count($_options) || $this->getProduct()->isConfigurable()): $A(element.options).each(function(selectOption){ if (selectOption.selected) { if (this.config[optionId][selectOption.value]) { - price += parseFloat(this.config[optionId][selectOption.value]); + price += parseFloat(this.config[optionId][selectOption.value].price); } } }); From 6ccc8342ec2e7a3d7d0feaa8295818e94f697bec Mon Sep 17 00:00:00 2001 From: Lyndon Hook Date: Tue, 18 Sep 2012 12:00:19 +1000 Subject: [PATCH 25/41] Fixed stock status and expanded dynamic js functions Fixed an issue with the stock status js and also included the "Add to Cart" button dynamic switching. Signed-off-by: Lyndon Hook Signed-off-by: Jonathan --- .../Block/Product/View/Type/Configurable.php | 5 ++++ .../base/default/js/scp_product_extension.js | 29 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php index 1b24f92..0e01420 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php @@ -37,8 +37,13 @@ public function getJsonConfig() $bChangeStock = Mage::getStoreConfig('SCP_options/product_page/change_stock'); if ($bChangeStock) { + // Stock status HTML $oStockBlock = $this->getLayout()->createBlock('catalog/product_view_type_simple')->setTemplate('catalog/product/view/scpavailability.phtml'); $childProducts[$productId]["stockStatus"] = $oStockBlock->setProduct($product)->toHtml(); + + // Add to cart button + $oAddToCartBlock = $this->getLayout()->createBlock('catalog/product_view_type_simple')->setTemplate('catalog/product/view/addtocart.phtml'); + $childProducts[$productId]["addToCart"] = $oAddToCartBlock->setProduct($product)->toHtml(); } $bShowProductAlerts = Mage::getStoreConfig(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW); diff --git a/skin/frontend/base/default/js/scp_product_extension.js b/skin/frontend/base/default/js/scp_product_extension.js index 96153c3..9e4c634 100644 --- a/skin/frontend/base/default/js/scp_product_extension.js +++ b/skin/frontend/base/default/js/scp_product_extension.js @@ -166,6 +166,8 @@ Product.Config.prototype.reloadPrice = function() { this.updateProductShortDescription(childProductId); this.updateProductDescription(childProductId); this.updateProductName(childProductId); + this.updateProductStock(childProductId); + this.updateProductSku(childProductId); this.updateProductAttributes(childProductId); this.updateFormProductId(childProductId); this.addParentProductIdToCartForm(this.config.productId); @@ -189,7 +191,8 @@ Product.Config.prototype.reloadPrice = function() { this.updateProductShortDescription(false); this.updateProductDescription(false); this.updateProductName(false); - this.updateProductStock(childProductId); + this.updateProductStock(false); + this.updateProductSku(false); this.updateProductAttributes(false); this.showCustomOptionsBlock(false, false); if (usingZoomer) { @@ -215,7 +218,7 @@ Product.Config.prototype.updateProductImage = function(productId) { if($('image')) { $('image').src = imageUrl; } else { - $$('#product_addtocart_form p.product-image img').each(function(el) { + $$('#product_addtocart_form a.product-image img').each(function(el) { var dims = el.getDimensions(); el.src = imageUrl; el.width = dims.width; @@ -239,7 +242,7 @@ Product.Config.prototype.updateProductShortDescription = function(productId) { if (productId && this.config.childProducts[productId].shortDescription) { shortDescription = this.config.childProducts[productId].shortDescription; } - $$('#product_addtocart_form div.short-description div.std').each(function(el) { + $$('#product_addtocart_form div.short-description div').each(function(el) { el.innerHTML = shortDescription; }); }; @@ -259,12 +262,30 @@ Product.Config.prototype.updateProductStock = function(productId) { if (productId && this.config.childProducts[productId].stockStatus) { stockStatusHtml = this.config.childProducts[productId].stockStatus; } + var addToCartHtml = this.config.addToCart; + if (productId && this.config.childProducts[productId].addToCart) { + addToCartHtml = this.config.childProducts[productId].addToCart; + } //If config product doesn't already have an additional information section, //it won't be shown for associated product either. It's too hard to work out //where to place it given that different themes use very different html here - $$('.availability').each(function(el) { + $$('p.availability').each(function(el) { el.replace(stockStatusHtml); }); + $$('div.add-to-box').each(function(el) { + el.innerHTML=addToCartHtml; + }); +}; + +Product.Config.prototype.updateProductSku = function(productId) { + var skuHtml = this.config.sku; + if (productId && this.config.childProducts[productId].sku) { + skuHtml = this.config.childProducts[productId].sku; + } + //If config product doesn't already have an additional information section, + //it won't be shown for associated product either. It's too hard to work out + //where to place it given that different themes use very different html here + $('product-sku').innerHTML=skuHtml; }; Product.Config.prototype.updateProductAttributes = function(productId) { From 8c7586f8def9c7cc76d55c25e908a14cee65f2cd Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 18 Oct 2012 21:57:41 +1030 Subject: [PATCH 26/41] check that the product-sku DOM element is present before updating it --- skin/frontend/base/default/js/scp_product_extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skin/frontend/base/default/js/scp_product_extension.js b/skin/frontend/base/default/js/scp_product_extension.js index 9e4c634..54eac2c 100644 --- a/skin/frontend/base/default/js/scp_product_extension.js +++ b/skin/frontend/base/default/js/scp_product_extension.js @@ -285,7 +285,7 @@ Product.Config.prototype.updateProductSku = function(productId) { //If config product doesn't already have an additional information section, //it won't be shown for associated product either. It's too hard to work out //where to place it given that different themes use very different html here - $('product-sku').innerHTML=skuHtml; + if($('product-sku')){ $('product-sku').innerHTML=skuHtml } ; }; Product.Config.prototype.updateProductAttributes = function(productId) { From 85ab0005f800735d45f002574831aebbe0de6814 Mon Sep 17 00:00:00 2001 From: Jim O'Halloran Date: Wed, 22 Aug 2012 14:14:25 +0930 Subject: [PATCH 27/41] Allow SCP Ajax controller to display tier pricing when the parent is not visible, provided the child is. Signed-off-by: Jim O'Halloran --- .../controllers/AjaxController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/controllers/AjaxController.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/controllers/AjaxController.php index 0544be5..bcabcdb 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/controllers/AjaxController.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/controllers/AjaxController.php @@ -47,8 +47,7 @@ protected function _initProduct() $parent = Mage::getModel('catalog/product') ->setStoreId(Mage::app()->getStore()->getId()) ->load($parentId); - - if (!Mage::helper('catalog/product')->canShow($parent)) { + if (!$parent->getId()) { return false; } @@ -64,6 +63,11 @@ protected function _initProduct() if (!$product->getId()) { return false; } + + if (!Mage::helper('catalog/product')->canShow($parent) && !Mage::helper('catalog/product')->canShow($product)) { + return false; + } + if ($categoryId) { $category = Mage::getModel('catalog/category')->load($categoryId); Mage::register('current_category', $category); From b6ca9b4a7639c4594dedccdcdb7980701204edb1 Mon Sep 17 00:00:00 2001 From: Jim O'Halloran Date: Fri, 21 Dec 2012 10:13:50 +1030 Subject: [PATCH 28/41] Compatibility with the SweetTooth rewards extension. --- skin/frontend/base/default/js/scp_product_extension.js | 1 + 1 file changed, 1 insertion(+) diff --git a/skin/frontend/base/default/js/scp_product_extension.js b/skin/frontend/base/default/js/scp_product_extension.js index 54eac2c..c54825f 100644 --- a/skin/frontend/base/default/js/scp_product_extension.js +++ b/skin/frontend/base/default/js/scp_product_extension.js @@ -159,6 +159,7 @@ Product.Config.prototype.reloadPrice = function() { var price = childProducts[childProductId]["price"]; var finalPrice = childProducts[childProductId]["finalPrice"]; optionsPrice.productPrice = finalPrice; + optionsPrice.productPriceBeforeRedemptions = finalPrice; optionsPrice.productOldPrice = price; optionsPrice.reload(); optionsPrice.reloadPriceLabels(true); From b4c930a4f5e5433b29e5e02321a826dbc9c6c7bf Mon Sep 17 00:00:00 2001 From: James Harrison Date: Fri, 23 Aug 2013 15:35:39 +1000 Subject: [PATCH 29/41] Added composer.json --- composer.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..cff53d9 --- /dev/null +++ b/composer.json @@ -0,0 +1,18 @@ +{ + "name":"blissmedia/part-finder", + "type":"magento-module", + "homepage":"https://bitbucket.org/blissmedia/part-finder", + "authors":[ + { + "name":"James Harrison" + } + ], + "minimum-stability":"dev", + "repositories":[ + { "type": "vcs", "url": "git@bitbucket.org:blissmedia/ecommerceteam-sln.git" } + ], + "require":{ + "magento-hackathon/magento-composer-installer":"*", + "blissmedia/ecommerceteam_sln":"*" + } +} \ No newline at end of file From e91c9fc7012397bd56d0daf31e34d351d452611f Mon Sep 17 00:00:00 2001 From: James Harrison Date: Fri, 23 Aug 2013 15:38:17 +1000 Subject: [PATCH 30/41] composer json fix --- composer.json | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index cff53d9..200bae8 100644 --- a/composer.json +++ b/composer.json @@ -1,18 +1,11 @@ { - "name":"blissmedia/part-finder", + "name":"blissmedia/organicinternet_magento-configurable-simple", "type":"magento-module", - "homepage":"https://bitbucket.org/blissmedia/part-finder", + "homepage":"https://github.com/blissmedia/organicinternet_magento-configurable-simple", "authors":[ { "name":"James Harrison" } ], - "minimum-stability":"dev", - "repositories":[ - { "type": "vcs", "url": "git@bitbucket.org:blissmedia/ecommerceteam-sln.git" } - ], - "require":{ - "magento-hackathon/magento-composer-installer":"*", - "blissmedia/ecommerceteam_sln":"*" - } + "minimum-stability":"dev" } \ No newline at end of file From d0c54a90b69aee165a186f1d76e573393a963f92 Mon Sep 17 00:00:00 2001 From: James Harrison Date: Fri, 23 Aug 2013 16:06:32 +1000 Subject: [PATCH 31/41] Restructured template files & added modman --- .../SimpleConfigurableProducts/etc/config.xml | 2 +- ...simpleconfigurableproducts.xml => scp.xml} | 30 +++++++++--------- .../product/view/options/scpwrapper.phtml | 2 +- .../catalog/product/view/scpajaxoptions.phtml | 0 .../catalog/product/view/scpoptions.phtml | 0 .../{ => scp}/page/scpcontentonly.phtml | 0 .../{ => scp}/sales/reorder/scpsidebar.phtml | 0 modman | 8 +++++ .../images/{ => scp}/scp-ajax-loader.gif | Bin .../js/{ => scp}/scp_product_extension.js | 0 10 files changed, 25 insertions(+), 17 deletions(-) rename app/design/frontend/base/default/layout/{simpleconfigurableproducts.xml => scp.xml} (50%) rename app/design/frontend/base/default/template/{ => scp}/catalog/product/view/options/scpwrapper.phtml (81%) rename app/design/frontend/base/default/template/{ => scp}/catalog/product/view/scpajaxoptions.phtml (100%) rename app/design/frontend/base/default/template/{ => scp}/catalog/product/view/scpoptions.phtml (100%) rename app/design/frontend/base/default/template/{ => scp}/page/scpcontentonly.phtml (100%) rename app/design/frontend/base/default/template/{ => scp}/sales/reorder/scpsidebar.phtml (100%) create mode 100644 modman rename skin/frontend/base/default/images/{ => scp}/scp-ajax-loader.gif (100%) rename skin/frontend/base/default/js/{ => scp}/scp_product_extension.js (100%) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml index 1e692c1..8e7425c 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/etc/config.xml @@ -104,7 +104,7 @@ - simpleconfigurableproducts.xml + scp.xml diff --git a/app/design/frontend/base/default/layout/simpleconfigurableproducts.xml b/app/design/frontend/base/default/layout/scp.xml similarity index 50% rename from app/design/frontend/base/default/layout/simpleconfigurableproducts.xml rename to app/design/frontend/base/default/layout/scp.xml index 22f16f3..056bc29 100644 --- a/app/design/frontend/base/default/layout/simpleconfigurableproducts.xml +++ b/app/design/frontend/base/default/layout/scp.xml @@ -6,50 +6,50 @@ but we can't necessarily guarantee the load order of the script using the addJs mechanism. Items of type 'skin_js' load after those of type 'js' however, so we use that. (See getCssJsHtml in app/code/core/Mage/Page/Block/Html/Head.php) --> - skin_jsjs/scp_product_extension.js + skin_jsjs/scp/scp_product_extension.js - + - + - + - + - + - - textcatalog/product_view_options_type_text - filecatalog/product_view_options_type_file - selectcatalog/product_view_options_type_select - datecatalog/product_view_options_type_date + + textscp/catalog/product_view_options_type_text + filescp/catalog/product_view_options_type_file + selectscp/catalog/product_view_options_type_select + datescp/catalog/product_view_options_type_date - + - + - + @@ -59,7 +59,7 @@ - + diff --git a/app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml b/app/design/frontend/base/default/template/scp/catalog/product/view/options/scpwrapper.phtml similarity index 81% rename from app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml rename to app/design/frontend/base/default/template/scp/catalog/product/view/options/scpwrapper.phtml index bc2b479..de45690 100644 --- a/app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml +++ b/app/design/frontend/base/default/template/scp/catalog/product/view/options/scpwrapper.phtml @@ -1,6 +1,6 @@
getChildHtml('', true, true);?> - +
hasRequiredOptions()):?> diff --git a/app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml b/app/design/frontend/base/default/template/scp/catalog/product/view/scpajaxoptions.phtml similarity index 100% rename from app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml rename to app/design/frontend/base/default/template/scp/catalog/product/view/scpajaxoptions.phtml diff --git a/app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml b/app/design/frontend/base/default/template/scp/catalog/product/view/scpoptions.phtml similarity index 100% rename from app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml rename to app/design/frontend/base/default/template/scp/catalog/product/view/scpoptions.phtml diff --git a/app/design/frontend/base/default/template/page/scpcontentonly.phtml b/app/design/frontend/base/default/template/scp/page/scpcontentonly.phtml similarity index 100% rename from app/design/frontend/base/default/template/page/scpcontentonly.phtml rename to app/design/frontend/base/default/template/scp/page/scpcontentonly.phtml diff --git a/app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml b/app/design/frontend/base/default/template/scp/sales/reorder/scpsidebar.phtml similarity index 100% rename from app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml rename to app/design/frontend/base/default/template/scp/sales/reorder/scpsidebar.phtml diff --git a/modman b/modman new file mode 100644 index 0000000..5ba1f2d --- /dev/null +++ b/modman @@ -0,0 +1,8 @@ +app/code/community/OrganicInternet/SimpleConfigurableProducts/ app/code/community/OrganicInternet/SimpleConfigurableProducts/ +app/design/frontend/base/default/layout/* app/design/frontend/base/default/layout/ +app/design/frontend/base/default/template/* app/design/frontend/base/default/template/ + +app/etc/modules/* app/etc/modules/ + +skin/frontend/base/default/images/* skin/frontend/base/default/images/ +skin/frontend/base/default/js/* skin/frontend/base/default/js/ \ No newline at end of file diff --git a/skin/frontend/base/default/images/scp-ajax-loader.gif b/skin/frontend/base/default/images/scp/scp-ajax-loader.gif similarity index 100% rename from skin/frontend/base/default/images/scp-ajax-loader.gif rename to skin/frontend/base/default/images/scp/scp-ajax-loader.gif diff --git a/skin/frontend/base/default/js/scp_product_extension.js b/skin/frontend/base/default/js/scp/scp_product_extension.js similarity index 100% rename from skin/frontend/base/default/js/scp_product_extension.js rename to skin/frontend/base/default/js/scp/scp_product_extension.js From c084166e9c89a1e4dfa045786632acb440a1f7d9 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 2 Sep 2013 13:46:49 +1000 Subject: [PATCH 32/41] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 200bae8..63f3ee5 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name":"blissmedia/organicinternet_magento-configurable-simple", + "name":"organicinternet/magento-configurable-simple", "type":"magento-module", "homepage":"https://github.com/blissmedia/organicinternet_magento-configurable-simple", "authors":[ @@ -8,4 +8,4 @@ } ], "minimum-stability":"dev" -} \ No newline at end of file +} From b2db34a11064036f6d5fcf2f03c667470053e2c1 Mon Sep 17 00:00:00 2001 From: James Harrison Date: Tue, 3 Sep 2013 11:14:16 +1000 Subject: [PATCH 33/41] Removed logging call and fixed some block types --- .../Catalog/Model/Product/Type/Simple.php | 1 - app/design/frontend/base/default/layout/scp.xml | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php index fed7bef..0e51809 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Simple.php @@ -35,7 +35,6 @@ public function prepareForCart(Varien_Object $buyRequest, $product = null) public function hasConfigurableProductParentId() { $cpid = $this->getCpid(); - Mage::log("cpid: ". $cpid); return !empty($cpid); } diff --git a/app/design/frontend/base/default/layout/scp.xml b/app/design/frontend/base/default/layout/scp.xml index 056bc29..b142c02 100644 --- a/app/design/frontend/base/default/layout/scp.xml +++ b/app/design/frontend/base/default/layout/scp.xml @@ -35,13 +35,13 @@ - - textscp/catalog/product_view_options_type_text - filescp/catalog/product_view_options_type_file - selectscp/catalog/product_view_options_type_select - datescp/catalog/product_view_options_type_date + + textcatalog/product_view_options_type_text + filecatalog/product_view_options_type_file + selectcatalog/product_view_options_type_select + datecatalog/product_view_options_type_date - + @@ -49,7 +49,7 @@ - + @@ -59,7 +59,7 @@ - + From 7a5fb70998955d8b192af3b700ab3b9899f67bfa Mon Sep 17 00:00:00 2001 From: Supreme Leader Date: Mon, 19 Nov 2012 16:05:14 +0100 Subject: [PATCH 34/41] german translation (cherry picked from commit ef20da5bb6c66f6fbea6055338c03575fe54a76a) --- .../Catalog/Block/Product/View/Type/Configurable.php | 8 ++++---- .../Rss/Block/Catalog/Category.php | 2 +- .../SimpleConfigurableProducts/Rss/Block/Catalog/New.php | 2 +- .../Rss/Block/Catalog/Special.php | 2 +- .../SimpleConfigurableProducts/Rss/Block/Catalog/Tag.php | 2 +- .../SimpleConfigurableProducts/Rss/Block/Wishlist.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php index 0e01420..7213905 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php @@ -34,7 +34,7 @@ public function getJsonConfig() ->setProduct($product) ->toHtml(); } - + $bChangeStock = Mage::getStoreConfig('SCP_options/product_page/change_stock'); if ($bChangeStock) { // Stock status HTML @@ -45,7 +45,7 @@ public function getJsonConfig() $oAddToCartBlock = $this->getLayout()->createBlock('catalog/product_view_type_simple')->setTemplate('catalog/product/view/addtocart.phtml'); $childProducts[$productId]["addToCart"] = $oAddToCartBlock->setProduct($product)->toHtml(); } - + $bShowProductAlerts = Mage::getStoreConfig(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW); if ($bShowProductAlerts && !$product->isAvailable()) { $oAlertBlock = $this->getLayout()->createBlock('productalert/product_view') @@ -85,7 +85,7 @@ public function getJsonConfig() $p = $this->getProduct(); $config['childProducts'] = $childProducts; if ($p->getMaxPossibleFinalPrice() != $p->getFinalPrice()) { - $config['priceFromLabel'] = $this->__('Price From:'); + $config['priceFromLabel'] = $this->__('Preis ab:  '); } else { $config['priceFromLabel'] = $this->__(''); } @@ -102,7 +102,7 @@ public function getJsonConfig() $config["productAttributes"] = $childBlock->setTemplate('catalog/product/view/attributes.phtml') ->setProduct($this->getProduct()) ->toHtml(); - + $bShowProductAlerts = Mage::getStoreConfig(Mage_ProductAlert_Model_Observer::XML_PATH_STOCK_ALLOW); if ($bShowProductAlerts && !Mage::registry('child_product')->isAvailable()) { $oAlertBlock = $this->getLayout()->createBlock('productalert/product_view') diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Category.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Category.php index fa9daeb..38f756e 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Category.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Category.php @@ -69,7 +69,7 @@ protected function _toHtml() ''. ''.$_product->getDescription(). - ($_product->isConfigurable() ? '

Price From:' : '

Price:'). + ($_product->isConfigurable() ? '

Preis ab:   ' : '

Preis:'). Mage::helper('core')->currency($_product->getPrice()). ($_product->getPrice() != $final_price ? ' Special Price:'. Mage::helper('core')->currency($final_price) : ''). '

'. diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/New.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/New.php index 6401130..016db9c 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/New.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/New.php @@ -12,7 +12,7 @@ public function addNewItemXmlCallback($args) $description = ''. ''. '
'.$product->getDescription(). - ($product->isConfigurable() ? '

Price From:' : '

Price:'). + ($product->isConfigurable() ? '

Preis ab:   ' : '

Preis:'). Mage::helper('core')->currency($product->getPrice()). ($product->getPrice() != $final_price ? ' Special Price:'. Mage::helper('core')->currency($final_price) : ''). '

'. diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Special.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Special.php index ac341c0..95effba 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Special.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Special.php @@ -82,7 +82,7 @@ protected function _toHtml() $description = ''. ''. ''. '
'.$product->getDescription(). - ($product->isConfigurable() ? '

Price From:' : '

Price:'). + ($product->isConfigurable() ? '

Preis ab:  ' : '

Preis:'). Mage::helper('core')->currency($product->getPrice()). ' Special Price:'. Mage::helper('core')->currency($special_price). ($result['use_special'] && $result['special_to_date'] ? '
Special Expires on: '.$this->formatDate($result['special_to_date'], Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM) : ''). diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Tag.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Tag.php index e05d0b3..96a3222 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Tag.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Catalog/Tag.php @@ -10,7 +10,7 @@ public function addTaggedItemXml($args) $description = ''. ''. ''. '
'.$product->getDescription(). - ($product->isConfigurable() ? '

Price From:' : '

Price:'). + ($product->isConfigurable() ? '

Preis ab:  ' : '

Preis:'). Mage::helper('core')->currency($product->getFinalPrice()).'

'. '
'; diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Wishlist.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Wishlist.php index 9c45a8b..4cbfa7e 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Wishlist.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Rss/Block/Wishlist.php @@ -45,7 +45,7 @@ protected function _toHtml() '

'. $product->getDescription(). - ($product->isConfigurable() ? '

Price From:' : '

Price:'). + ($product->isConfigurable() ? '

Preis ab:  ' : '

Preis:'). Mage::helper('core')->currency($product->getPrice()). ($product->getPrice() != $product->getFinalPrice() ? ' Special Price:'. Mage::helper('core')->currency($product->getFinalPrice()) : ''). ($item->getDescription() && $item->getDescription() != Mage::helper('wishlist')->defaultCommentString() ? '

Comment: '.$item->getDescription().'

' : ''). From f6f8618527425b87ace29876885861aceada2835 Mon Sep 17 00:00:00 2001 From: Josef Schneider Date: Thu, 26 Sep 2013 17:08:03 +0200 Subject: [PATCH 35/41] de_DE Language Support --- ...nicInternet_SimpleConfigurableProducts.csv | 22 +++++++++++++++++++ ...nicInternet_SimpleConfigurableProducts.csv | 20 +++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 app/locale/de_DE/OrganicInternet_SimpleConfigurableProducts.csv diff --git a/app/locale/de_DE/OrganicInternet_SimpleConfigurableProducts.csv b/app/locale/de_DE/OrganicInternet_SimpleConfigurableProducts.csv new file mode 100644 index 0000000..9b71d73 --- /dev/null +++ b/app/locale/de_DE/OrganicInternet_SimpleConfigurableProducts.csv @@ -0,0 +1,22 @@ +"Price From:","Preis ab:" +"Last ordered items","Zuletzt bestellte Produkte" +"SCP","SCP" +"SCP Config","SCP Konfiguration" +"SCP - Cart","SCP - Warenkorb" +"Show Configurable Product Options In Cart","Zeige konfigurierbare Produkt-Optionen im Warenkorb" +"Show Custom Options In Cart","Zeige individuelle Optionen im Warenkorb" +"Show Configurable Product Name in Cart","Zeige konfigurierbare Produkt-Namen im Warenkorb" +"Show Configurable Product Image in Cart","Zeige konfigurierbares Produkt-Bild im Warenkorb" +"SCP - Product Page","SCP - Produkt Ansicht" +"Dynamically update displayed product description","Dynamisches aktualisieren der Beschreibung" +"Dynamically update displayed product short description","Dynamisches aktualisieren der Kurzbeschreibung" +"Dynamically update displayed product name","Dynamisches aktualisieren des Namen" +"Dynamically update displayed product 'additional information'","Dynamisches aktualisieren der Zusatzinformationen" +"Dynamically update displayed product picture","Dynamisches aktualisieren der Produktbilder" +"Update gallery images as well as main image?","Dynamisches aktualisieren der Produktbilder-Galerie" +"Show price ranges in Configurable Product Option dropdowns","Zeige Differenz Preise im DropDown-Menü" +"Takes affect once all configurable options have been selected","Diese Einstellung beeinflusst alle konfiguerierbaren Produkte" +"Uses ajax to pull in the correct related product images too","Benutzt AJAX um die richtigen Produktbilder zu laden" +"Only applies to SCP configurable products","Funktioniert nur bei Konfigurierbaren Produkten" +"No = Show simple product name in cart","Nein = Zeigt den Produkt-Namen des Simplen Produktes im Warenkorb" +"No = Show simple product image in cart","Nein = Zeigt das Produkt-Bild des Simplen Produktes im Warenkorb" \ No newline at end of file diff --git a/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv b/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv index f10a724..541aa6d 100644 --- a/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv +++ b/app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv @@ -1,2 +1,22 @@ "Price From:","Price From:" "Last ordered items","Last ordered items" +"SCP","SCP" +"SCP Config","SCP Config" +"SCP - Cart","SCP - Cart" +"Show Configurable Product Options In Cart","Show Configurable Product Options In Cart" +"Show Custom Options In Cart","Show Custom Options In Cart" +"Show Configurable Product Name in Cart","Show Configurable Product Name in Cart" +"Show Configurable Product Image in Cart","Show Configurable Product Image in Cart" +"SCP - Product Page","SCP - Product Page" +"Dynamically update displayed product description","Dynamically update displayed product description" +"Dynamically update displayed product short description","Dynamically update displayed product short description" +"Dynamically update displayed product name","Dynamically update displayed product name" +"Dynamically update displayed product 'additional information'","Dynamically update displayed product 'additional information'" +"Dynamically update displayed product picture","Dynamically update displayed product picture" +"Update gallery images as well as main image?","Update gallery images as well as main image?" +"Show price ranges in Configurable Product Option dropdowns","Show price ranges in Configurable Product Option dropdowns" +"Takes affect once all configurable options have been selected","Takes affect once all configurable options have been selected" +"Uses ajax to pull in the correct related product images too","Uses ajax to pull in the correct related product images too" +"Only applies to SCP configurable products","Only applies to SCP configurable products" +"No = Show simple product name in cart","No = Show simple product name in cart" +"No = Show simple product image in cart","No = Show simple product image in cart" \ No newline at end of file From c660bab9e61743db28fc3d8e34ab0a513201cc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Preu=C3=9F?= Date: Tue, 1 Oct 2013 09:02:17 +0200 Subject: [PATCH 36/41] fixed layout xml filename --- modman | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modman b/modman index a783940..9c7f9b0 100644 --- a/modman +++ b/modman @@ -1,5 +1,5 @@ app/code/community/OrganicInternet app/code/community/OrganicInternet -app/design/frontend/base/default/layout/simpleconfigurableproducts.xml app/design/frontend/base/default/layout/simpleconfigurableproducts.xml +app/design/frontend/base/default/layout/scp.xml app/design/frontend/base/default/layout/scp.xml app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml From f1590cdc34a6e3a7ec3fe2521e0ad6a2e113b2f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Preu=C3=9F?= Date: Tue, 1 Oct 2013 09:05:39 +0200 Subject: [PATCH 37/41] adapted more pathes --- modman | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modman b/modman index 9c7f9b0..1906e17 100644 --- a/modman +++ b/modman @@ -1,11 +1,11 @@ app/code/community/OrganicInternet app/code/community/OrganicInternet app/design/frontend/base/default/layout/scp.xml app/design/frontend/base/default/layout/scp.xml -app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml app/design/frontend/base/default/template/catalog/product/view/options/scpwrapper.phtml -app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpajaxoptions.phtml -app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml app/design/frontend/base/default/template/catalog/product/view/scpoptions.phtml -app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml -app/design/frontend/base/default/template/page/scpcontentonly.phtml app/design/frontend/base/default/template/page/scpcontentonly.phtml -app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml app/design/frontend/base/default/template/sales/reorder/scpsidebar.phtml +app/design/frontend/base/default/template/scp/catalog/product/view/options/scpwrapper.phtml app/design/frontend/base/default/template/scp/catalog/product/view/options/scpwrapper.phtml +app/design/frontend/base/default/template/scp/catalog/product/view/scpajaxoptions.phtml app/design/frontend/base/default/template/scp/catalog/product/view/scpajaxoptions.phtml +app/design/frontend/base/default/template/scp/catalog/product/view/scpoptions.phtml app/design/frontend/base/default/template/scp/catalog/product/view/scpoptions.phtml +app/design/frontend/base/default/template/scp/catalog/product/view/scpavailability.phtml app/design/frontend/base/default/template/scp/catalog/product/view/scpavailability.phtml +app/design/frontend/base/default/template/scp/page/scpcontentonly.phtml app/design/frontend/base/default/template/scp/page/scpcontentonly.phtml +app/design/frontend/base/default/template/scp/sales/reorder/scpsidebar.phtml app/design/frontend/base/default/template/scp/sales/reorder/scpsidebar.phtml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv From 7ef8eda6455e490138704d33fbdbb5a45782f695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Preu=C3=9F?= Date: Tue, 1 Oct 2013 09:08:20 +0200 Subject: [PATCH 38/41] adapted more pathes --- modman | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modman b/modman index 1906e17..f9de2d1 100644 --- a/modman +++ b/modman @@ -3,7 +3,7 @@ app/design/frontend/base/default/layout/scp.xml app/design/frontend/base/default app/design/frontend/base/default/template/scp/catalog/product/view/options/scpwrapper.phtml app/design/frontend/base/default/template/scp/catalog/product/view/options/scpwrapper.phtml app/design/frontend/base/default/template/scp/catalog/product/view/scpajaxoptions.phtml app/design/frontend/base/default/template/scp/catalog/product/view/scpajaxoptions.phtml app/design/frontend/base/default/template/scp/catalog/product/view/scpoptions.phtml app/design/frontend/base/default/template/scp/catalog/product/view/scpoptions.phtml -app/design/frontend/base/default/template/scp/catalog/product/view/scpavailability.phtml app/design/frontend/base/default/template/scp/catalog/product/view/scpavailability.phtml +app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml app/design/frontend/base/default/template/catalog/product/view/scpavailability.phtml app/design/frontend/base/default/template/scp/page/scpcontentonly.phtml app/design/frontend/base/default/template/scp/page/scpcontentonly.phtml app/design/frontend/base/default/template/scp/sales/reorder/scpsidebar.phtml app/design/frontend/base/default/template/scp/sales/reorder/scpsidebar.phtml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml From a842736af884b1bb9025b1e836b0de08a1577813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Preu=C3=9F?= Date: Tue, 1 Oct 2013 09:10:23 +0200 Subject: [PATCH 39/41] finalized modman pathes --- modman | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modman b/modman index f9de2d1..62356e0 100644 --- a/modman +++ b/modman @@ -9,5 +9,5 @@ app/design/frontend/base/default/template/scp/sales/reorder/scpsidebar.phtml app app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml app/etc/modules/OrganicInternet_SimpleConfigurableProducts.xml app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv app/locale/fr_FR/OrganicInternet_SimpleConfigurableProducts.csv app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv app/locale/en_US/OrganicInternet_SimpleConfigurableProducts.csv -skin/frontend/base/default/images/scp-ajax-loader.gif skin/frontend/base/default/images/scp-ajax-loader.gif -skin/frontend/base/default/js/scp_product_extension.js skin/frontend/base/default/js/scp_product_extension.js +skin/frontend/base/default/images/scp/scp-ajax-loader.gif skin/frontend/base/default/images/scp/scp-ajax-loader.gif +skin/frontend/base/default/js/scp/scp_product_extension.js skin/frontend/base/default/js/scp/scp_product_extension.js From 7e2f91f487829871ac381158c42a483265342bb8 Mon Sep 17 00:00:00 2001 From: microchip Date: Thu, 13 Feb 2014 15:43:52 +0000 Subject: [PATCH 40/41] Merge jhuriez fork Merge changes from https://github.com/jhuriez/magento-configurable-simple/commit/7321776d6c97e96f4cf120b33cf25d57fe5e614c --- .../Block/Product/View/Type/Configurable.php | 13 ++++++++++--- .../default/js/scp/scp_product_extension.js | 18 ++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php index 7213905..4b468d4 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Block/Product/View/Type/Configurable.php @@ -60,7 +60,11 @@ public function getJsonConfig() if (!Mage::getStoreConfig('SCP_options/product_page/change_image_fancy')) { #If image is not placeholder... if($product->getImage()!=='no_selection') { - $childProducts[$productId]["imageUrl"] = (string)Mage::helper('catalog/image')->init($product, 'image'); + $productMag = Mage::getModel('catalog/product')->load($productId); + foreach($productMag->getMediaGalleryImages() as $image) + { + $childProducts[$productId]["imageUrl"][] = (string)Mage::helper('catalog/image')->init($product, 'image', $image->getFile()); + } } } } @@ -85,7 +89,7 @@ public function getJsonConfig() $p = $this->getProduct(); $config['childProducts'] = $childProducts; if ($p->getMaxPossibleFinalPrice() != $p->getFinalPrice()) { - $config['priceFromLabel'] = $this->__('Preis ab:  '); + $config['priceFromLabel'] = $this->__('Price From:'); } else { $config['priceFromLabel'] = $this->__(''); } @@ -95,7 +99,10 @@ public function getJsonConfig() $config['shortDescription'] = $this->helper('catalog/output')->productAttribute($p, nl2br($p->getShortDescription()), 'short_description'); if (Mage::getStoreConfig('SCP_options/product_page/change_image')) { - $config["imageUrl"] = (string)Mage::helper('catalog/image')->init($p, 'image'); + foreach($p->getMediaGalleryImages() as $image) + { + $config["imageUrl"][] = (string)Mage::helper('catalog/image')->init($p, 'image', $image->getFile()); + } } $childBlock = $this->getLayout()->createBlock('catalog/product_view_attributes'); diff --git a/skin/frontend/base/default/js/scp/scp_product_extension.js b/skin/frontend/base/default/js/scp/scp_product_extension.js index c54825f..0747f93 100644 --- a/skin/frontend/base/default/js/scp/scp_product_extension.js +++ b/skin/frontend/base/default/js/scp/scp_product_extension.js @@ -216,16 +216,14 @@ Product.Config.prototype.updateProductImage = function(productId) { return; } - if($('image')) { - $('image').src = imageUrl; - } else { - $$('#product_addtocart_form a.product-image img').each(function(el) { - var dims = el.getDimensions(); - el.src = imageUrl; - el.width = dims.width; - el.height = dims.height; - }); - } + // Galleria update + var gal = Galleria.get(0); + var dataArr = new Array(); + for(var i=0;i Date: Thu, 13 Feb 2014 15:46:06 +0000 Subject: [PATCH 41/41] Merge barbazul fork Merging https://github.com/barbazul/magento-configurable-simple/commit/055aa7daf238eade6293f8635aec59a1c3238f6f --- .../Checkout/Block/Cart/Item/Renderer.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Checkout/Block/Cart/Item/Renderer.php b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Checkout/Block/Cart/Item/Renderer.php index 4817f31..c65931e 100644 --- a/app/code/community/OrganicInternet/SimpleConfigurableProducts/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/community/OrganicInternet/SimpleConfigurableProducts/Checkout/Block/Cart/Item/Renderer.php @@ -10,10 +10,13 @@ protected function getConfigurableProductParentId() #No idea why in 1.5 the stuff in buyRequest isn't auto-decoded from info_buyRequest #but then it's Magento we're talking about, so I've not a clue what's *meant* to happen. try { - $buyRequest = unserialize($this->getItem()->getOptionByCode('info_buyRequest')->getValue()); - if(!empty($buyRequest['cpid'])) { - return $buyRequest['cpid']; + $buyRequest = $this->getItem()->getOptionByCode('info_buyRequest'); + if ($buyRequest) { + $buyRequest = unserialize($buyRequest->getValue()); } + if(!empty($buyRequest['cpid'])) { + return $buyRequest['cpid']; + } } catch (Exception $e) { } return null;