batch_pick_pack

Open to all! Ask other shopowners for help.
Post Reply
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

batch_pick_pack

Post 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?
Current Store is now running 1.0.9.0 - php 8.2.18
Now working on taking a short rest :D - php 8.2.18


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: batch_pick_pack

Post 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';
  }

}
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

Re: batch_pick_pack

Post 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
Current Store is now running 1.0.9.0 - php 8.2.18
Now working on taking a short rest :D - php 8.2.18
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: batch_pick_pack

Post 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.
Xpajun
Contributor
Posts: 187
Joined: Thu Mar 04, 2021 1:18 pm
Phoenix Version: v1.0.9.0
Has thanked: 3 times
Been thanked: 6 times

Re: batch_pick_pack

Post 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
Last edited by Xpajun on Sat Feb 17, 2024 10:16 pm, edited 1 time in total.
Current Store is now running 1.0.9.0 - php 8.2.18
Now working on taking a short rest :D - php 8.2.18
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: batch_pick_pack

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


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply