Jump to content

EAN su dettaglio ordine


daninapoli

Recommended Posts

8 ore fa, ziobudda dice:

Ci sono gli hook per quella versione di PS (finalmente!!!!). Cerca "prestashop hook grid system". Devi crearti un piccolo modulo custom che sfrutta uno di quegli hook per aggiungere la colonna.

M.

Diciamo che per me un po' difficile.. sono ancora poco pratico... vediamo cosa riesco a capire...
Non so come crearlo.
Ma non posso modificare direttamente il file dove scrive quelle voci ?
 

Link to comment
Share on other sites

scusami il file orderdetail.tlp

        $this->product_id = (int) $product['id_product'];
        $this->product_attribute_id = $product['id_product_attribute'] ? (int) $product['id_product_attribute'] : 0;
        $this->id_customization = $product['id_customization'] ? (int) $product['id_customization'] : 0;
        $this->product_name = $product['name'] .
            ((isset($product['attributes']) && $product['attributes'] != null) ?
                ' (' . $product['attributes'] . ')' : '');

        $this->product_quantity = (int) $product['cart_quantity'];
        $this->product_ean13 = empty($product['ean13']) ? null : pSQL($product['ean13']);
        $this->product_isbn = empty($product['isbn']) ? null : pSQL($product['isbn']);
        $this->product_upc = empty($product['upc']) ? null : pSQL($product['upc']);
        $this->product_mpn = empty($product['mpn']) ? null : pSQL($product['mpn']);
        $this->product_reference = empty($product['reference']) ? null : pSQL($product['reference']);
 

scrive quella griglia di dettaglio ?

Link to comment
Share on other sites

Ho creato un modulo con ModuleValidator
nel file Php ho inserito questo codice:

    public function hookDisplayOrderDetail()
    {
    {% if product.name is not empty %}
        <p class="mb-0 productSupplierReference">
          {{ 'Codice EAN:'|trans({}, 'Admin.Orderscustomers.Feature') }}
          {{ product.Ean13 }}
        </p>
        <p class="mb-0 productSupplierReference">
          {{ 'Codice Mpn:'|trans({}, 'Admin.Orderscustomers.Feature') }}
          {{ product.mpn }}
        </p>
          {% endif %}    
    }
 

la parte sql se serve dove va inserita ?

Link to comment
Share on other sites

Essendo inesperto nel creare un modulo, sono riuscita in questo momento ad avere le aggiunte che mi interessavano modificando il codice  dove mi serviva,

esattamente ho modificato:

product.html.twig ( src\PrestaShopBundle\Resources\views\Admin\Sell\Order\Order\Blocks\View )
OrderProductForViewing.php ( src\core\domain\order\queryresult)
GetOrderProductsForViewingHandler.php( src\adpter\order\quesryhandler)

Sicuramente non è la soluzione giusta.
Proverò a creare un modulo appena ho un attimo, seguendo le guide o qualche tutorial. (anzi se qualcuno indica qualche link sarebbe ).

Intanto saluti.
Spero di aggiornare il post con il modulo a corredo se dovesse servire a qualcuno.

Link to comment
Share on other sites

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