<div class="description">
....
<span><?php echo $text_stock; ?></span> <?php echo $stock; ?> -->
<br/><br/>
https://drive.google.com/file/d/1AenEyr ... sp=sharing
Probably unrelated.bassinmatt wrote: ↑Thu Jul 16, 2020 8:02 amI was having issues with my google merchant feed and page design after I deleted it.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Thank you.
catalog/view/theme/your-theme/template/product/product.tpl
as follows:
Code: Select all
...
<!--<span><?php echo $text_stock; ?></span> <?php echo $stock; ?> -->
...
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
select this part of the code (original file)
Code: Select all
<li>{{ text_stock }} {{ stock }}</li>
Code: Select all
<span><?php echo $text_stock; ?></span> <?php echo $stock; ?>
Code: Select all
{% if stock <= 1 %}
<li> </li>
{% else %}
<li>{{ text_stock }} {{ stock }}</li>
{% endif %}
dont forget in your admin panel to at dashboard to refresh the theme and sass
its that blue 'gear' symbol right corner otherwise your new twig wont be loaded
hope this helps
...edit just downloaded your twig, what theme are you having
why use php code in a twig file when all the data is in your controller, not the best way to practice coding
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
So, instead of
Code: Select all
<span><?php echo $text_stock; ?></span> <?php echo $stock; ?> -->
<br/><br/>
<!-- Start Additional Info -->
<?php if ($attribute_groups) { ?>
<?php foreach ($attribute_groups as $attribute_group) { ?>
<?php if ($attribute_group['name'] == 'Product Specifications') { ?>
<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<span><?php echo $attribute['name']; ?></span> <?php echo html_entity_decode($attribute['text']); ?><br />
<?php } ?>
<?php } ?>
<?php } ?>
<?php } ?>
Code: Select all
<!-- <span>{{ text_stock }}</span> {{ stock }} -->
<br/><br/>
<!-- Start Additional Info -->
{% if (attribute_groups) %}
{% for attribute_group in attribute_groups %}
{% if (attribute_group['name'] == 'Product Specifications') %}
{% for attribute in attribute_group['attribute'] %}
<span>{{ attribute['name'] }}</span> {{ attribute['text']|html_entity_decode }}<br />
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
patjuh wrote: ↑Tue Aug 11, 2020 12:08 amits a twig file so the answer above doesnt work, what you could do is
select this part of the code (original file)or your codeCode: Select all
<li>{{ text_stock }} {{ stock }}</li>
and replace it withCode: Select all
<span><?php echo $text_stock; ?></span> <?php echo $stock; ?>
when the product isnt in stock the line ''Availability: Out Of Stock" will be shownCode: Select all
{% if stock <= 1 %} <li> </li> {% else %} <li>{{ text_stock }} {{ stock }}</li> {% endif %}
dont forget in your admin panel to at dashboard to refresh the theme and sass
its that blue 'gear' symbol right corner otherwise your new twig wont be loaded
hope this helps
...edit just downloaded your twig, what theme are you having
why use php code in a twig file when all the data is in your controller, not the best way to practice coding
Im using Maxshop and running 3.0.3.2. I still cant get it to go away even with the above. I do appreciate your assistance though.
You post
Code: Select all
<span><?php echo $text_stock; ?></span> <?php echo $stock; ?> -->
The odd thing here is you also have a trailing --> where is the <!-- ?
comment out is <!-- what you want to comment out -->
You want to remove
Availability: In stock
That would be done simply by
Code: Select all
<!-- <span><?php echo $text_stock; ?></span> <?php echo $stock; ?> -->
Code: Select all
<span><{{ text_stock }}</span> {{ $stock }}
Code: Select all
{# <span><{{ text_stock }}</span> {{ $stock }} #}
both
Code: Select all
<!-- <?php echo $text_stock; ?></span> <?php echo $stock; ?> -->
Code: Select all
{# <?php echo $text_stock; ?></span> <?php echo $stock; ?> #}
The file you have to change is
in OC2
catalog/view/theme/YOUR THEME i.e. MAXSHOP/template/product/product.tpl
or in OC3
catalog/view/theme/YOUR THEME i.e. MAXSHOP/template/product/product.twig
You then go into your MODIFICATIONS and refresh using the top blue button
and also in DASHBOARD top right cog.
If you still can not get this to work
1. Post a screenshot of your admin ensuring the OC version listed at the bottom can be seen.
and I am completely lost as to why the Availability: Out of stock has come into this ?
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Users browsing this forum: Baidu [Spider] and 219 guests