Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

@SCH_001

 This appears to be a bug at all versions - perhaps it never worked! I'll have a look into it.

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...
8 hours ago, rupruprup said:

@BrockleyJohn did you have a look at 1.0.5.9.

what is to change in the

orders_edit_orders.php hook ?

Here is a version of includes/modules/hooks/admin/orders_edit_order.php that works on 1.0.5.9 as well, but you are also going to have to deal with includes/database.php not being there - either add an include into edit_orders.php and edit_orders_ajax.php or go through and edit all the sql statements.

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

thank you @john

I changed the script to

<script>
  $('.align-self-center').prepend('$button');
  $script
</script>

I cleaned both files edit_orders.php and edit_orders_ajax.php  a few weeks ago and it works fine

Link to comment
Share on other sites

4 minutes ago, rupruprup said:

thank you @john

I changed the script to

<script>
  $('.align-self-center').prepend('$button');
  $script
</script>

I cleaned both files edit_orders.php and edit_orders_ajax.php  a few weeks ago and it works fine

That might work now but there's a good chance you'll get buttons popping up all over the place at some point in the future - it will add them to the start of every html element with the class align-self-center

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

Hi;

Thank you for this wonderful addon can you please help me with this error- I am using 1.0.5.9 Phoenix

Notice: Undefined index: methods in /xxxxxx/admin/edit_orders.php on line 1857

Warning: sizeof(): Parameter must be an array or an object that implements Countable in /xxxxxx/adminedit_orders.php on line 1857

Awaiting your response;

Thank you in advance

Regds./

radhavallabh

Link to comment
Share on other sites

@radhavallabh it needs a lot of changes to get rid of warnings and notices - you should turn them off by changing admin/includes/application_top.php

error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED);

It's my hope to get a lot more of them eliminated by the next release which will be to go with 1.0.6.0

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

11 hours ago, BrockleyJohn said:

@radhavallabh it needs a lot of changes to get rid of warnings and notices - you should turn them off by changing admin/includes/application_top.php


error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED);

It's my hope to get a lot more of them eliminated by the next release which will be to go with 1.0.6.0

Eagerly await the next release dear 👍👍😊

Regds./

radhavallabh

Link to comment
Share on other sites

  • 3 weeks later...

@djmonkey1

Seems like I would be able to find more information about using this mod in a v2.3.1 store with  SPPC and Quantity Discounts, but I'm not having great luck.  

The Quantity Discounts mod works great on the front side. In fact, I duplicated it, using one version for Category Discounts, and the other for Line Item discounts.  This way, both or either can be toggled on a customer group or customer id basis.  Again...works -great- as a visiting customer.

The problem comes when I try to edit an order.  Let's say I have an order for which neither discount (line or category) is toggled on, for either account or customer group.  If I edit the order and add enough product that the criteria for the discount is met, the discount applies itself.  Or...if they'd purchased enough to meet one or all of the criteria, once I open it in the editor and change anything, the discounts apply.

I can't even adjust shipping without having this happen.  I'm at a loss.

 

Link to comment
Share on other sites

I discovered recently that my "Edit" button has disappeared from my Order Details view in Admin, where the order's Summary, Products, and Status History are displayed.  I checked by toggling the Edit button feature in the Order Editor configuration and the Order Editor is functioning correctly.  I normally do not like to have that Edit button in the orders list view go directly to an order editing screen, but to the orders detail screen, instead.  So, I typically have that feature disabled in the configuration.  However, I get no "Edit" button at all in the order details view.

I first noticed this because the Details box has the following characters displayed erroneously at the bottom left of each Summary, Products, and Status History box: "  ');  "

I traced these three characters to this code in the HTML for orders.php when displaying the order details in Admin:

Quote

<script>$('h1.pageHeading + div').prepend('<span class="tdbLink"><a id="tdb5" href="https://www.mystore/catalog/admin/edit_orders.php?oID=3293" target="_blank">Edit</a></span><script>$("#tdb5").button({icons:{primary:"ui-icon-document"}}).addClass("ui-priority-secondary").parent().removeClass("tdbLink");</script>');

