D
D
Darklt2021-07-30 12:40:10
1C-Bitrix
Darklt, 2021-07-30 12:40:10

How to set the available quantity by default by an event when adding a product?

There is a problem that the goods are delivered with a quantity of 0. no value is passed (specially to be unlimited). Events for goods were not found. How to make by default when adding a product that the value "Available Quantity" is substituted for example 100000?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Darklt, 2021-07-30
@Darklt

Configured, put in Init.php

AddEventHandler("sale", "OnProductAdd", "OnProductAdd");
function OnProductAdd(&$ID,$Fields)
{
    $res=Array("QUANTITY"=>"10000000");
    CCatalogProduct::Update($ID,$res);
}

And in the base on QUANTITY the default value is "10000000"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question