1
私はopencart 1.5.6.4、journal2テーマを使用しています。私は製品ページでカスタム関連項目を作成しました。一部の商品についてのみ関連商品がなく、その表示を無効にしたいと考えています。結果の表示:関連項目がない場合は何も表示されません。 opencart 1.5.6.4
スクリーンダンプ:
誰もがこれを行う方法の提案を持っていますか?
のxml vqmodとしての私のコードは:
<modification>
<id>Related Products Custom tab </id>
<version>1.2</version>
<vqmver>2.1.5</vqmver>
<author>13Pixels</author>
<file name="catalog/view/theme/journal2/template/product/product.tpl">
<operation>
<search position="after"><![CDATA[<div class="related-custom-spot">]]>
</search>
<add><![CDATA[
<div class="related-custom" style="background-color: rgb(244, 244, 244);">
<?php if ($heading_title): ?>
<div class="secondary-title" style="background-color: rgb(169, 184, 192); margin: 0px;"><?php echo $tab_related; ?></div>
<?php endif; ?>
<div class="related-custom-pictures">
<?php foreach ($products as $product) { ?>
<?php if ($product['thumb']) { ?>
<a href="<?php echo $product['href']; ?>">
<img style="border-width: 5px; border-style: solid; border-color: rgb(244, 244, 244);" width="50px" height="50px" src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" />
</a>
<?php } ?>
<?php } ?>
</div>
</div>
]]></add>
</operation>
</file>
</modification>
完璧!ありがとう! – Youri
画像の並べ替え方法についてのご提案はありますか?例えば;製品表のソート順表その後、それは完璧です:https://www.rijstextiles.com/net-stof-stretch-mesh/mesh-stof-stretch-zwart.html – Youri
<?php foreach($ sort as $ sort){?> – Youri