Jump to content
jhilgeman

NEW! Complete Order Editing Tool!

Recommended Posts

Posted (edited)

I got it

it seems that the function

tep_class_exists was removed in 1.0.5.5 ,

line 1488 in edit_orders.php causes the error

 

I added the old function to

order_editor/functions.php

 

Edited by rupruprup

Share this post


Link to post
Share on other sites

@rupruprup that should be line 1498

there are two files to change for this issue

admin/edit_orders.php

and

includes/hooks/admin/siteWide/paymentMethodPulldown.php

(you will probably still get an error with the second)

edit_orders.php

paymentMethodPulldown.php


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@dculley you just need to read the last couple of pages of posts and download the whole files - no editing required.

Next fully documented release on apps will go with the next phoenix .0 release unless someone sponsors an intermediate one.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Hi John,

Hope you are safe from COVID 19.

Having updated Phoenix to v.1.0.5.6 I have a problem in admin/edit_orders_ajax.php (2) on line 515

    $r = 0;
    for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
      for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
        $r++;

When trying to modify the shipping the order totals disappear and can no longer be edited, then clicking cancel my order disappears (though it it still in the database, not on the site). Any ideas?

 

error_edit_orders_ajax.jpg

Share this post


Link to post
Share on other sites

Hi @BrockleyJohn

It's save to remove catalog/admin/order_editor/http_client.php as Phoenix make some time ago?

and the include: include('order_editor/http_client.php');

I take a look, and don't find this file usefull

Best regards

Share this post


Link to post
Share on other sites

@PiLLaO yes, as long as you remove the includes in both edit_orders.php and edit_orders_ajax.php, the class itself is not used and the file can be removed.

@artfulweb when an order disappears from the site it is usually because the order status id has been set to zero. This is something that happens occasionally with the core orders screen as well. An easy workaround to prevent orders disappearing is to manually add to the database an additional order status with status id = 0 and a description like 'status error - please reset' or whatever makes better sense to you. This is an addition to the orders_status table with orders_status_id = 0, language_id set to your admin language id, and the description set to what you want.

For the error itself, what is reported?


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Hello John, there is no error message nor errors in the logs. The problem comes from the fact that the add-on is not compatible with Phoenix 1.0.5.6. Looking in the code I can correct the array problems but not the rest so will have to wait until you have the time to upgrade it. Know you have already a lot on your plate so till then I will not use it on the live sites. In the interim have to find a way jungle orders that need to be modified without it. Thanks anyway.

Share this post


Link to post
Share on other sites

@artfulweb I dont think there is not a general problem with changing shipping methods at this version. Using the demo data and shipping methods Flat and Table I can happily switch between them. I admit I have only tried this on 1.0.5.7 but that shouldn't matter. The attached order was created with Flat shipping.

I have a theory that this is not related to versions at all. I think the addon doesn't properly cope with a shipping module returning an error instead of a quote as the array structures are different. Is one of your modules returning an error on the order you were editing because it is not available for the shipping address on the order?

Incidentally the line numbers you quote aren't quite the same as mine. Try inserting a condition around the inner loop, to check if it has returned a quote:

    $r = 0;
    for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
      if (array_key_exists('methods', $shipping_quotes[$i]) && is_array($shipping_quotes[$i]['methods'])) {
      for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
...

      }
      }
    }

The problem with my theory is that the non-ajax edit_orders should exhibit the same issue!

2020-04-12.jpg


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
4 minutes ago, BrockleyJohn said:

@artfulweb I dont think there is not a general problem with changing shipping methods at this version. Using the demo data and shipping methods Flat and Table I can happily switch between them. I admit I have only tried this on 1.0.5.7 but that shouldn't matter. The attached order was created with Flat shipping.

I have a theory that this is not related to versions at all. I think the addon doesn't properly cope with a shipping module returning an error instead of a quote as the array structures are different. Is one of your modules returning an error on the order you were editing because it is not available for the shipping address on the order?

Incidentally the line numbers you quote aren't quite the same as mine. Try inserting a condition around the inner loop, to check if it has returned a quote:


    $r = 0;
    for ($i=0, $n=sizeof($shipping_quotes); $i<$n; $i++) {
      if (array_key_exists('methods', $shipping_quotes[$i]) && is_array($shipping_quotes[$i]['methods'])) {
      for ($j=0, $n2=sizeof($shipping_quotes[$i]['methods']); $j<$n2; $j++) {
...

      }
      }
    }

The problem with my theory is that the non-ajax edit_orders should exhibit the same issue!

2020-04-12.jpg

Hi John,

