Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

Eveline....I'm not sure if you fully resolved your issues or not but you can also install the compatibility add on which will resolve these missing filenames for any of the older add-ons.

Dan

 

Link to comment
Share on other sites

7 hours ago, Dan Cole said:

Eveline....I'm not sure if you fully resolved your issues or not but you can also install the compatibility add on which will resolve these missing filenames for any of the older add-ons.

Dan

 

Hi Dan,

Thank you, yes, I know about the compatibility add-on.
But I reckon it is not very nice to name a contribution " ..for_2.3.4_BS" and still need a compatibility add-on.
The version  v1.2.4.1 of this (Order editor) contribution is not really old, is it?
So I started to replace the FILENAME_.. and DIR_WS... occurrences as good as I could.

Until now I did not have issues with the items that I could not replace
FILENAME_EMAIL_STATUS,
FILENAME_EMAIL_ORDER_TEXT,
FILENAME_ORDERS_LABEL,
FILENAME_GOOGLE_MAP

I did not find these names  in the compatibility add-on  anyway.
I checked http://addons.oscommerce.com/info/9506 "Add-On Compatibility support for OsCommerce 2.3.4 BS EDGE versions since September 2016"
I suppose above mentioned file names have effect only with a contribution which I do not use?

Thanks for caring!

Eveline

 

7844_Denkster_3th_corrections on 7844_Order_editor_for_2.3.4BS.zip

Link to comment
Share on other sites

I think all that is trying to say is it wasn't needed in prior versions of EDGE or Gold but in any case, if you got it working that is all that matters.

Dan

 

Link to comment
Share on other sites

2 minutes ago, Dan Cole said:

I think all that I was trying to say is it wasn't needed in prior versions of EDGE or Gold but in any case, if you got it working that is all that matters.

Dan

Hi Dan,

Yes, you are right, I have got it working now. Translations for those:
FILENAME_EMAIL_STATUS,
FILENAME_EMAIL_ORDER_TEXT,
FILENAME_ORDERS_LABEL,
FILENAME_GOOGLE_MAP

are not required, it seems.

What do you think, should I post my version of the package (as a full package for order editor) to http://addons.oscommerce.com/info/7844 ?

Eveline

Link to comment
Share on other sites

On 22-5-2017 at 0:51 AM, Dan Cole said:

It can't hurt....go for it.

I want to do it right.. Made mistakes before..

Can you please explain what the purpose is of statements like this:

