tgonzalez Posted July 26, 2019 Share Posted July 26, 2019 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 More sharing options...
roja45 Posted July 26, 2019 Share Posted July 26, 2019 $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. 1 Link to comment Share on other sites More sharing options...
juanrojas Posted August 5, 2019 Share Posted August 5, 2019 Pero no se supone que el precio especifico se crea desde el back sin tocar el codigo? Link to comment Share on other sites More sharing options...
roja45 Posted August 5, 2019 Share Posted August 5, 2019 Si claro, pero esto fue publicado en el foro de desarrolladores. Si quiere saber cómo crear un precio especifico desde el back office, esto se explica en la documentación. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now