Page 1 of 1

hide price options in OC 3

Posted: Sat Mar 24, 2018 4:55 am
by opensab677
About removing prices next to options as in this image http://prntscr.com/ivi1rb ....I have followed this topic regarding opencart 2.x http://forum.opencart.com/viewtopic.php?t=82023, but it doesn't work on OC3.
Any suggestions?
thanks

Re: hide price options in OC 3

Posted: Sat Mar 24, 2018 5:26 am
by straightlight
Remove the mentioned lines entirely rather commenting them out and make a backup.

Re: hide price options in OC 3

Posted: Sat Mar 24, 2018 3:57 pm
by opensab677
in catalog/controller/product/product.php
$product_option_value_data[] = array(
'product_option_value_id' => $option_value['product_option_value_id'],
'option_value_id' => $option_value['option_value_id'],
'name' => $option_value['name'],
'image' => $this->model_tool_image->resize($option_value['image'], 50, 50),
'price' => $price,
'price_prefix' => $option_value['price_prefix']
);
}
removed line 328 .... 'price' => $price,
I have also changed in 'price' => '',
but doesn't work

Re: hide price options in OC 3

Posted: Sat Mar 24, 2018 5:16 pm
by opensab677
Solved !
in catalog/view/theme/mytheme/template/product/product.twig

