Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Sep 15, 2023
2 parents 06636f4 + e19862b commit 787c1ea
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Mage_Catalog_Block_Product_View_Options_Type_File extends Mage_Catalog_Blo
/**
* Returns info of file
*
* @return string
* @return Varien_Object
*/
public function getFileInfo()
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/ConfigurableSwatches/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function isEnabled()
if (is_null($this->_enabled)) {
$this->_enabled = (
Mage::getStoreConfigFlag(self::CONFIG_PATH_ENABLED)
&& Mage::helper('configurableswatches/productlist')->getSwatchAttribute()
&& Mage::helper('configurableswatches/productlist')->getSwatchAttributeId()
);
}
return $this->_enabled;
Expand Down
5 changes: 3 additions & 2 deletions app/code/core/Mage/ConfigurableSwatches/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ class Mage_ConfigurableSwatches_Model_Observer extends Mage_Core_Model_Abstract
* Observes: catalog_block_product_list_collection
*
* @param Varien_Event_Observer $observer
* @return void
*/
public function productListCollectionLoadAfter(Varien_Event_Observer $observer)
{
if (!Mage::helper('configurableswatches')->isEnabled()) { // check if functionality disabled
return; // exit without loading swatch functionality
if (!Mage::helper('configurableswatches')->isEnabled()) {
return;
}

/** @var Mage_ConfigurableSwatches_Helper_Mediafallback $mediaHelper */
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Core/Block/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ class Mage_Core_Block_Template extends Mage_Core_Block_Abstract
/**
* Path to template file in theme.
*
* @var string|null
* @var string
*/
protected $_template;
protected $_template = '';

/**
* Internal constructor, that is called from real constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected function _prepareLayout()
protected function _toHtml()
{
if (!$this->_profile) {
$this->_template = null;
$this->_template = '';
}
return parent::_toHtml();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* @var Mage_Catalog_Block_Product_View_Options_Type_Date $this
*/
?>
<?php $_option = $this->getOption() ?>
<?php $_optionId = $_option->getId() ?>
<dt><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
Expand Down Expand Up @@ -46,7 +51,7 @@
<?php if ($_option->getIsRequire()): ?>
Validation.addAllThese(
[
['validate-datetime-<?php echo $_optionId ?>', '<?php echo $this->jsQuoteEscape( Mage::helper('catalog')->__('This is a required option') )?>', function(v) {
['validate-datetime-<?php echo $_optionId ?>', '<?php echo $this->jsQuoteEscape( Mage::helper('catalog')->__('This is a required option') )?>', function(v) {
var dateTimeParts = $$('.datetime-picker[id^="options_<?php echo $_optionId ?>"]');
for (var i=0; i < dateTimeParts.length; i++) {
if (dateTimeParts[i].value == "") return false;
Expand All @@ -64,13 +69,13 @@
var hasWithValue = false, hasWithNoValue = false;
var pattern = /day_part$/i;
for (var i=0; i < dateTimeParts.length; i++) {
if (! pattern.test(dateTimeParts[i].id)) {
if (dateTimeParts[i].value === "") {
hasWithValue = true;
} else {
hasWithNoValue = true;
}
}
if (! pattern.test(dateTimeParts[i].id)) {
if (dateTimeParts[i].value === "") {
hasWithValue = true;
} else {
hasWithNoValue = true;
}
}
}
return hasWithValue ^ hasWithNoValue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* @var Mage_Catalog_Block_Product_View_Options_Type_Default $this
*/
?>
<?php $_option = $this->getOption() ?>
<dt>
<label><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* @var Mage_Catalog_Block_Product_View_Options_Type_File $this
*/
?>
<?php $_option = $this->getOption(); ?>
<?php $_fileInfo = $this->getFileInfo(); ?>
<?php $_fileExists = $_fileInfo->hasData() ? true : false; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>

<?php /* @var $this Mage_Catalog_Block_Product_View_Options_Type_Select */ ?>
<?php
/**
* @var Mage_Catalog_Block_Product_View_Options_Type_Select $this
*/
?>
<?php $_option = $this->getOption() ?>
<dt><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label></dt>
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* @var Mage_Catalog_Block_Product_View_Options_Type_Text $this
*/
?>
<?php $_option = $this->getOption(); ?>
<dt><label<?php if ($_option->getIsRequire()) echo ' class="required"' ?>><?php if ($_option->getIsRequire()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label>
<?php echo $this->getFormatedPrice() ?></dt>
Expand Down

0 comments on commit 787c1ea

Please sign in to comment.