Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

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

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
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.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
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?

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
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.

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

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
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.

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

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

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

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

Link to comment
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() {

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
Share on other sites

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

Link to comment
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']

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

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

Link to comment
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.

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

it worked. I did all the steps again, and it works.

unfortunately I updated to php7 and I am having all kind of issues,  I can not submit a form in most browsers.any form

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

Link to comment
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!

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
Share on other sites

2 hours ago, hungryfrank said:

it works now thanks so much

👍

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
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?

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...