Jump to content

Editing Tax Rule getting error: Bad SQL query Column 'name' in where clause is ambiguous


Recommended Posts

Hi,

 

Whenever I edit the tax rule for Canada, I always get this error:

 

Bad SQL query Column 'name' in where clause is ambiguous

 

even though in database I could see the records has already been inserted, I tried many different method and eventually found, this is a glitch in this project, if any senior could shed a light on this issue or I'm the only one who is experiencing this issue?

 

 

Quick help would be much appreciate!

 

Nadeem

Edited by N@D33M (see edit history)
Link to comment
Share on other sites

please turn on error reporting: http://www.prestasho...-or-blank-page/

 

then you will see a bit more information in which query you've got this issue, then i will be able to say something more what you have to change

 

Thanks Vekia,

 

Here is the test case:

 

- Created a new Tax Rule with name Canada1

- Access the Tax Rule listing page

- Search the can to filter out the result to see only records having can

- Now click the searched record and it gives something like that error.

 

 

SELECT SQL_CALC_FOUND_ROWS
	 a.*
	,
		c.`name` AS country_name,
		s.`name` AS state_name,
		CONCAT_WS(" - ", a.`zipcode_from`, a.`zipcode_to`) AS zipcode,
		t.rate
	FROM `ps_tax_rule` a


		LEFT JOIN `ps_country_lang` c
			ON (a.`id_country` = c.`id_country` AND id_lang = 1)
		LEFT JOIN `ps_state` s
			ON (a.`id_state` = s.`id_state`)
		LEFT JOIN `ps_tax` t
			ON (a.`id_tax` = t.`id_tax`)

	WHERE 1 AND `id_tax_rules_group` = 61  AND `name` LIKE '%can%'


	ORDER BY id_tax_rules_group ASC LIMIT 0,50

 

 

 

It's Glitch to my knowledge.

 

If you don't set any filter and simply go to next page and click any record, it will show the desired results.

Edited by N@D33M (see edit history)
Link to comment
Share on other sites

  • 10 months later...
  • 4 months later...
  • 1 month later...

I have exaclty the same problem, when I click on "tax rules in backoffice" this message I get:

  • Bad SQL query
    Unknown column 'a.deleted' in 'where clause'

 

If I want to create a new Tax rule and when I want to save then I get this error message:

 

An error occurred while creating an object. tax_rules_group (Unknown column 'deleted' in 'field list')

 

I saw in a spanish thread similar problem but I did not understand the solution.

 

Anybody with a solution?

Thanks

Link to comment
Share on other sites

  • 3 weeks later...

I have exaclty the same problem, when I click on "tax rules in backoffice" this message I get:

  • Bad SQL query

    Unknown column 'a.deleted' in 'where clause'

 

If I want to create a new Tax rule and when I want to save then I get this error message:

 

An error occurred while creating an object. tax_rules_group (Unknown column 'deleted' in 'field list')

 

I saw in a spanish thread similar problem but I did not understand the solution.

 

Anybody with a solution?

Thanks

 

Hello. I get the exact same error - did you solve it? How?

Link to comment
Share on other sites

Yes I could solve it.

 

I logged in to my hosting provider then in cPanel I went to phpMyAdmin. There i run the following SQL command:

 

ALTER TABLE `PREFIX_tax_rules_group` ADD `deleted` TINYINT(1) UNSIGNED NOT NULL, ADD `date_add` DATETIME NOT NULL, ADD `date_upd` DATETIME NOT NULL;
ALTER TABLE `PREFIX_order_detail` ADD `id_tax_rules_group` INT(11) UNSIGNED DEFAULT '0' AFTER `product_weight`, ADD INDEX `id_tax_rules_group` (`id_tax_rules_group`);
 
 
You should replace in this command the PREFIX_ with your database prefix in my case it is PS_ (Ithink that is the default Prestashop prefix.)
 
This command alter the tax rule table and adds the "deleted" field if it not exists.
 
After I ran this I got back even all the pre-installed tax rules as well and was able to create new ones.
 
Hope it works for you too.
 
Good luck
Link to comment
Share on other sites

 

Yes I could solve it.

 

I logged in to my hosting provider then in cPanel I went to phpMyAdmin. There i run the following SQL command:

 

ALTER TABLE `PREFIX_tax_rules_group` ADD `deleted` TINYINT(1) UNSIGNED NOT NULL, ADD `date_add` DATETIME NOT NULL, ADD `date_upd` DATETIME NOT NULL;
ALTER TABLE `PREFIX_order_detail` ADD `id_tax_rules_group` INT(11) UNSIGNED DEFAULT '0' AFTER `product_weight`, ADD INDEX `id_tax_rules_group` (`id_tax_rules_group`);
 
 
You should replace in this command the PREFIX_ with your database prefix in my case it is PS_ (Ithink that is the default Prestashop prefix.)
 
This command alter the tax rule table and adds the "deleted" field if it not exists.
 
After I ran this I got back even all the pre-installed tax rules as well and was able to create new ones.
 
Hope it works for you too.
 
Good luck

 

 

 

It work again now. Thanks very much! But how do I get it to show the VAT in the shopping cart? Can anyone here help, please?

Edited by magick98 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...