Skip to content

Commit ec729b2

Browse files
ADDISONFlyingmana
andauthored
Fixes for #1564 and #1289 (#1568)
* Update agreements.phtml By PR #1480 which is merged in OM the content field is no longer required. If it is not filled in an empty container will be visible in frontend. This PR comes to solve this issue. * Uppercase format in Sales menu - Terms and conditions This commit will change in Backend -> Sales menu a link name from "Terms and conditions" to "Terms and Conditions". It is not necessary to add the text in /app/locale/en_US/Mage_Checkout.csv because it already exists. I chose to keep the old version too. * Wrong attributes order in comparison window This PR fixes the issue #1289. * Update Collection.php Co-authored-by: Daniel Fahlke <[email protected]>
1 parent 434e403 commit ec729b2

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ public function getComparableAttributes()
225225
$this->_comparableAttributes = array();
226226
$setIds = $this->_getAttributeSetIds();
227227
if ($setIds) {
228-
$attributeIds = $this->_getAttributeIdsBySetIds($setIds);
229-
230228
$select = $this->getConnection()->select()
231229
->from(array('main_table' => $this->getTable('eav/attribute')))
232230
->join(
@@ -236,10 +234,15 @@ public function getComparableAttributes()
236234
->joinLeft(
237235
array('al' => $this->getTable('eav/attribute_label')),
238236
'al.attribute_id = main_table.attribute_id AND al.store_id = ' . (int) $this->getStoreId(),
239-
array('store_label' => $this->getConnection()->getCheckSql('al.value IS NULL', 'main_table.frontend_label', 'al.value'))
237+
array('store_label' => new Zend_Db_Expr('IFNULL(al.value, main_table.frontend_label)'))
238+
)
239+
->joinLeft(
240+
array('ai' => $this->getTable('eav/entity_attribute')),
241+
'ai.attribute_id = main_table.attribute_id'
240242
)
241243
->where('additional_table.is_comparable=?', 1)
242-
->where('main_table.attribute_id IN(?)', $attributeIds);
244+
->where('ai.attribute_set_id IN(?)', $setIds)
245+
->order(array('ai.attribute_group_id ASC', 'ai.sort_order ASC'));
243246
$attributesData = $this->getConnection()->fetchAll($select);
244247
if ($attributesData) {
245248
$entityType = Mage_Catalog_Model_Product::ENTITY;

app/code/core/Mage/Checkout/etc/adminhtml.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<children>
3232
<checkoutagreement translate="title" module="checkout">
3333
<sort_order>100</sort_order>
34-
<title>Terms and conditions</title>
34+
<title>Terms and Conditions</title>
3535
<action>adminhtml/checkout_agreement/</action>
3636
</checkoutagreement>
3737
</children>

app/design/frontend/base/default/template/checkout/onepage/agreements.phtml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@
3535
<ol class="checkout-agreements">
3636
<?php foreach ($this->getAgreements() as $_a): ?>
3737
<li>
38-
<div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
39-
<?php if ($_a->getIsHtml()):?>
40-
<?php echo $_a->getContent() ?>
41-
<?php else: ?>
42-
<?php echo nl2br($this->escapeHtml($_a->getContent())) ?>
43-
<?php endif ?>
44-
</div>
38+
<?php if ($_a->getContent()):?>
39+
<div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
40+
<?php if ($_a->getIsHtml()):?>
41+
<?php echo $_a->getContent() ?>
42+
<?php else: ?>
43+
<?php echo nl2br($this->escapeHtml($_a->getContent())) ?>
44+
<?php endif ?>
45+
</div>
46+
<?php endif; ?>
4547
<p class="agree">
4648
<input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->escapeHtml($_a->getCheckboxText()) ?>" class="checkbox" /><label for="agreement-<?php echo $_a->getId()?>"><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->escapeHtml($_a->getCheckboxText()) ?></label>
4749
</p>

0 commit comments

Comments
 (0)