Page 1 of 1

Remove +($XX.XX) from option drop down

Posted: Mon Aug 27, 2012 12:01 pm
by tora0515
I want to get rid of the price increases next to the options in the drop down box on the product page. I am not sure where to look in the controller file (or confident enough to play around with it) to comment the code out.

thanks.

Re: Remove +($XX.XX) from option drop down

Posted: Mon Aug 27, 2012 3:31 pm
by vtrainingroom

Code: Select all

$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']
							);
Find the above code at the catalog/controller/product/product.php

and change the line
'price' => $price,
to
'price' => '',

This will just hide the +xx or -xx but the price is added when you add to cart.

So you have to insert the option price to zero while inserting the product.

Re: Remove +($XX.XX) from option drop down

Posted: Mon Aug 27, 2012 4:14 pm
by vtrainingroom
Inserting the price of option to zero will help.

or

Code: Select all

$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']
							);

change to

Code: Select all

$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_prefix'            => $option_value['price_prefix']
							);
But if you entered the price of option while inserting the product then the price will be added to the cart product so while inserting the product you must enter the price option to be zero.

Re: Remove +($XX.XX) from option drop down

Posted: Tue Aug 28, 2012 6:36 am
by tora0515
That would do it.

I am running a script that auto updates the price based off dropdown selection. When I get rid of $price, the script has no inputs. Any ideas how to work around this?

script for this is here:

http://www.jackwdavis.com/2012/02/22/au ... mment-2600

Re: Remove +($XX.XX) from option drop down

Posted: Fri Oct 12, 2012 4:52 am
by pappley
Did you find a solution? As I am also looking to the answer to this

Re: Remove +($XX.XX) from option drop down

Posted: Fri Oct 12, 2012 4:59 am
by pappley
I would guess that instead of removing it, if there was a way to just hide the price query that would solve the issue. No idea how to do that though

Re: Remove +($XX.XX) from option drop down

Posted: Fri Oct 12, 2012 2:43 pm
by SXGuy
Just edit the template file and remove product option price from being shown. Given the answer here http://forum.opencart.com/viewtopic.php ... 62#p349662

Re: Remove +($XX.XX) from option drop down

Posted: Fri Mar 25, 2016 3:46 pm
by mamta
I had tried the above code but its not working.
Once the code is changed and if i'm refreshing my product page it gives me a blank page.

What do i do now?

Re: Remove +($XX.XX) from option drop down

Posted: Mon Mar 28, 2016 5:42 am
by ADD Creative
You probably made an error making the changes. Restore from a backup and try again.

Re: Remove +($XX.XX) from option drop down

Posted: Fri Mar 24, 2017 1:12 pm
by DesignBuoy
for OC version 2x - go to product.tpl, around line 120, finde code

Code: Select all

          (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>) 

and change to

Code: Select all

   <!--   (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)   -->
Adding comment tags at start & finish hides the php from printing on the page. You could also just rem out the 'echo' only

Re: Remove +($XX.XX) from option drop down

Posted: Mon Aug 28, 2017 9:09 pm
by mupcku
DesignBuoy wrote:
Fri Mar 24, 2017 1:12 pm
for OC version 2x - go to product.tpl, around line 120, finde code

Code: Select all

          (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>) 

and change to

Code: Select all

   <!--   (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)   -->
Adding comment tags at start & finish hides the php from printing on the page. You could also just rem out the 'echo' only
Yes, that really helped me for 2.1.0.1!
Thanks!

Re: Remove +($XX.XX) from option drop down

Posted: Mon Aug 28, 2017 9:42 pm
by MrPhil
Does your customer still see either the full price (base + option), or separate base and option prices before they add the product to their cart? If they see only the base price, and not the option add amount, what you're doing is probably illegal. Be careful.