<?php if (FILENAME_GOOGLE_MAP     !== 'FILENAME_GOOGLE_MAP'     ) { ?> 

Thanks in advance..

Eveline

Link to comment
Share on other sites

The test looks a little odd to me but in any case it looks like it was added along the way to support a Google Map Add on.   I don't use that addon so I really don't know anything about what it's purpose is....I'm guessing that it will show or give you directions to the delivery address.  But that is just a guess on my part.

Dan

 

Link to comment
Share on other sites

On 27-5-2017 at 6:53 PM, Dan Cole said:

The test looks a little odd to me but in any case it looks like it was added along the way to support a Google Map Add on.   I don't use that addon so I really don't know anything about what it's purpose is....I'm guessing that it will show or give you directions to the delivery address.  But that is just a guess on my part.

Dan

Thanks Dan,

Apart from the purpose of the unknown add on it seems to be related to, I was wondering how a statement like this was meant to work:

          if (FILENAME_EMAIL_STATUS !== 'FILENAME_EMAIL_STATUS'     ) {

I guess it checks if the variable FILENAME_EMAIL_STATUS is defined?

How would that work in the new situation, where filenames are no longer represented with variables, but hard coded?

Eveline

Link to comment
Share on other sites

I think the second part would just be hard coded so 'FILENAME_EMAIL_STATUS' would become something like email_status.php or whatever the filename was suppose to be.

Dan

 

Link to comment
Share on other sites

On 31-5-2017 at 0:46 AM, Denkster said:

Thanks Dan,

Apart from the purpose of the unknown add on it seems to be related to, I was wondering how a statement like this was meant to work:


          if (FILENAME_EMAIL_STATUS !== 'FILENAME_EMAIL_STATUS'     ) {

I guess it checks if the variable FILENAME_EMAIL_STATUS is defined?

How would that work in the new situation, where filenames are no longer represented with variables, but hard coded?

On 31-5-2017 at 4:06 AM, Dan Cole said:

I think the second part would just be hard coded so 'FILENAME_EMAIL_STATUS' would become something like email_status.php or whatever the filename was suppose to be.

You mean the code would become:

if (FILENAME_EMAIL_STATUS !== 'email_status.php') {

Sorry, I don't want to be a nuisance, I may just be stupid, but I still don't get it.

Suppose filenames are no longer defined. In that case  the variable FILENAME_EMAIL_STATUS  is supposed to not be in use anywhere. It is meaningless. What would be the meaning of the above code then?

Wouldn't it be better to use something like this:

if ( file_exists('email_status.php') ) {

Or am I missing the point again?

Eveline

Link to comment
Share on other sites

Eveline...like I said in my first note the test looks a bit odd to me.  You'll need to look at the code to see if you can figure out what the author intended but it just looks like a test to see if the define is set....if so it probably then tests to see if the contribution is enable and if so it is executed....if not it likely does something else....likely what the original code was intended to do in the first place.    Could it be done in a different way?...most likely.

Dan

 

Link to comment
Share on other sites

Ok Dan,

I can agree and will go with your explanation.

I found 8 occurrences of this odd test.

If I look at the occurrences where I recognize the file name, I see that the code is intended to place a button on screen, with a link to the file mentioned in the test.

So I will assume that the test is meant to check if the corresponding file (and hopefully the module) exists..

Thanks for guiding me through the discovery process.

Eveline

Edited by Denkster
Link to comment
Share on other sites

The next problem...

When I open an order for editing I get a URL like this:

../edit_orders.php?page=1&oID=1695&action=edit

I normally find four order total lines on that page.

Having changed NOTHING, When I click on the update button below the order total lines the system updates the order in a very peculiar way.
I get an extra set of 4 order total lines, identical to the set of  4 which I already had!

When I click once again, 4 more order total lines appear!

Is this a known problem? :sad:

I checked the parse time log, these queries are executed:

04/06/2017 19:12:33 [QUERY] DELETE 
                        FROM orders_total 
                       WHERE orders_id = '1695'
        
04/06/2017 19:12:33 [QUERY] insert into orders_total (orders_id, title, text, value, class, sort_order) values ('1695', 'Zone tarieven (Naar NL : 165 kg):', '€ 7,20', '7.2', 'ot_shipping', '1')
04/06/2017 19:12:33 [QUERY] insert into orders_total (orders_id, title, text, value, class, sort_order) values ('1695', 'BTW hoog:', '€ 3,85', '3.8528937768595', 'ot_tax', '2')
04/06/2017 19:12:33 [QUERY] insert into orders_total (orders_id, title, text, value, class, sort_order) values ('1695', 'Subtotaal incl. BTW:', '€ 15,00', '15.000007', 'ot_subtotal', '3')
04/06/2017 19:12:33 [QUERY] insert into orders_total (orders_id, title, text, value, class, sort_order) values ('1695', 'Totaal:', '<strong>€ 22,20</strong>', '22.200007', 'ot_total', '4')

But the 4 inserts are done multiple times!

I am perplexed!

Any idea?

 

Eveline

Link to comment
Share on other sites

Get your hands on an original copy of that file and replace your existing file with it (keep a copy of your file if you've made changes to it) and see what happens. I'm not seeing that problem with my version.

Dan

 

Link to comment
Share on other sites

Dear Dan,

Your advice worked out (after some adjustments) fine!

Strange, if someone had asked me the question I asked you, I probably would have given the same answer you did. Somehow I needed you to convince me ...

Of course I needed to change the change the  original copy of that file, replace the FILENAME_... variables with hard coded filenames and the folder variable names with hard coded names of the folders.

And I needed to replace the odd tests of this kind:

if (FILENAME_EMAIL_STATUS !== 'email_status.php') {

with statements of this shape:

if ( file_exists('email_status.php') ) {

But after those changes, I did not get double sets of order_totals anymore.

So I am quite happy again, thanks to you , Dan,

Thank you!

Edited by Denkster
forgot thank you
Link to comment
Share on other sites

You seem to be getting a good handle on the coding thing Eveline.  Before you know it we'll be seeing new add-ons authored by @Denkster.  :smile:

Well done.

Dan

Edited by Dan Cole
Link to comment
Share on other sites

  • 7 months later...

I've just been looking at this and see that it has an extra field on order for shipping method, that gets populated in checkout_process.php

However, that's not the only place where orders get created - several payment methods (notably paypal but others too) bypass this processing altogether.

Has this caused anyone any problems?

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

I have just uploaded a version of this addon to https://apps.oscommerce.com/Apps&wwEZ9&order-editor-for2-3-v1-0

It is reworked to use a header tags module instead of making changes to the checkout files to record the shipping method. This will also record it when the order was created by a payment method and not in checkout_process. It also uses the hooks mechanism to change admin orders. It is only necessary to change core code to make the order editor accessible from the list view of admin orders (by extending the hooks) or if the store records credit card information another change is required.

I recommend that people who have installed previous versions take edit_orders_ajax.php from this version.

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

In edit_order.php, how to get "ot_custom_ " value included into the tax calculations, and then to update Total?

So if you add a line in Order Totals with either positive or negative value currently it only gets added to the Total and not subtracted or added against Tax value.

Display Prices with Tax = false

 

Getting the Phoenix off the ground

Link to comment
Share on other sites

@Peper what exactly are you wanting to happen?

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

@Peper Yes I understand what it doesn't do. In order to be applied as you ask it needs to know:

  1. whether your custom subtotal is inclusive or exclusive of tax
  2. what tax rate applies

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

John, i'm not sure if there is a setting somewhere for this that needs to be adjusted

I tried applying TAX calculation fix but did not work - 

 

1: amount entered as exclusive of tax

2: TAX rate as per customer shipping address

Getting the Phoenix off the ground

Link to comment
Share on other sites

Sorry, you're right the rate is zone-specific; I should have asked what tax class applies.

From a quick look at it, that fix should work as long as you add the extra subtotal after the shipping subtotal because it uses the tax rate from the shipping module to calculate the tax on the custom subtotal. If the custom subtotal is added before shipping, it'll come out zero. Your sample data doesn't seem to have a shipping subtotal at all.

A proper solution would add a field on the additional custom order total for tax class. No class = no tax, otherwise apply tax based on class on subtotal. You have to be able to display the applicable tax rate on the invoice too.

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