Jump to content

Cómo creo un precio específico?


Recommended Posts

 

Hola estoy intentando hacer un precio específico con el siguiente código sin éxito:

$specificPrice = new SpecificPrice();
        $specificPrice->id_product = $id;
    //    $specificPrice->id_product_attribute = (int)$id_product_attribute;
        $specificPrice->id_shop = 1;
        $specificPrice->id_currency = 0;
        $specificPrice->id_country = Tools::getValue('sp_id_country');
        $specificPrice->id_group = 0;
        $specificPrice->id_customer = 0;
        $specificPrice->price = $precio;
        $r=porcentaje($precio,$precio2);
        $specificPrice->reduction_type="amount";
        $specificPrice->reduction=$precio;
        $specificPrice->from_quantity =(int) $cantidad;
        //$specificPrice->from = (int) $cantidad;
        $specificPrice->add();

Me da el siguiente error: 

La propiedad SpecificPrice->from está vacía

Un saludo

 

Link to comment
Share on other sites

$specific_price = new SpecificPrice();
$specific_price->id_shop = $this->context->shop->id;
$specific_price->id_shop_group = $this->context->shop->id_shop_group;
$specific_price->id_currency = (int) 0;
$specific_price->id_country = (int) 0
$specific_price->id_group = (int) 0;
$specific_price->id_cart = (int) 0;
$specific_price->id_customer = (int) 0
$specific_price->id_product = (int) 0;
$specific_price->id_product_attribute = (int) 0;
$specific_price->price =(float) 0.0;
$specific_price->from_quantity = 1;
$specific_price->reduction = 0;
$specific_price->reduction_type = 'amount';
$specific_price->reduction_tax = 0;
$specific_price->from = '0000-00-00 00:00:00';
$specific_price->to = '0000-00-00 00:00:00';

Precios especificos necesitan las fechas en que están activas.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

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...