Sure enough, what little I can interpret is that string of script code controls the appearance of the "Edit" button in the order details view.  I suspect those ending characters are invalidating the script code.  I believe that script should end in only " </script> " instead of " </script>'); "

Can anyone direct me to which file that script is developed, so that I can try to find the error?  I've checked orders.php and edit_orders.php and it doesn't appear that any of that code is included in those files.

My orders.php file was somehow modded, because I have it archived under a "FixEditButton" folder.  Unfortunately, it doesn't appear that I commented the code and I can't remember what was done. 😕

 
Link to comment
Share on other sites

It comes from a file you're unlikely to have changed: catalog/includes/modules/hooks/admin/orders_edit_order.php

What version of the shop are you running? It occurs to me I've not tested the latest version I posted to the thread on bs3 shops.

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

If you view the source of the page where the script has been included, it looks likely that there is something extra in the string coming out of the draw button function.

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

Thanks for replying, John.  I'm running Phoenix 1.0.5.0.  You actually gave or told me how to modify the orders_edit_order.php file back on 12/24.  I think you uploaded it all in your 1.2.8 version.  Note that your later versions after Denkster still can't be found on the Apps Marketplace.  I went searching earlier this morning and couldn't find anything.

 This worked at the time, when I installed this from you:

Somewhere along the way to 1.0.5.0 and Supporters Code updates, I lost the Edit button again, but don't know when - or obviously, how.

Link to comment
Share on other sites

  • 2 weeks later...

@BrockleyJohn (on Phoenix 1.0.1.4 (please don't judge))

I have Order Editor v1.2.6 installed and working. I also just installed Create Account and Order Maker for 0sC 2.3.1 v3.0 (yes, this is an old add-on, and required a lot of updating to get it to work with Phoenix). Create Account and Order Maker requires Order Editor in order to work.

1) I have customers with more than one address (one for ship to, one for bill to, etc). When a customer places an order (via phone or email), I enter the order through Order Maker, which drops me into Order Editor. Order Editor pulls in the default address into all three address blocks. What would it take to have a drop-down selector for each of the address blocks, so I could select one saved address for billing, and another one for shipping?

2) You added a hook into Order Editor, I suppose to avoid core changes (my core is so hacked up, it could probably qualify as original code!). However, when I hacked the buttons in /admin/orders.php (I moved the 'invoice' button to the first place, moving the 'edit' button down to the second row), the hook over-rode my 'Invoice' button, sending me to 'edit_orders.php' instead. When I commented out the hook, the problem when away. Any thoughts as to why that happened?

TIA

Malcolm

Link to comment
Share on other sites

@ArtcoInc I guess you're talking about the buttons on the selected order in the list view. IIRC it just overrides the link of the first button - or the first yellow one, or something along those lines. There's a config setting for this which you can turn off instead of clobbering the hook. If you want it to pick a different button we'd need to work out a different jquery selector - if you copy the source code of the buttons section from your browser I can figure what it could be.

I believe order editor does nothing with customers, addresses and so on, it simply manipulates the fields on an existing order and allows you to change the order products and totals. The place to do what you're asking would be the Order Maker addon which must be where the default address is getting pulled into all three when the order is created.

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 Just for some clarification ...

1) The Order Maker add-on has the choice of adding a new customer, or selecting an existing customer. If I'm entering a new order for an existing customer, Order Maker fills in the default address into all three address blocks, and dumps me into Order Editor. Here, I get to add the products, shipping, comments, etc.

What I am saying is, if an existing customer has more than one address in their address book, it would be useful to be able to have a drop-down selector for each of the address blocks.

90923793_ScreenCapture2020-06-11-A.jpg.2331fec26f1fb42c7ea1d5c51417b825.jpg

 

2) In the stock /admin/orders.php screen, when you display the orders, there are 4 buttons on the right hand side of the screen. If you click on the 'Edit' button, it displays the order, but there is no way to actually edit it.

