Post by SXGuy » Thu Sep 22, 2011 2:01 am

DrJohn wrote:I tried to find the code that sxGuy mentioned in the third or fourth reply to this thread, to add before and after vat prices but I can't find $discount (and hence the correct place to add the extra code) in the category.php file in version 1.5.

Is there an updated version of this code or editing instructions for v1.5 ? Or has my client edited it out perhaps when configuring the cart?
As far as i know 1.5 already seperates the price exlcuding tax and is shown when a tax class is enabled in the product.

Active Member

Posts

Joined
Sun Nov 08, 2009 2:07 am

Post by mannyiscanny » Tue Jan 24, 2012 8:17 pm

I too would like to be able to show my main price ex VAT but underneath have the price as inc VAT. We sell mainly to business but do take orders from consumers (and they need to know the full price inc VAT).

Opencart 1.5.3x allow prices to be shown inc VAT but with the ex VAT in smaller greyed out text underneath. If you opt to select "show prices ex VAT" then the price is shown ex VAT but there is no inc VAT shown underneath in smaller greyed out text. see http://www.secure-usb.com

How do I get the inc VAT in smaller greyed ot text to show on Product pages ?

The solutions above see to be for older versions of Opencart.

Any help would be appreciated

Thanks in advance

New member

Posts

Joined
Thu Jul 21, 2011 8:12 pm

Post by liamcaff » Tue Apr 17, 2012 11:27 pm

I'm having this same issue with 1.5.2.1...

anyone any ideas?

New member

Posts

Joined
Wed Mar 21, 2012 9:20 pm

Post by ozstar » Thu Jul 26, 2012 9:25 am

Anyone get thisn going with 1.5.2.1


I need to display prices with gst tax but show the gst amount on checkout and on invoice.

Any help?

oz

Active Member

Posts

Joined
Fri Mar 09, 2012 7:47 am
Location - Sydney OZ

Post by emmetje » Tue Apr 23, 2013 5:41 pm

I've developed a vQmod for this, check it on: http://www.opencart.com/index.php?route ... n_id=11573

User avatar
New member

Posts

Joined
Wed Jun 22, 2011 2:18 am

Post by jacktham » Mon May 11, 2015 3:30 pm

SXGuy ,i tried to find the code that you mentioned in the third or fourth reply to this thread, to add before and after vat prices but I can't find $discount (and hence the correct place to add the extra code) in the category.php file in version 1.5.5.1

Is there an updated version of this code or editing instructions for v1.5 ?

Newbie

Posts

Joined
Sat Apr 11, 2015 3:46 pm

Post by spottedhaggis » Mon Nov 02, 2015 6:35 am

Can anyone offer any assistance here with this. I too, like many others have a cart that has the prices displaying without the VAT being added until its added to the cart.
Im using price by options mod, because the standard products are all sold in various different numbers, 1, 10, 20 etc, each one has a price.
I dont need it to be terribly clean, all I need is that when the end user is looking at the list of options for a product they see it as this

1. 10 units = £10.00 (£12.00 Incl Vat)
2. 30 units = £20.00 (£24.00 Incl Vat)

I dont need it to add the incl vat field, only display it alongside the non VAT price, and because its all UK selling it can be a simple math in the php code, but im no coder

here is where I think it should go in the control file for products (though I could be wrong)

Code: Select all

$this->data['options'] = array();
			
			foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) { 
				if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') { 
					$option_value_data = array();
					
					foreach ($option['option_value'] as $option_value) {
						if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
							if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) {
								$price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
							} else {
								$price = false;
							}
							
							$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']
							);
						}
And this is the template file itself

Code: Select all

 <?php if ($option['type'] == 'radio') { ?>
        <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
          <?php if ($option['required']) { ?>
          <span class="required">*</span>
          <?php } ?>
          <b><?php echo $option['name']; ?>:</b><br />
          <?php foreach ($option['option_value'] as $option_value) { ?>
          <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
          <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
            <?php if ($option_value['price']) { ?>
            (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?><span style="color: #900; font-weight: bold;"><?php echo $options_value[$j]['exprice']; ?><?php echo $text_ex_price; ?></span><br />)
            <?php } ?>
          </label>
          <br />
Any help is appreciated.

Active Member

Posts

Joined
Tue Jun 26, 2012 11:20 pm

Post by spottedhaggis » Tue Nov 03, 2015 5:39 am

ok so I have figured out a way of doing this now, its a fudge but it does display the prices as I need them for all product options, so I am happy.

3 file changes (additions) and a new db table with a query being run solved the issue. Id say thanks for the help, but in all honesty nothign that was posted here was able to help, because I price by options not products O0

Active Member

Posts

Joined
Tue Jun 26, 2012 11:20 pm

Post by dgpruk » Mon Apr 03, 2017 12:46 am

Okay, so this really is driving me nuts. I am looking to display (only on my product page) Including Tax next to my excluding price, for example, Exc. Tax = £10.00 (Inc Tax = £12.00) I know you can do it the other way around as standard but i need the product prices in the invoice and everywhere else excluding tax. This post looks like it should work but I just cant get it to work on 2.3.0.2, my php is rusty but still cant see where i am going wrong. Does anyone have this already solved as have search for days and cant find anything. Please help. I assume the controller>product.php and view>product.tpl are the only 2 files i need to edit??

Newbie

Posts

Joined
Mon Apr 03, 2017 12:30 am
Who is online

Users browsing this forum: No registered users and 79 guests