Skip to content

Commit

Permalink
Merge pull request #35 from zbigniewKurasLM/product-page-template-imp…
Browse files Browse the repository at this point in the history
…rovements

Issue#27 - Do not show attachment tab on product page with no attachments
  • Loading branch information
Bartosz Kubicki authored Jun 5, 2020
2 parents fc5ad73 + 62f282b commit ff07600
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@
* compatibility fix for magento CE 2.3.5

### 1.3.4 ###
* fix for return type fix for configuration provider
* fix for return type fix for configuration provider

### 1.3.5 ###
* do not show attachment tab on product page with no attachments
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"magento/module-ui": "*"
},
"type": "magento2-module",
"version": "1.3.4",
"version": "1.3.5",
"license": [
"MIT"
],
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="LizardMedia_ProductAttachment" setup_version="1.3.4">
<module name="LizardMedia_ProductAttachment" setup_version="1.3.5">
<sequence>
<module name="Magento_Downloadable"/>
<module name="Magento_Catalog"/>
Expand Down
10 changes: 2 additions & 8 deletions view/frontend/templates/product/view/attachment-tab.phtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php /** @var $block LizardMedia\ProductAttachment\Block\Product\AttachmentTab */ ?>
<div id="product-attachments-container" data-role="product-attachments"></div>

<?php $attachments = $block->getAttachments() ?>
<?php if (count($attachments)) : ?>
<div id="product-attachments-container" data-role="product-attachments"></div>
<div class="table-wrapper attachments">
<table class="data table">
<thead>
Expand All @@ -26,9 +25,4 @@
</tbody>
</table>
</div>

<?php else : ?>
<div class="message info empty">
<span><?= /* @escapeNotVerified */ __('This products does not contain any attachments.') ?></span>
</div>
<?php endif; ?>
<?php endif; ?>

0 comments on commit ff07600

Please sign in to comment.