Totally Zenned
- Join Date:
- Sep 2004
- Posts:
- 1,237
- Plugin Contributions:
- 1
OLD Super Orders 2.0 (See v3.0 thread instead)
I'm pretty sure it's a DB setting via the configuration table but, again, no sure idea. :unsure:
Views: 456,062
Totally Zenned
I'm pretty sure it's a DB setting via the configuration table but, again, no sure idea. :unsure:
New Zenner
Hello harlyman,
I did a little reseach into your problem and here are my findings. These are my opinons and how I would approach solving the problem. I am sure there are other ways inwhich to get to the same solution which maybe easier, but I have not found.
As Super Orders 2.0 works right now the subtotal amount is retrieved directly from the 'orders_totals' table in the db which I assume gets written after a customer has submitted their order. Ok, so lets review how this value is set when you view a customer's order in the admin:
admin/includes/classes/order.php 'Line #43-46'
$totals = $db->Execute("select title, text, class
from " . TABLE_ORDERS_TOTAL . "
where orders_id = '" . (int)$order_id . "'
order by sort_order");
So, this part of the class stores the subtotal with tax from the 'orders_totals' table in the db.
admin/super_data_sheet.php 'Line#32'
$order = new order($oID);
The $order object gets created (instantiated) here and at this time $order->totals[$i]['text'] is assigned the order's subtotal with tax.
admin/super_orders.php 'Line#773'
<td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" .
This line actually displays the subtotal from $order->totals[$i]['text'] on the order's detail page in the admin.
Ok, but you want subtotal without tax. I will outline my solution but I have not tried this or tested it and it will need through testing to get it right.
Inside 'admin/includes/classes/order.php', add a new method/function like getSubTotalwoTax( ) to query the 'orders_product' table which lists all the items in an order. Loop through all the product lines and calculate the sum of fields 'products_quantity' x 'products_price' and return the total amount.
In 'admin/super_data_sheet.php' after Line 32, add a new variable, say $subTotalwoTax and call your new function from the $order object as:
$subTotalwoTax = $order->getSubTotalwoTax($oID);
Ok, this is a rough hack, and personally, it would be better to edit the orders.php class and add another array variable to the totals member variable to make it cleaner. In that case, you could simply change the display line from $order->totals[$i]['text'] to say, $order->totals[$i]['subTotalwoTax'], but you get the idea.
Of course you need to document the exact changes you make, because any future upgrade of zen-cart will likely overwrite the orders.php file and your will lose your changes.
Zen Follower
Hi,
I installed Super Orders on my store, but I don't see any of the functionality.
I can go to Admin>Config>Super Orders
But I can't find Admin>Customers>Super Orders
and I see no links to super orders on any of my existing orders.
Does it only work with new orders or did I mess up in the installation process?
Thanks,
Nate
Zen Follower
ahelis:
Hello harlyman,
I did a little reseach into your problem and here are my findings. These are my opinons and how I would approach solving the problem. I am sure there are other ways inwhich to get to the same solution which maybe easier, but I have not found.
As Super Orders 2.0 works right now the subtotal amount is retrieved directly from the 'orders_totals' table in the db which I assume gets written after a customer has submitted their order. Ok, so lets review how this value is set when you view a customer's order in the admin:
admin/includes/classes/order.php 'Line #43-46'
$totals = $db->Execute("select title, text, class
from " . TABLE_ORDERS_TOTAL . "
where orders_id = '" . (int)$order_id . "'
order by sort_order");
>
> So, this part of the class stores the subtotal with tax from the 'orders_totals' table in the db.
>
> admin/super_data_sheet.php 'Line#32'
>
> ```
$order = new order($oID);
<td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" . ``` > > This line actually displays the subtotal from $order->totals[$i]['text'] on the order's detail page in the admin. > > Ok, but you want subtotal without tax. I will outline my solution but I have not tried this or tested it and it will need through testing to get it right. > > 1. Inside 'admin/includes/classes/order.php', add a new method/function like getSubTotalwoTax( ) to query the 'orders_product' table which lists all the items in an order. Loop through all the product lines and calculate the sum of fields 'products_quantity' x 'products_price' and return the total amount. > > 2. In 'admin/super_data_sheet.php' after Line 32, add a new variable, say $subTotalwoTax and call your new function from the $order object as: > > $subTotalwoTax = $order->getSubTotalwoTax($oID); > > 3. Inside 'admin/super_orders.php - Line#773' change $order->totals[$i]['text'] to $subTotalwoTax. > > Ok, this is a rough hack, and personally, it would be better to edit the orders.php class and add another array variable to the totals member variable to make it cleaner. In that case, you could simply change the display line from $order->totals[$i]['text'] to say, $order->totals[$i]['subTotalwoTax'], but you get the idea. > > Of course you need to document the exact changes you make, because any future upgrade of zen-cart will likely overwrite the orders.php file and your will lose your changes.The $order object gets created (instantiated) here and at this time $order->totals[$i]['text'] is assigned the order's subtotal with tax.
admin/super_orders.php 'Line#773'
looks easy when you explain it, but i think i need someone with more php skills that me to help out.
anyone here that wants this challange?? i'll pay $$ for this fix if someone are able to solve this for me.
New Zenner
bgroup99:
Hi,
I installed Super Orders on my store, but I don't see any of the functionality.
I can go to Admin>Config>Super Orders
But I can't find Admin>Customers>Super Orders
and I see no links to super orders on any of my existing orders.
Does it only work with new orders or did I mess up in the installation process?
Thanks,
Nate
Recheck your installation. You seem to have missed a few core files.
Totally Zenned
bgroup99:
I can go to Admin>Config>Super Orders
But I can't find Admin>Customers>Super Orders
and I see no links to super orders on any of my existing orders.
You ran the SQL file properly, but did not upload the files correctly. Re-read the readme so you know exactly where the files need to go.
New Zenner
Batch_status_update not sending emails...
Well, this is no real solution but yo should know that SO 1.3 batch status update works just fine on Zen-Cart 1.3.6...
So if you need it (the only thing I really need from SO) you might consider down-grading :blush:
Still interested in 2.0 solution though :lookaroun
Cedo
Totally Zenned
Only one thing has changed in that file between major versions. Open admin/super_batch_status.php. Find this line...
$notify = (int)$_POST['notify'];
Change it to read as follows....
$notify = $_POST['notify'];
Upload and give it a whirl.
New Zenner
I just downloaded Super Orders 2.0, great features!
But, before I install it, want to make sure if it works with current ZenCart 1.3.6 and Stock by Attributes mod that I am using, doesn't it?
Thanks!
Totally Zenned
Yes, SO is fully compatible with Zen Cart 1.3.6
New Zenner
BlindSide:
Yes, SO is fully compatible with Zen Cart 1.3.6
Do you know if it works with Stock by Attributes by any chance? Can't wait to give it a try...
Thanks!
Zen Follower
What happened to the functionality of adding products on an existing order?
I found this very useful..
Zen Follower
Svanis:
What happened to the functionality of adding products on an existing order?
I found this very useful..
fyi, its not included in this latest mod...
New Zenner
BlindSide:
The so_* tables were not the problem, but rather the inserts made to the configuration table. Do a search in the SQL file for the following:
insert into configuration
>
> Or just read the whole README file. Most of it is covered in there. I'd like to comment on your installation procedures (which are great! :thumbsup: ), in hopes they save others from this recurring issue...
>
> This should typically be a given. The file should be run using a tool that already knows which DB to run on (i.e. phpmyadmin). Your step 2 would be the correct procedure if using the command line (which most shared hosts don't allow).
>
> (Aside: As an FYI, I have a dedicated server like you, and I never use the command line. I think you'll find it far easier to maintain your DB's using phpMyAdmin. Just my opinion, though.)
>
> Bolding is my emphasis. This is for everyone who gets "duplicate entry" errors when running the SQL. Re-running the file simply won't work; comment out the duplicate line ('cause it went in properly on the first try), or reload your DB, fix the problem that caused the first failure, and try again.
>
> See? DB properly selected; SQL file and DB properly configured; alls well! :yes:
I'm having this problem ```
1062 Duplicate entry 'CA' for key 2
in:
[INSERT INTO so_payment_types VALUES (NULL, 1, 'CA', 'Cash');]
``` and I can't re-install my db from a backup because it's too old :( [I know for next time]. Just wondering how I can solve this problem. I can't see Admin-->Config-->Super orders and my Tax # is not displaying in on my invoices.
Any help would really be appreciated.
Thanks for your patience as this was probably covered, I just don't understand.
Cheers,
Happyworker
Totally Zenned
I understand this stuff can be tough for a beginner, but did you even read the message you quoted, Happy? Let's try again...
This is for everyone who gets "duplicate entry" errors when running the SQL. Re-running the file simply won't work; comment out the duplicate line ('cause it went in properly on the first try)...
You cant properly re-run the SQL file without first resetting your DB to the way it was before running it the first time. It sets up tables and entries that cannot be duplicated.
Commenting out the offending line only solves a fraction of the problem, as you'll undoubtedly have other duplicate lines. Since you don't have a viable backup, you'll now have to go through the SQL file line by line, and compare it to your DB's current state. Remove any duplicate entries it made (e.g. the configuration table is not set to prevent dupes), and manually execute each SQL statement that did not go in the first time.
Shame on you for not following all those big backup warnings. :wink2: :cry:
Totally Zenned
Svanis:
What happened to the functionality of adding products on an existing order?
I found this very useful..
If you used any kind of attributes, it was totally broken with the latest versions of Zen Cart, so I scrapped it. Go back a few pages and you'll see a list of upcoming features. Adding new products is on there.
mkm:Do you know if it works with Stock by Attributes by any chance? Can't wait to give it a try...
The current version will be fine with that, as far as I know. Super Orders only changes order reporting output, not input. The next version includes adding products and doing returns and exchanges, which definitely will not work with Stocks by Attribute.
New Zenner
Thanks Blindside
Yes I read the text, I didn't understand the "commenting out of the offending line".
How do I comment this out and manually insert the sql that didn't go the first time?
I'm going to go through the configuration table and take out any duplicate.
Thanks again, much appreciated.
Totally Zenned
Happyworker:
Thanks Blindside
Yes I read the text, I didn't understand the "commenting out of the offending line".
How do I comment this out and manually insert the sql that didn't go the first time?
I'm going to go through the configuration table and take out any duplicate.
Thanks again, much appreciated.
No problem, I'm sorry to see you suffering through. You can comment out a line in SQL by adding a double slash (//) double dash (--) to the beginning of the line. Whole sections can be commented using the /* */ format. In your case, I recommend you keep the file open and just copy and paste the necessary lines into the SQL field in phpMyAdmin. Go one line at a time to avoid further possible damage.
New Zenner
Thanks for the help Blindside,
Okay, everthing seems to be in order now and I see the admin-->config-->super orders.
Excellent
Now, just something has caught my eye....
When I click on the Invoices I notice that under the Tax column it says "None!".
Well I have set all my configurations to show tax and it shows it along the right hand side like normal....it's just underneath that column that it shows "None!"
Thanks again for your help
Cheers,
Happyworker
New Zenner
Nevermind about the last post....figured it out.
Thanks again for your help.
Cheers,
Happyworker
Tell staff why this post should be reviewed.