Jump to content



- - - - -

Tax error message


This topic has been archived. This means that you cannot reply to this topic.
12 replies to this topic

#1   optipack

optipack
  • Members
  • 45 posts

Posted 16 July 2012 - 03:11 PM

I am trying to add tax to my products but I have an error message where you insert a new product and a drop down box isn't appearing anywhere

The error message:

. ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?>


My settings for the tax zones, tax classes and tax rates are as follows:
Locations/Taxes
Tax Zones:
UK >> United Kingdom

Tax Classes:
Taxable Goods

Tax Rates:
Priority - 1, Tax Class - Taxable Goods, Zone - UK, Tax Rate - 20.00%

Could anyone help and tell me what I am doing wrong and how to fix it please?

Thanks

#2   kenkja

kenkja
  • Members
  • 249 posts

Posted 16 July 2012 - 06:12 PM

@optipack

Futher to our conversation earlier today, I deleted a country from my tax zones, it didn't replicate your issue.

So my guess is your problem is nothing to do, countries not being a tax zone

ken
Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags
Ultimate SEO Urls Pro

#3   germ

germ
  • Members
  • 13,921 posts

Posted 16 July 2012 - 08:40 PM

It's not an error, it's raw php code displaying because of a syntactical error in the source.

Find the line in the source file and post the code 10 lines on either side.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#4   optipack

optipack
  • Members
  • 45 posts

Posted 17 July 2012 - 08:51 AM

@germ

<?php
	for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
		  <tr>
			<td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>
			<td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>
		  </tr>
<?php
	}
?>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
		  </tr>
		  <tr bgcolor="#ebebff">
	<td class="main"><?php echo TEXT_PRODUCTS_PRICE_COST; ?></td>
	<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_cost', $pInfo->products_cost, ''); ?></td>
  </tr>
  <tr bgcolor="#ebebff">
	<td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
	<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price', $pInfo->products_price, 'onkeyup="updateGross()"'); ?></td>
  </tr> . '&nbsp;[color=#ff0000]'[b] . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>
		  </tr>
		  <tr bgcolor="#ebebff">
			<td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
			<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price', $pInfo->products_price, 'onkeyup="updateGross()"'); ?></td>
		  </tr>
		  <tr bgcolor="#ebebff">
			<td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
			<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'onkeyup="updateNet()"'); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
		  </tr>
<script type="text/javascript"><!--
updateGross();
//--></script>
<?php
	for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
		  <tr>
			<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
			<td><table border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
				<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>
			  </tr>
			</table></td>
		  </tr>
<?php
	}
?>

Can someone have a look at what is wrong and let me know how to fix it please?

Thanks

Edited by optipack, 17 July 2012 - 08:53 AM.


#5   germ

germ
  • Members
  • 13,921 posts

Posted 17 July 2012 - 10:22 AM

This code:

</tr> . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?> </td>

Should be:

</tr><?php echo ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?> </td>
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#6   optipack

optipack
  • Members
  • 45 posts

Posted 17 July 2012 - 10:38 AM

@germ

I have just tried changing the code you suggested, however, I am still getting the same section of raw code that was there before.

Do you have any other ideas?

Thanks for your help so far

#7   germ

germ
  • Members
  • 13,921 posts

Posted 17 July 2012 - 10:40 AM

Be sure the changed file is on the server where you think it is.

Hold the <Ctrl> key down and do a page referesh in the browser to force it to reload the new page.
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#8   optipack

optipack
  • Members
  • 45 posts

Posted 17 July 2012 - 10:49 AM

I have refreshed the page and still getting the same :/

The code now looks like:

<?php
	}
?>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
		  </tr>
		  <tr bgcolor="#ebebff">
	<td class="main"><?php echo TEXT_PRODUCTS_PRICE_COST; ?></td>
	<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_cost', $pInfo->products_cost, ''); ?></td>
  </tr>
  <tr bgcolor="#ebebff">
	<td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
	<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price', $pInfo->products_price, 'onkeyup="updateGross()"'); ?></td>
  </tr><?php echo ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?> </td>
		  </tr>
		  <tr bgcolor="#ebebff">
			<td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>
			<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price', $pInfo->products_price, 'onkeyup="updateGross()"'); ?></td>
		  </tr>
		  <tr bgcolor="#ebebff">
			<td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>
			<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_price_gross', $pInfo->products_price, 'onkeyup="updateNet()"'); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
		  </tr>
<script type="text/javascript"><!--
updateGross();
//--></script>
<?php
	for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
?>
		  <tr>
			<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
			<td><table border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td class="main" valign="top"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
				<td class="main"><?php echo tep_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '70', '15', (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>
			  </tr>
			</table></td>
		  </tr>
<?php
	}
?>

Thanks

#9   14steve14

14steve14

    STORE OWNER NOT CODER

  • Members
  • 3,436 posts

Posted 17 July 2012 - 10:58 AM

What happens if you copy the code section from a standard install file of oscommerce and replace yours. Does it then work. If not try replacing the whole of the categories file with a standard file and see what happens.
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder, so dont bother sending PMs asking for help as you wont get any.


The pessimist sees difficulty in every opportunity. The optimist sees the opportunity in every difficulty

#10   optipack

optipack
  • Members
  • 45 posts

Posted 17 July 2012 - 11:09 AM

I have sorted it!

Used the code that @germ suggested and now it's working :)

</tr><?php echo ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?> </td>

Thanks for your hep! Much appreciated! :)

#11   optipack

optipack
  • Members
  • 45 posts

Posted 17 July 2012 - 11:27 AM

OK, so I have got rid of that raw code now. But how do I display the products to show tax?

#12   14steve14

14steve14

    STORE OWNER NOT CODER

  • Members
  • 3,436 posts

Posted 17 July 2012 - 11:31 AM

Log in to your admin are and in configuration my store set display prices with tax to true
REMEMBER BACKUP, BACKUP AND BACKUP
I am not a coder, so dont bother sending PMs asking for help as you wont get any.


The pessimist sees difficulty in every opportunity. The optimist sees the opportunity in every difficulty

#13   optipack

optipack
  • Members
  • 45 posts

Posted 17 July 2012 - 11:40 AM

Just figured that out! Thanks :)