S05e01 - Batch Actions QUESTIONS/SUPPORT

Open to all! Ask other shopowners for help.
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: S05e01 - Batch Actions

Post by 14Steve14 »

Hi

I have had a search of this thread but cannot find that anyone has asked anything similar.

Currently the Batch actions list shows only a few orders. When we select the payment status of payment received it shows a list of all the orders that have been paid for, which is good and at the bottom of the page will say something like 15 of 45. The trouble being it only shows 15 orders to a page. To change the number that can be viewed we have to change the configuration - maximum values- search results to a higher figure.

Is there a way of increasing the number shown on the page without adjusting the search results figure as that affects lots of other aeras through the store on both admin and shop. The older version that we use has a setting in the code that allows the user to show more via the $orders_split code but that does not look the same in the latest version.

Tags:


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: S05e01 - Batch Actions

Post by burt »

In the main admin file, find this area (approx L100 or so);

Code: Select all

'count_text' => TEXT_DISPLAY_NUMBER_OF_ORDERS,
'page' => $_GET['page'] ?? null,
'sql' => $orders_sql,
Add an extra line to this, as so:

Code: Select all

'count_text' => TEXT_DISPLAY_NUMBER_OF_ORDERS,
'page' => $_GET['page'] ?? null,
'rows_per_page' => 99,
'sql' => $orders_sql,
Change 99 to whatever number you wish to show..
That should do it. Untested.
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: S05e01 - Batch Actions

Post by 14Steve14 »

Cheers Gary. I will try later and let you know how I get on.
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: S05e01 - Batch Actions

Post by 14Steve14 »

burt wrote: Tue Apr 02, 2024 9:09 am In the main admin file, find this area (approx L100 or so);

Code: Select all

'count_text' => TEXT_DISPLAY_NUMBER_OF_ORDERS,
'page' => $_GET['page'] ?? null,
'sql' => $orders_sql,
Add an extra line to this, as so:

Code: Select all

'count_text' => TEXT_DISPLAY_NUMBER_OF_ORDERS,
'page' => $_GET['page'] ?? null,
'rows_per_page' => 99,
'sql' => $orders_sql,
Change 99 to whatever number you wish to show..
That should do it. Untested.
Gary. Many thanks. That work as expected. Now we can adjust the number of orders showing.
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Problem with batch actions Delivery CSV

Post by 14Steve14 »

In the final testing on my new website and we are starting to test the batch actions admin tool which includes the delivery csv modules. Everything seems to work as it should apart from the order total weight. It only seems to be picking the weight of one or two products.

The bit of code is

Code: Select all

// weights
    $applied_weight = 0;
    foreach ($order->products as $k => $v) {
// grab the weight of the product
      $weight_query = $GLOBALS['db']->query("select products_weight from products where products_id = '" . (int)$v['id'] . "'");
      $weight = $weight_query->fetch_assoc();

      $applied_weight = ($weight['products_weight'] * $v['qty']);
    }
This only seems to be grabing the price of a product not the order total weight. Am I misinterpreting what it is doing. I would like it to grab the order total weight which may contain several different products in different quantities. In the test orders we tried one order in particular included several items that weights just over 1kg but the total in the CSV was only 0.040 which was the weight of the first item in the order.

What needs to be changed to export the total order weight.
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Problem with batch actions Delivery CSV

Post by burt »

$applied_weight += ($weight['products_weight'] * $v['qty']);

Add in that + and see if it looks correct.
I am not here to build for you.
I am here to build with you. Let's help each other.
14Steve14
Senior Contributor
Posts: 920
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Problem with batch actions Delivery CSV

Post by 14Steve14 »

Gary

That was quick. The change does seem to work. I will try creating some more test orders and check the weights on them to see if it is working correctly.
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: S05e01 - Batch Actions

Post by Xpajun »

My current batch_pick_pack.php has the following starting line 28:

Code: Select all

  <div class="table-responsive">
    <table class="table table-striped table-hover">
      <thead class="thead-dark">
        <tr>
          <th><?= PP_OID ?></th>
          <th><?= PP_QTY ?></th>
          <th><?= PP_NAME ?></th>
          <th><?= PP_MODEL ?></th>
          <th><?= PP_OPTIONS ?></th>
          <th><?= PP_PARTS ?></th>
        </tr>
      </thead>
      <tbody>
        <?php
        foreach ($oIDs as $key) {
          $order = new order($key);

          for ($i = 0, $n = count($order->products); $i < $n; $i++) {
            ?>
            <tr>
              <th><?= $key ?></th>
              <td><?= $order->products[$i]['qty'] ?></td>

              <td><?= $order->products[$i]['name'] ?></td>
              <td><?= $order->products[$i]['model'] ?? 'N/A' ?></td>
              <td><?php
                if (isset($order->products[$i]['attributes']) && (($k = count($order->products[$i]['attributes'])) > 0)) {
                  for ($j = 0; $j < $k; $j++) {
                    echo $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '<br>';
                  }
                } else {
                  echo 'N/A';
                }
                ?>
              </td>
              <td><?= $order->products[$i]['parts'] ?></td>
            </tr>
            <?php
          }
        }
        ?>
      </tbody>
    </table>
  </div>


the problem is the addition of PP_PARTS (does show in header) and

Code: Select all

             <td><?= $order->products[$i]['parts'] ?></td>
prior to the update to 1.0.8.21 this worked well but after update it doesn't - no parts are shown under the header - as far as I know (unless something has been changed) orders_batch.php is the same not sure where else to look.

Using S05e01-1.0.8.5 with the tick boxes in addition to Order ID on 1.0.8.21 and php 8.2
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
User avatar
burt
Core Team
Posts: 4546
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: S05e01 - Batch Actions

Post by burt »

That data would be made by the order class, which could have been changed by you to grab "parts";

Things to check;

1. the parts data is actually in the database
2. the order class you are using, does not have a later version that removes your custom code
I am not here to build for you.
I am here to build with you. Let's help each other.
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: S05e01 - Batch Actions

Post by Xpajun »

burt wrote: Fri May 17, 2024 9:43 am That data would be made by the order class, which could have been changed by you to grab "parts";

Things to check;

1. the parts data is actually in the database
2. the order class you are using, does not have a later version that removes your custom code
1. the parts data is in the database

What I can't find is the file that selects the data from the database - it's not the order.php that is in classes

But except for the options (attributes) all the rest are in the orders_products table and if that has been selected as a wildcard the

Code: Select all

<?= $order->products[$i]['parts'] ?>
which is the same code (parts substituted) as the others should work?
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
Post Reply