From 97390b3d84dc463f99656a7bede6bb63fb8cf26e Mon Sep 17 00:00:00 2001 From: Kostyantyn Alexeyev Date: Mon, 13 Nov 2017 16:55:04 +0200 Subject: [PATCH] MAGETWO-52974: Configurable product options not saved when editing - for mainline --- .../web/js/fotorama-add-video-events.js | 4 +- .../Block/Product/Renderer/Configurable.php | 6 ++ ...ckout_cart_configure_type_configurable.xml | 12 +++- ...list_index_configure_type_configurable.xml | 6 +- .../templates/product/listing/renderer.phtml | 2 +- .../templates/product/view/renderer.phtml | 6 +- .../web/js/configurable-customer-data.js | 59 +++++++++++++------ .../view/frontend/web/js/swatch-renderer.js | 47 ++++++++++++--- 8 files changed, 108 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js index 03ce42bf25c4a..1dfcc95a552c6 100644 --- a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js +++ b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js @@ -134,7 +134,6 @@ define([ */ _create: function () { $(this.element).on('gallery:loaded', $.proxy(function () { - this.fotoramaItem = $(this.element).find('.fotorama-item'); this._initialize(); }, this)); }, @@ -154,6 +153,7 @@ define([ this.defaultVideoData = this.options.videoData = this.videoDataPlaceholder; } + this.fotoramaItem = $(this.element).find('.fotorama-item'); this.clearEvents(); if (this._checkForVideoExist()) { @@ -164,6 +164,8 @@ define([ this._initFotoramaVideo(); this._attachFotoramaEvents(); } + + this.element.trigger('AddFotoramaVideoEvents:loaded'); }, /** diff --git a/app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php b/app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php index aef8a25da2834..dfd3d6ce15f71 100644 --- a/app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php +++ b/app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php @@ -119,6 +119,12 @@ public function __construct( $configurableAttributeData, $data ); + + $this->addData( + [ + 'cache_lifetime' => isset($data['cache_lifetime']) ? $data['cache_lifetime'] : 3600 + ] + ); } /** diff --git a/app/code/Magento/Swatches/view/frontend/layout/checkout_cart_configure_type_configurable.xml b/app/code/Magento/Swatches/view/frontend/layout/checkout_cart_configure_type_configurable.xml index 593ae32374417..62d6e57221f82 100644 --- a/app/code/Magento/Swatches/view/frontend/layout/checkout_cart_configure_type_configurable.xml +++ b/app/code/Magento/Swatches/view/frontend/layout/checkout_cart_configure_type_configurable.xml @@ -6,7 +6,13 @@ */ --> - - - + + + + + false + + + + diff --git a/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml b/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml index 28bf7baac0a36..9f47b4386c742 100644 --- a/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml +++ b/app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml @@ -12,7 +12,11 @@ - + + + false + + diff --git a/app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml b/app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml index 7ecd6558ef6ea..75a39a0e4e270 100644 --- a/app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml +++ b/app/code/Magento/Swatches/view/frontend/templates/product/listing/renderer.phtml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ ?> - +