Jump to content

jeremiezip

Members
  • Posts

    10
  • Joined

  • Last visited

Profile Information

  • First Name
    Jérémie
  • Last Name
    ZIPFEL

Recent Profile Visitors

357 profile views

jeremiezip's Achievements

Newbie

Newbie (1/14)

  • Dedicated Rare
  • Collaborator Rare
  • First Post Rare
  • Week One Done Rare
  • One Month Later Rare

Recent Badges

5

Reputation

  1. Dont worry. This module works well and everything is fine... The module find and replace infected files. Then he removes in Prestashop the problematic little part of code.
  2. Hello Mathias, Thank you for your module. I looked at the code of your module and I installed it on several sites: useful! Bye
  3. Salut @DCharles Exactement le même problème que toi, en local tout fonctionne mais j'ai cette erreur sur le serveur de prod. J'en suis venu donc à faire la même solution temporaire. Histoire de naming ? De majuscule ? As-tu trouver une solution ? (je regarderais ça de mon côté quand j'aurais un peu de temps) J'ai vu que l'équipe Presta avait fermé ton ticket. Merci d'avance 😉
  4. Another interesting link from the documentation : https://devdocs.prestashop.com/1.7/development/components/grid/tutorials/modify-grid-in-module/ Do a mix of the example and this tutorial and normally, it should be OK.
  5. Hello. Maybe it's too late but this official example of module may help you : https://github.com/PrestaShop/example-modules/tree/master/demoextendgrid Bye.
  6. Hello guys, In 1.6 don't forget to change the query of indexing attribute: In override of blocklayered module, look at the public function "IndexAttribute". Add the following lines in the query (same from above) JOIN `'._DB_PREFIX_.'stock_available` sa ON (sa.`id_product_attribute`= pac.`id_product_attribute` AND sa.`quantity` > 0) So this is the result in my version of Prestashop 1.6 : Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'layered_product_attribute` (`id_attribute`, `id_product`, `id_attribute_group`, `id_shop`) SELECT pac.id_attribute, pa.id_product, ag.id_attribute_group, product_attribute_shop.`id_shop` FROM '._DB_PREFIX_.'product_attribute pa'. Shop::addSqlAssociation('product_attribute', 'pa').' INNER JOIN '._DB_PREFIX_.'product_attribute_combination pac ON pac.id_product_attribute = pa.id_product_attribute INNER JOIN '._DB_PREFIX_.'attribute a ON (a.id_attribute = pac.id_attribute) INNER JOIN '._DB_PREFIX_.'attribute_group ag ON ag.id_attribute_group = a.id_attribute_group JOIN `'._DB_PREFIX_.'stock_available` sa ON (sa.`id_product_attribute`= pac.`id_product_attribute` AND sa.`quantity` > 0) '.(is_null($id_product) ? '' : 'AND pa.id_product = '.(int)$id_product).' GROUP BY a.id_attribute, pa.id_product , product_attribute_shop.`id_shop`' ); After that, clear cache and reindex attributes filters.
  7. Have you refresh the cache of the website? Otherwise, i have some information about our initial problem. I discussed with a Prestashop Teacher. He told me that it is no longer possible to override the admin product. It is done to encourage the exclusive usage of hooks. I don't know if it's a fake news or not, but I think we can believe it.
  8. hello, I edited my post because I realized that I had forgotten a part... sorry. don't forget to add field in your product class.
  9. Of course Lucesmo, I have exactly the same result of you. Pressed for time, i finally modify the product class directly. (symfony doesn't takes the override) But it's a very bad practice... I don't know if it is a new philosophy of prestashop for encourages the usage of AdminProductHook... But I think it is necessary to have an explanation in the official documentation of Presta'. I've send a message to the Prestashop Team. developer Be on, if i solve the problem i forward the code here.
  10. yes, this is my code, it works but it's not a good way because if you update Prestashop, you'll loose all your changes. This is the case of a customer who wants absolutely a textarea field in the product information tpl (not in a hook) : first in database in the table ps_product_lang add your field "my_extra_field_description" type TEXT add an override of class product in override/classes , with the new field (for this case, it doesn't work for me, i adding the field directly in the class, not in a override)... but this is an example class Product extends ProductCore { public $my_extra_field_description; public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null) { Product::$definition['fields']['my_extra_field_description'] = array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString'); parent::__construct($id_product, $full, $id_lang, $id_shop, $context); } } (don't forget to remove the cache) src/PrestaShopBundle/Form/Admin/Product/ProductInformation.php ->add('my_extra_field_description', 'PrestaShopBundle\Form\Admin\Type\TranslateType', array( 'type' => 'Symfony\Component\Form\Extension\Core\Type\TextareaType', 'options' => [ 'attr' => array('class' => 'autoload_rte'), 'required' => false ], 'locales' => $this->locales, 'hideTabs' => true, 'label' => $this->translator->trans('my_extra_field_description', [], 'Admin.Global'), 'required' => false )) in src/PrestaShopBundle/Model/Product/AdminModelAdapter.php: //define translatable key $this->translatableKeys = array( 'name', 'description', 'description_short', 'my_extra_field_description', 'link_rewrite', 'meta_title', 'meta_description', 'available_now', 'available_later', 'tags', ); //define unused key for manual binding $this->unmapKeys = array('name', 'description', 'description_short', 'my_extra_field_description', 'images', 'related_products', 'categories', 'suppliers', 'display_options', 'features', 'specific_price', 'virtual_product', 'attachment_product', ); and below in the function getFormData() add field : 'my_extra_field_description' => $this->product->my_extra_field_description, in src/PrestaShopBundle/Resources/views/Admin/Product/form.html.twig: <ul class="nav nav-tabs bordered"> <li id="tab_description_short" class="nav-item"><a href="#description_short" data-toggle="tab" class="nav-link description-tab active">[spam-filter] 'Summary'|trans({}, 'Admin.Catalog.Feature') [spam-filter]</a></li> <li id="tab_description" class="nav-item"><a href="#description" data-toggle="tab" class="nav-link description-tab">[spam-filter] 'Description vin'|trans({}, 'Admin.Global') [spam-filter]</a></li> <li id="tab_my_extra_field_description" class="nav-item"><a href="#la_presse_en_parle" data-toggle="tab" class="nav-link description-tab">[spam-filter] 'My extra field description'|trans({}, 'Admin.Global') [spam-filter]</a></li> </ul> <div class="tab-content bordered"> <div class="tab-pane panel panel-default active" id="description_short"> [spam-filter] form_widget(form.step1.description_short) [spam-filter] </div> <div class="tab-pane panel panel-default " id="description"> [spam-filter] form_widget(form.step1.description) [spam-filter] </div> <div class="tab-pane panel panel-default " id="my_extra_field_description"> [spam-filter] form_widget(form.step1.my_extra_field_description) [spam-filter] </div> </div><br/> So, if somebody know how to override a bundle ... thanks
  11. Hello phinq, thank you for you reply. Yes i know these hook, very usefull when you creating Module. But i have the case of a customer who specifically wants to add fields in the main info of product BackOffice (not in a hook). Do you have any idea? But I have the case of a client who specifically wants to add fields in the main info of the product (back office But I have the case of a client who specifically wants to add fields in the main info of the product (back office But I have the case of a client who specifically wants to add fields in the main info of the product (back office ut I have the case of a client who specifically wants to add fields in the main info of the product (back office But I have the case of a client who specifically wants to add fields in the main info of the product (back office
  12. Hello everybody, I'have recently installed PS 1.7 for a project. I discover the framework Symfony, and i would like to know the best way for override the Admin Product. (for example: add a field in the product information) I changed these informations directly in the bundle Prestashop, but it is not clean. It would be interesting to talk about it, all together ! Thanks for your contribution, J. I
×
×
  • Create New...