Post by gossamerLL » Sat Jun 03, 2017 12:15 am

I'm trying to create a VQmod to override my Journal2 Category layout. Basically the category displays the Category description, then the products or if there are no products the text_empty text and then the continue button. I was able to figure out how to move the text_empty so it is before the description using the following:
<file name="catalog/view/theme/journal2/template/product/category.tpl">
<operation info="Move empty text before description" error="log">
<search position="replace"><![CDATA[ <?php echo $content_top; ?> ]]></search>
<add><![CDATA[ <?php echo $content_top; ?>
<?php if (!$categories && !$products) { ?>
<p><?php echo $text_empty; ?></p>
<?php } ?>
]]></add>
</operation>

This results in:
text_empty text
description text

text_empty text
Continue button

I'm having a harder time figuring out how to remove the text_empty that appears before the continue button. This is the code in the template. In the actual .tpl file all I need to do is remove <p><?php echo $text_empty; ?></p>, but how do I do that without affecting that same code I'm adding above?
<?php if (!$categories && !$products) { ?>
<p><?php echo $text_empty; ?></p>
<div class="buttons">
<div class="pull-right"><a href="<?php echo $continue; ?>" class="btn btn-primary button"><?php echo $button_continue; ?></a></div>
</div>
<?php } ?>

Any help is appreciated. Trying to get my head around vqmod and yes I've looked at their scripting and example pages but nothing I've tried has worked.
Linda

New member

Posts

Joined
Thu Jul 25, 2013 4:13 am

Post by cyclops12 » Sat Jun 03, 2017 2:51 am

You could use the "index" function and set it to the "nth" <p><?php echo $text_empty; ?></p> that you want to remove

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by thekrotek » Sat Jun 03, 2017 2:59 am

Use "index" attribute as stated above. But I'd personally recommend to find a unique search string. This is always better than using "index".

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 15 guests