Post by tora0515 » Mon Aug 27, 2012 12:01 pm

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.

Active Member

Posts

Joined
Fri Jun 15, 2012 3:05 pm

Post by vtrainingroom » Mon Aug 27, 2012 3:31 pm

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.

Image

www.vtrainingroom.com
www.vtraininggames.com
www.hostsonar.com


User avatar
Newbie

Posts

Joined
Mon Aug 27, 2012 2:11 pm


Post by vtrainingroom » Mon Aug 27, 2012 4:14 pm

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.

Image

www.vtrainingroom.com
www.vtraininggames.com
www.hostsonar.com


User avatar
Newbie

Posts

Joined
Mon Aug 27, 2012 2:11 pm


Post by tora0515 » Tue Aug 28, 2012 6:36 am

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

Active Member

Posts

Joined
Fri Jun 15, 2012 3:05 pm

Post by pappley » Fri Oct 12, 2012 4:52 am

Did you find a solution? As I am also looking to the answer to this

Newbie

Posts

Joined
Mon Jul 09, 2012 4:12 am

Post by pappley » Fri Oct 12, 2012 4:59 am

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

Newbie

Posts

Joined
Mon Jul 09, 2012 4:12 am

Post by SXGuy » Fri Oct 12, 2012 2:43 pm

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

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by mamta » Fri Mar 25, 2016 3:46 pm

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?

Newbie

Posts

Joined
Fri Mar 25, 2016 3:45 pm

Post by ADD Creative » Mon Mar 28, 2016 5:42 am

You probably made an error making the changes. Restore from a backup and try again.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by DesignBuoy » 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

Kind Regards
Design Buoy / ADG Hosting
Opencart Hosting | Opencart Modules | Opencart Design & Templates


Newbie

Posts

Joined
Wed Jul 13, 2016 12:48 pm

Post by mupcku » Mon Aug 28, 2017 9:09 pm

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!

https://wedeom.bg
Image


Active Member

Posts

Joined
Tue Jan 24, 2017 8:12 pm

Post by MrPhil » Mon Aug 28, 2017 9:42 pm

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.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm
Who is online

Users browsing this forum: No registered users and 25 guests