Skip to content

Commit

Permalink
Update handling of attribute images
Browse files Browse the repository at this point in the history
In rearranging code, the variable `$options_attributes_image` became reset on initial pass of every option_name, this causes the attribute image to not be displayed for all image placement settings within the option name manager when the product is not tracked by SBA.

Removing the line from a default installed store with this plugin restored the operation of the attributes images and also allowed modifying the display of attribute images based on the setting of `SBA_SHOW_IMAGE_ON_PRODUCT_INFO`; however, all products that had attribute images were affected by the constant. Added a test for if the product is an SBA product to address the associated image controls.

This again fixes #15 which somehow became an issue again.
  • Loading branch information
mc12345678 committed Jan 26, 2019
1 parent 262267c commit fa45a3f
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -176,7 +176,7 @@ function updateNotifyAttributesModuleStartOption(&$callingClass, $notifier, $par
$this->_options_menu_images = array();
$this->_moveSelectedAttribute = false;
$products_options_array = array();
$options_attributes_image = array();
// $options_attributes_image = array();
// Could do the calculation here the first time set a variable above as part of the class and then reuse that... instead of the modification to the attributes file...
if (!zen_not_null($this->_products_options_names_count)) {
$this->_products_options_names_count = $products_options_names->RecordCount();
Expand Down Expand Up @@ -570,7 +570,7 @@ function updateNotifyAttributesModuleOptionBuilt(&$callingClass, $notifier, $pro
$this->_products_options_names_current = 0;
}
// reset or clear the attribute images so that they do not display adjacent/near the product
if (defined('SBA_SHOW_IMAGE_ON_PRODUCT_INFO') && SBA_SHOW_IMAGE_ON_PRODUCT_INFO === '2') {
if (defined('SBA_SHOW_IMAGE_ON_PRODUCT_INFO') && SBA_SHOW_IMAGE_ON_PRODUCT_INFO === '2' && $this->_isSBA) {
$options_attributes_image = array();
}
}
Expand Down

0 comments on commit fa45a3f

Please sign in to comment.