w .tpl dodałem co trzeba i od strony widoku jest wszystko ok.
do tpl dodałem to
<div class="checkbox"> <label for="discontinued"> <input type="checkbox" name="discontinued" id="discontinued" value="1" {if $product->discontinued}checked="checked"{/if} > Produkt wycofany z produkcji - zostaną pokazane zamienniki</label> </ div>
W AdminProductsController
w metodzie copyFromPost()
dokonałem aktualizacji tego
if ($this->isTabSubmitted('Informations')) { $object->available_for_order = (int) Tools::getValue('available_for_order'); $object->show_price = $object->available_for_order ? 1 : (int) Tools::getValue('show_price'); $object->online_only = (int) Tools::getValue('online_only'); }
na to
if ($this->isTabSubmitted('Informations')) { $object->discontinued = (int) Tools::getValue('discontinued'); $object->available_for_order = (int) Tools::getValue('available_for_order'); $object->show_price = $object->available_for_order ? 1 : (int) Tools::getValue('show_price'); $object->online_only = (int) Tools::getValue('online_only'); }
dodatkowo w metodzie initFormInformations()
zmieniłem
array_push($product_props, 'reference', 'ean13', 'upc', 'available_for_order', 'show_price', 'online_only', 'id_manufacturer' );
na to
array_push($product_props, 'reference', 'ean13', 'upc', 'available_for_order','discontinued', 'show_price', 'online_only', 'id_manufacturer' );
do tabeli _product dodałem oczywiście kolumnę discontinued tinyint(1) default 0
Po zapisaniu produktu nic się nie aktualizuje. O czym jeszcze zapomniałem?
Teraz modyfikuję główne pliki presty. Wiadomo co się stanie po aktualizacji. W związku z tym jak w presta powinno się dokonywać tego typu modyfikacji?