Page 1 of 1

batch_pick_pack

Posted: Sat Feb 17, 2024 2:04 pm
by Xpajun
version 1.0.8.20

I have in my batch_pick_pack an extra column called

Code: Select all

<th><?= PP_PARTS ?></th>
and

Code: Select all

<td><?= $order->products[$i]['parts'] ?></td>
however I'm not getting the information to fill the column.
The data is in orders_products TABLE as a 'products_parts' column -

Code: Select all

          <th><?= PP_OID ?></th>
          <th><?= PP_QTY ?></th>
          <th><?= PP_NAME ?></th>
          <th><?= PP_MODEL ?></th>
          <th><?= PP_OPTIONS ?></th>
          <th><?= PP_PARTS ?></th>
are all in orders_products TABLE so should not ['parts'] show as well?

Re: batch_pick_pack

Posted: Sat Feb 17, 2024 3:23 pm
by ecartz
No, see https://github.com/CE-PhoenixCart/Phoen ... hp#L32-L41 for the list of columns that appear.

Code: Select all

class hook_admin_siteWide_parts {

  public function listen_databaseOrderProductColumns($parameters) {
    $parameters['column_keys']['parts'] = 'products_parts';
  }

}

Re: batch_pick_pack

Posted: Sat Feb 17, 2024 5:56 pm
by Xpajun
ecartz wrote: Sat Feb 17, 2024 3:23 pm No, see https://github.com/CE-PhoenixCart/Phoen ... hp#L32-L41 for the list of columns that appear.

Code: Select all

class hook_admin_siteWide_parts {

  public function listen_databaseOrderProductColumns($parameters) {
    $parameters['column_keys']['parts'] = 'products_parts';
  }

}
Thank you once again Matt
Just checking now - if I add

Code: Select all

          'parts' => 'products_parts',
to the public function on 1.0.7.10/database_order_builder.php will that be ok? Bearing in mind that it's only for my own store

Re: batch_pick_pack

Posted: Sat Feb 17, 2024 6:03 pm
by ecartz
Yes, that will work.

But if you use the hook instead, then you won't have to keep reapplying the change every time we update that file.

Re: batch_pick_pack

Posted: Sat Feb 17, 2024 6:22 pm
by Xpajun
Matt @ecartz Would this be something similar in orders.php where I am trying to add products to the output putting this

Code: Select all

      [
        'name' => TABLE_HEADING_PRODUCTS,
        'function' => function (&$row) {
          return ($row['products_quantity'] . 'x' . ['products_name']);
        },
      ],
in orders/view/defult.php
gives me this:
Image
I realise that I need to select from orders_products and then define 'qty' and 'parts'
but every tie I try to do it on that file I get an unexpected end error

Re: batch_pick_pack

Posted: Sat Feb 17, 2024 9:03 pm
by ecartz
You don't have products in the orders rows. You'd have to alter the query considerably in order to view product information. Or run a new query (or queries) to load that information.