Jump to content

Issues with loyalty and cart_rule_lang table


Recommended Posts

Hi... I a trying to create a function hooked to new orders that create a new coupon within loyalty module. It worked for version 1.4.x but with I am having issues. Even though I am declaring the field value of the cartRule object I keep seeing a message:


Property CartRule->name is empty

at line 874 in file classes/ObjectModel.php


I am declaring the name value as here, and fillint the language table to test as the commented code:


$COA = new CartRule();

	Db::getInstance()->insert('cart_rule_lang', array(
	'id_cart_rule' => (int)1,
	'id_lang' => (int)1,
	'name'	  => pSQL($COA->name),

	Db::getInstance()->insert('cart_rule_lang', array(
	'id_cart_rule' => (int)1,
	'id_lang' => (int)2,
	'name'	  => pSQL($COA->name),


I looked for the tables and has to do with cart_rule_lang. If I manually fill this table with the id of the cart_rule and the ids of the languages installed and the name property on each language the error does not occur. Do you know if there is a function that does the work of updating the latter table from the name statement instead of executing sql queries directly?



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More