Jump to content

Cart Rule creation with db class


auroraz

Recommended Posts

Hi, 
 
I tried to add one raw to cart rule table by using db class. Here is the code, but not working. This is just a part of what i will do. But I am really curious about this part, why this code can not inject any row into cart rule table? 
 
PS version 1.6
 
Thanks, 


include 'config/config.inc.php';
 
Db::getInstance()->insert('". _DB_PREFIX_."cart_rule', array(
    'id_customer' => 1,
    'date_from'      => '2014-12-01 15:11:45',
    'date_to' => '2014-12-31 23:59:00',
    'description' => 'Some campaign',
    'quantity' => 0 ,
    'quantity_per_user'  => 1,
    'priority'  => 1,
    'partial_use'  => 0,
    'code' => 'code123',
    'minimum_amount'  => '20.00',
    'minimum_amount_tax'  => 1,
    'minimum_amount_currency'  => 1,
    'minimum_amount_shipping'  => 0,
    'country_restriction'  => 0,
    'carrier_restriction'  =>  0,
    'group_restriction'  =>  0,
    'cart_rule_restriction'  =>  0,
    'product_restriction'  => 0 ,
    'shop_restriction' => 0,
    'free_shipping' => 0 ,
    'reduction_percent' => '15.00',
    'reduction_amount' => '0.00',
    'reduction_tax' => 0,
    'reduction_currency' => 1,
    'reduction_product' => 0,
    'gift_product' => 0,
    'gift_product_attribute' => 0,
    'highlight' => 1,
    'active'  => 1,
 
));

Link to comment
Share on other sites

×
×
  • Create New...