{% if option.type == 'radio' %}
<div class="form-group{% if option.required %} required {% endif %}">
<label class="control-label">{{ option.name }}</label>
<div id="input-option{{ option.product_option_id }}">
{% for option_value in option.product_option_value %}
<div class="radio">
<label>
<input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" />
{% if option_value.image %} <img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" class="img-thumbnail" /> {% endif %}
{{ option_value.name }}
{% if option_value.price %}
>>>> SEE HERE {# ({{ option_value.price_prefix }}{{ option_value.price }}) comment this line to hide price options #}
{% endif %}
</div>
{% endfor %}
</div>
</div>
{% endif %}

Re: hide price options in OC 3

Posted: Tue Aug 21, 2018 5:50 pm
by FazalFariz
Can anyone explain me what to change and how to change it in order to remove the option prices showing?

I'm in OC 3 and using Journal theme

Re: hide price options in OC 3

Posted: Tue Aug 21, 2018 5:52 pm
by straightlight
The instructions are posted … right above. However, since you use Journal theme, contact the Journal support for assistance.

Re: hide price options in OC 3

Posted: Tue Aug 25, 2020 2:43 pm
by gabbya
Hi
1. Log in to admin
2. Navigate to Design>Theme Editor
3. Open product/product.twig
4. Line 374 Replace {% if option_value.price and optionPrice %} to {% if not option_value.price and optionPrice %}
5. Save and go to see the change in the Product option price.

Love Opencart :-*

Re: hide price options in OC 3

Posted: Mon Aug 23, 2021 5:53 pm
by madmikefalkirk
hello my twig file seems slightly different, tried a few bits, nothing seemed to hide the option price showing :-( no themes, only one mod which is a different option mod

{% if option.type == 'radio' %}
<div class="form-group{% if option.required %} required {% endif %}">
<label class="control-label">{{ option.name }}</label>
<div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
<div class="radio">
<label>
<input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" />
{% if option_value.image %} <img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" class="img-thumbnail" /> {% endif %}
{{ option_value.name }}
{% if option_value.price %}
({{ option_value.price_prefix }}{{ option_value.price }})
{% endif %} </label>

Re: hide price options in OC 3

Posted: Mon Aug 23, 2021 6:31 pm
by Gergely
madmikefalkirk wrote:
Mon Aug 23, 2021 5:53 pm
hello my twig file seems slightly different, tried a few bits, nothing seemed to hide the option price showing :-( no themes, only one mod which is a different option mod

{% if option.type == 'radio' %}
<div class="form-group{% if option.required %} required {% endif %}">
<label class="control-label">{{ option.name }}</label>
<div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
<div class="radio">
<label>
<input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" />
{% if option_value.image %} <img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" class="img-thumbnail" /> {% endif %}
{{ option_value.name }}
{% if option_value.price %}
({{ option_value.price_prefix }}{{ option_value.price }})
{% endif %}
</label>
Make a backup and remove the bold text. Probably. But again: this is not a Journal support forum.

Re: hide price options in OC 3

Posted: Mon Aug 23, 2021 6:55 pm
by madmikefalkirk
i dont have journal, on my install its pretty much bare bones, will try this

Re: hide price options in OC 3

Posted: Mon Aug 23, 2021 6:59 pm
by madmikefalkirk
did not seem to change anything (cleared cashe ect and ctrl+f5)

Re: hide price options in OC 3

Posted: Mon Aug 23, 2021 7:02 pm
by madmikefalkirk

Re: hide price options in OC 3

Posted: Mon Aug 23, 2021 8:11 pm
by Gergely
Gergely wrote:
Mon Aug 23, 2021 6:31 pm
madmikefalkirk wrote:
Mon Aug 23, 2021 5:53 pm
hello my twig file seems slightly different, tried a few bits, nothing seemed to hide the option price showing :-( no themes, only one mod which is a different option mod

{% if option.type == 'radio' %}
<div class="form-group{% if option.required %} required {% endif %}">
<label class="control-label">{{ option.name }}</label>
<div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
<div class="radio">
<label>
<input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" />
{% if option_value.image %} <img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" class="img-thumbnail" /> {% endif %}
{{ option_value.name }}
{% if option_value.price %}
({{ option_value.price_prefix }}{{ option_value.price }})
{% endif %}
</label>
Make a backup and remove the bold text. Probably. But again: this is not a Journal support forum.

madmikefalkirk wrote:
Mon Aug 23, 2021 6:59 pm
did not seem to change anything (cleared cache ect and ctrl+f5)
Well, that is for radio type options only. You would need to do this for all types separately.

But I'm glad you found an extension. Just go with that solution, that way you can avoid manually modifying any template files.

Re: hide price options in OC 3

Posted: Mon Aug 23, 2021 8:46 pm
by madmikefalkirk
it was a radio button option i was using too :-p

Re: hide price options in OC 3

Posted: Mon Aug 23, 2021 10:05 pm
by Gergely
Gergely wrote:
Mon Aug 23, 2021 8:11 pm
Gergely wrote:
Mon Aug 23, 2021 6:31 pm
madmikefalkirk wrote:
Mon Aug 23, 2021 5:53 pm
hello my twig file seems slightly different, tried a few bits, nothing seemed to hide the option price showing :-( no themes, only one mod which is a different option mod

{% if option.type == 'radio' %}
<div class="form-group{% if option.required %} required {% endif %}">
<label class="control-label">{{ option.name }}</label>
<div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
<div class="radio">
<label>
<input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" />
{% if option_value.image %} <img src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" class="img-thumbnail" /> {% endif %}
{{ option_value.name }}
{% if option_value.price %}
({{ option_value.price_prefix }}{{ option_value.price }})
{% endif %}
</label>
Make a backup and remove the bold text. Probably. But again: this is not a Journal support forum.
Well, that is for radio type options only. You would need to do this for all types separately.
But I'm glad you found an extension. Just go with that solution, that way you can avoid manually modifying any template files.
madmikefalkirk wrote:
Mon Aug 23, 2021 7:02 pm
https://www.opencart.com/index.php?rout ... b173ce7f4a

found this ocmod for free !
The solution I suggested has been tested on a bare bones, no-mod, fresh vanilla opencart (3.0.3.7) installation, and it works. (Obviously, since any opportunity to render the option price is removed from the view...) If it's not working for you, the culprit is probably the "different option mod" you mentioned before.

Also, the link to the extension that worked for you is not universal. Please update this, so it can be followed! Then, if you consider the issue resolved, please add [Solved] to the topic title.

Re: hide price options in OC 3

Posted: Tue Jun 21, 2022 11:54 pm
by Satya - Safiramedia
madmikefalkirk wrote:
Mon Aug 23, 2021 7:02 pm
https://www.opencart.com/index.php?rout ... n_id=12331

found this ocmod for free !

 
heeyy... help me somebodyyy.... i was using ocmod for freee,,, but doesn't work.. and get an errorrr for my website... like picture in the below

Re: hide price options in OC 3

Posted: Wed Jun 22, 2022 10:15 am
by straightlight
Satya - Safiramedia wrote:
Tue Jun 21, 2022 11:54 pm
madmikefalkirk wrote:
Mon Aug 23, 2021 7:02 pm
https://www.opencart.com/index.php?rout ... n_id=12331

found this ocmod for free !

 
heeyy... help me somebodyyy.... i was using ocmod for freee,,, but doesn't work.. and get an errorrr for my website... like picture in the below
Contact the extension developer to resolve this issue. Otherwise, you could always create a new service request in the Commercial Support section of the forum to have this issue solved as a custom job.

Re: hide price options in OC 3

Posted: Wed May 03, 2023 6:12 pm
by botva
it's a bit simply, just delete this line

Code: Select all

<h2>{{ price }}</h2>
if you need to hide action prices, delete this line also

Code: Select all

<h2>{{ special }}</h2>

Re: hide price options in OC 3

Posted: Thu May 04, 2023 4:41 am
by straightlight
botva wrote:
Wed May 03, 2023 6:12 pm
it's a bit simply, just delete this line

Code: Select all

<h2>{{ price }}</h2>
if you need to hide action prices, delete this line also

Code: Select all

<h2>{{ special }}</h2>
For the default theme, maybe. However, the original request on the topic was in regard to Journal Framework which is not supported on the forum.