It shows fine as long as you do not touch the shipping, for example try to put it at 0 so the customer does not have to pay the shipping or add a discount, then it goes haywire.

Share this post


Link to post
Share on other sites

As well as changing between modules, I can set it to zero. How do you add a discount?

 

2020-04-12-(1).jpg


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@BrockleyJohn

On 4/12/2020 at 2:34 AM, BrockleyJohn said:

As well as changing between modules, I can set it to zero. How do you add a discount?

In one of my stores, I created a product called 'discount'. The item has no price or weight. I usually keep this item 'disabled'.

If an order needs a discount, before I am manually add the order, or editing an existing order, I 'enable' the 'discount' item. I then add it to the order, and manually enter the discount value.

I'm not saying that this is the best way to handle this, but it works for me.

HTH

Malcolm


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites
On 4/12/2020 at 12:11 PM, artfulweb said:

Hi John,

It shows fine as long as you do not touch the shipping, for example try to put it at 0 so the customer does not have to pay the shipping or add a discount, then it goes haywire.

this worked for me.  

in admin/order_editor/order_totalphp

line 22 change  function order_total() {.  to     public function _order_total() {. 


you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
27 minutes ago, hungryfrank said:

this worked for me.  

in admin/order_editor/order_totalphp

line 22 change  function order_total() {.  to     public function _order_total() {. 

it should be

function __construct() {


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
Posted (edited)
55 minutes ago, BrockleyJohn said:

it should be

function __construct() {

now I get two notices   much better than before. it added wrong.

Notice: Undefined index: in /Library/WebServer/Documents/m6/includes/modules/order_total/ot_shipping.php on line 51

Notice: Trying to get property of non-object in /Library/WebServer/Documents/m6/includes/modules/order_total/ot_shipping.php on line 51

Edited by hungryfrank

you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
11 hours ago, hungryfrank said:

now I get two notices   much better than before. it added wrong.

Notice: Undefined index: in /Library/WebServer/Documents/m6/includes/modules/order_total/ot_shipping.php on line 51

Notice: Trying to get property of non-object in /Library/WebServer/Documents/m6/includes/modules/order_total/ot_shipping.php on line 51

These notices are telling you that it cannot calculate the shipping order total because it can't find a match between the shipping quote stored in the session variable and the shipping classes stored in the global variable.

The delivered code, fixed as suggested, doesn't do this. If you are running it in a test store you can put some debugging into ot_shipping so you can see what's not properly set. Check what $module gets set to in line 48 and if it doesn't look right, check the value of $_SESSION['shipping']['id']


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
On 4/14/2020 at 11:32 AM, BrockleyJohn said:

These notices are telling you that it cannot calculate the shipping order total because it can't find a match between the shipping quote stored in the session variable and the shipping classes stored in the global variable.

The delivered code, fixed as suggested, doesn't do this. If you are running it in a test store you can put some debugging into ot_shipping so you can see what's not properly set. Check what $module gets set to in line 48 and if it doesn't look right, check the value of $_SESSION['shipping']['id']

@burt had a solution.  back I the days. 

 


you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
12 hours ago, hungryfrank said:

@burt had a solution.  back I the days. 

 

If you need to change ot_shipping.php - I don't think that's part of the addon. Check if you can reproduce on the shop checkout and if so raise a phoenix issue.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
Posted (edited)
12 minutes ago, BrockleyJohn said:

If you need to change ot_shipping.php - I don't think that's part of the addon. Check if you can reproduce on the shop checkout and if so raise a phoenix issue.

no in the shop it is ok.  maybe if we add a tax class to shipping modules in the admin. i test that tomorrow. that would be the easiest way.

maybe a 0 tax class.

Edited by hungryfrank

you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
1 hour ago, hungryfrank said:

no in the shop it is ok.  maybe if we add a tax class to shipping modules in the admin. i test that tomorrow. that would be the easiest way.

maybe a 0 tax class.

You should be using the shipping modules in catalog. If you are not, you are using a different addon!


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
2 hours ago, hungryfrank said:

it works now thanks so much

👍


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@BrockleyJohn Howdy, I have found a problem with GST / Tax and the order edit tool the GST is not updated correctly

The is installed on Frozen BS, can you please assist.

IE see below

image.png.e06468c4cc86549e84a0ea625c3fe3bb.png

If I add another item I get this, Hopefully an easy fix

image.png.53ef5c84bc207c8b619e07fda26fbad6.png

Share this post


Link to post
Share on other sites

@SCH_001 How many tax order total modules have you got enabled? The total tax is consistent it's just split into two lines - though the one that was $10 to start with changed name. Have those two products got the same tax class?


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
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

×