746007893_ScreenCapture2020-06-11-B.jpg.6dc1f1b031cf8ecf75692e2a5e488221.jpg

After I installed Order Editor, the 'Edit' button takes you to /admin/edit_orders.php (the Order Editor screen). This is where I think you used the hook.

437500856_ScreenCapture2020-06-11-C.jpg.e8494f34d022ceaf64f961968f1fad8a.jpg

This worked fine, until I hacked up the /admin/orders.php file, to move the buttons around.

836328541_ScreenCapture2020-06-11-D.jpg.edcbb9fc0f90905812a7a282b41ec455.jpg

Since I moved the 'Invoice' button first, the Hook was redirecting it to /admin/edit_orders.php, instead of to /admin/invoice.php. When I commented out the Hook, the link worked fine.

Like I said, I've already hacked up the core quite a bit. It just took me by surprise trying to figure out why the link wasn't working.

Malcolm

Link to comment
Share on other sites

Hi,

Probably not using the most up to date version, but on Phoenix 1.0.5.0 if there is a discount value (i.e. using a discount code addon) it doesn't seem to handle the tax/order total values correctly when re-calculating.

Works perfectly if not.

Might be worth catering for this for any future update.

 

Link to comment
Share on other sites

  • 5 months later...

I think managed to port my OSC 2.3.4.1 BS heavily modified order editor to Phoenix 1.0.7.9. I haven't tested it thoroughly yet. At least taxes are correctly calculated.

I only use the following modified hooks from this addon version 1.2.8.

The only change to core is to add the 'orderList' hook call to admin/orders.php, as instructed in the readme.

*********** includes/hooks/admin/siteWide/listOrders.php

<?php
/*
  $Id$

  add edit orders to admin / orders.php
    
    author: John Ferguson @BrockleyJohn [email protected]

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2019 SE Websites

  Released under the MITc License
  without warranty express or implied
 
  Modified by vmn for 1.0.7.9  
*/

class hook_admin_siteWide_listOrders {

  function listen_injectSiteEnd() {
    global $PHP_SELF, $oInfo;
    
    if (basename($PHP_SELF) == 'orders.php') {
      $comment = '<!--  ' .__METHOD__ . ' -->';
      
      if (isset($oInfo) && is_object($oInfo)) {
        $link = tep_href_link('edit_orders.php', 'oID=' . $oInfo->orders_id);
        return <<<EOD
$comment
<script>
$(function() {
$('a.btn-warning').attr('href','$link');
});
</script>
$comment
EOD;
      }
    }
  }
}

*********** includes/modules/ hooks/admin/orders_edit_order.php

<?php
/*
  $Id$

  add edit orders to admin / orders.php
    
    author: John Ferguson @BrockleyJohn [email protected]

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2018 osCommerce
 
  Released under the GNU General Public License
 
  Modified by vmn for 1.0.7.9  
*/

  class hook_admin_orders_edit_orders {
   
    function listen_orderTab() {
      $comment = '<!--  ' .__METHOD__ . ' -->';
      
      $button = tep_draw_bootstrap_button(IMAGE_EDIT, 'fas fa-cogs', tep_href_link('edit_orders.php', tep_get_all_get_params(['oID', 'action']) . 'oID=' . $_GET['oID'] . '&action=edit'), null, null, 'btn-warning mr-2');

      $output = <<<EOD
$comment
<script>
$('a.btn-info:first').before('$button');
</script>
$comment
EOD;

      return $output;
   }
}

 

 

Link to comment
Share on other sites

There are no core code changes required on any Phoenix version since 1.0.4.0

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

@vmn @BrockleyJohn Hi Veli-Matti, is it an easy fix to get the taxes calculated correctly. For me this is if I change the shipping value manually it does not calculate the tax correctly after that change.
Not sure of the version I am running but it won't be the latest as my shop is osCommerce Online Merchant v2.3.4.1 CE

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