Jump to content

Create Orders in Admin


Guest syrontech

Recommended Posts

Guest syrontech

Hi,

I am wondering if anyone else had this issue?

When I create an invoice in the admin area and allocate to a client account, a couple things happen:

1. When there are no other orders in their orders history under their account they can complete the payment via paypal or credit card, which to me works perfectly,

2. When there other orders in their order history whether in processing pending or cancelled, the created invoice in the admin area appears in the order history but when the client clicks to complete payment, it says there is nothing in your basket and they cannot complete payment.

Does anyone know why this is happening? Or how to fix it?

I look forward to your thoughts and comments.

the website is www.sainet.com.au

Link to comment
Share on other sites

Welcome syrontech! Glad to see you made it to the forums.

I can look into this for you, but to start, may we know the environment your store is in?

Your "sig" can have the exact version of CubeCart (very important), MySQL, PHP, the server type, any customizations, non-stock skin, etc, and anything that may exist at the edges of possibility that may be affecting/causing this behavior.

Link to comment
Share on other sites

Guest syrontech

Cube cart Version 5.14

MySQL Version 5.0.95

PHP Version 5.2.17

The server is a cloud based server, I believe.

I tried to have the invoice script adapted by Chuggy but the invoice plugin failed... and they had to look into it and couldn't fix it, so I removed it completely from the database and the install. This is to change the invoice number to a shorter number...

I created my own basic layout but that souldn't affect the running of the script.

I changed the language file to say invoice instead of order.

Thanks very much for your help....

Link to comment
Share on other sites

Hi syrontech. Your setup information will help on this thread, but creating your signature will provide this info on every post you make - saves lots of questions in the long run. As for Chuggy's invoice number mod - it works perfectly for me on two stores - one CC skin and one Fusion skin. I'll try testing your invoice issue and see what my results are.

Link to comment
Share on other sites

I tested it by changing an old cancelled test order to Pending and then creating a new order for the same test customer from Admin.

On 5.1.4 FUSION SKIN: I can lookup the new order, it shows as Pending, but there's no way to pay it. BUT, if I login as that test customer and go to my Order History I CAN complete the order.

ON 5.1.5 KUROUTO SKIN: I get the empty basket error message, just as you did. BUT I also get the empty basket message if I try to complete a test order when there are NO other open orders for that test customer.

Link to comment
Share on other sites

Guest syrontech

Thanks for checking Dirty, but do you have any idea on how to fix this issue? I am using modified version on Kurouto but I don't think would create any issues.

I have upgraded to 5.1.5 now I am getting the same issues you are having even if there is nothing in the order history the basket is empty...

Link to comment
Share on other sites

I wish I did know how to fix it. More knowledgeable folks will have to help with that. But since it did the same for my kurouto, we do know it's not in your setup, but an issue in the code.

I can say there is no [bLOB-OB] entry in the custom column of the order_inventory table in my database, while all the other entries have it. The order_summary table has NULL for both the basket and lang columns, while old orders have [bLOB-OB] as well. The Fusion skin store (where the lookup worked correctly) has a full set of info about the order in the basket column for old orders, but NULL for the created order.

Link to comment
Share on other sites

If the edits that the mod required changed the format of the order invoice number, then there will be issues - unless the those edits also dealt with CubeCart's strict adherence to that format.

There are several locations in the code (I don't know how far back in CubeCart's versioning this adherence is in place) where the order number must be of the format:

^[0-9]{6}-[0-9]{6}-[0-9]{4}$

^ nothing in front of it

[0-9]{6} six digits

- a dash

[0-9]{6} six digits

- a dash

[0-9]{4} four digits

$ nothing after it

If the instructions to the edits to the code of your store absolutely made mention that the strict adherence to the format is relaxed or ignored, then any order made with any format other than the above will fail to be located.

I'll have to check, but I would think CubeCart would at least say that the order cannot be found rather than show just an empty cart.

Also, edits to code will not survive an update. All updates involve replacing the entirety of the code base. (With the exception to copies of skins to customize them to your needs.)

So, please respond with:

? Have any edits been made to the currently installed codebase to give you alternate means of expressing order numbers?

? If yes, did these edits give a complementary means, or did they replace the customary means?

? For any orders in the customer's Order History using the customary format, do they show as empty?

It would also help to refrain from using 'me', 'my', 'I' when you are, in fact, in the store-front as a customer.

"I can lookup the new order, it shows as Pending, but there's no way to pay it. BUT, if I login as that test customer and go to my Order History I CAN complete the order."

"When the non-logged-in customer looks up the new order created in the admin back-end, that order shows as Pending, but there's no way to pay it.

BUT, if the customer logs in and goes to their Order History page, the customer CAN complete the order."

Link to comment
Share on other sites

Guest syrontech

? Have any edits been made to the currently installed codebase to give you alternate means of expressing order numbers?

There was done with the Sequencial number order:

classes/order.class.php

FIND

$this->_basket['cart_order_id'] = $this->_order_id;

INSERT AFTER

//Sequential Order Numbering

$sod = $GLOBALS['config']->get('Sequential_Order_Numbers');

if($sod['status']==1){

if($sod['restart']==1){

//We want to restart in a new year, if a row doesnt exist then it must be a new year

$current = $GLOBALS['db']->select('CubeCart_sequential_order_numbers', false, array('year' => date('Y',time())));

}else{

$year=0;

//Doesnt matter about the year, we just want any old line

$current = $GLOBALS['db']->select('CubeCart_sequential_order_numbers', false, array('year' => $year));

}

//Lets make the rows available

if($current==FALSE){

if($sod['restart']==1){

$record['year'] = date("Y",time());

$GLOBALS['db']->insert('CubeCart_sequential_order_numbers', $record);

unset($record);

}else{

$record['year'] = 0;

$GLOBALS['db']->insert('CubeCart_sequential_order_numbers', $record);

unset($record);

}

}

//Try again!

if($sod['restart']==1){

//We want to restart in a new year, if a row doesnt exist then it must be a new year

$current = $GLOBALS['db']->select('CubeCart_sequential_order_numbers', false, array('year' => date('Y',time())));

}else{

//Doesnt matter about the year, we just want any old line

$year=0;

$current = $GLOBALS['db']->select('CubeCart_sequential_order_numbers', false, array('year' => $year));

}

$currentNo=$current[0]['no_orders']+1;

$update=$GLOBALS['db']->update('CubeCart_sequential_order_numbers', array('no_orders' => $currentNo), array('id' => $current[0]['id']));

if($sod['digits']>0){

$currentNo=str_pad($currentNo, $sod['digits'], "0", STR_PAD_LEFT);

}

if(!empty($sod['prefix'])){

$currentNo=$sod['prefix'].$currentNo;

}

if($sod['year']==1){

$currentNo=date("Y",time())."-".$currentNo;

}

$this->_order_id=$currentNo;

$this->_basket['cart_order_id'] = $this->_order_id;

}

But this has been removed...

Plus update to the database:

CREATE TABLE {YOURPREFIX}CubeCart_sequential_order_numbers` (

`id` INT( 30 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,

`year` VARCHAR( 255 ) NOT NULL,

`no_orders` INT( 30 ) NOT NULL

) ENGINE = MYISAM ;

But I manually removed this from PHPAdmin

? If yes, did these edits give a complementary means, or did they replace the customary means?

Sorry I am not sure but this above is the only real change made...

? For any orders in the customer's Order History using the customary format, do they show as empty?

I am not sure if it was working before I installed the plugin? But I deleted the plugin as well... But after the plugin was removed was when I noticed the basket was empty on a client order that I processed manually in the admin area and there was unable to complete the invoice, but they could veiw the order and press on print receipt.

if you'd like to see the example, please go to my website: www.sainet.com.au

Log in under [email protected], customer login password happy1

Go to accounts and under invoice history you can find order number 121123-144314-4850

Thanks for your help...

Link to comment
Share on other sites

Ok, I can View Details on that order (a Z-Wave Controller), but when I Complete Payment (sent to the Gateway _a=gateway&cart_order_id=121123-144314-4850&retrieve=1), I get bounced to _a=confirm with an empty basket.

Your sig says CC514, but you mentioned you are now at CC515. But when (if) you upgraded, did you reapply the code edits and then later remove them? Or did you not reapply the code edits.

This may be all irrelevant as I recall looking into a situation just like I described above a few months back.

Link to comment
Share on other sites

Guest syrontech

I had installed CC 5.1.4 then installed the plugin and then deleted the plugin becasuse it didn't work the way I wanted it to...

I upgraded to 5.1.5 yesterday to see if that made any difference but when I was using 5.1.4 I could complete the order as a customer when there wasn't any other orders processing or pending...

But once I went to 5.1.5 I could complete the orders at all?

Link to comment
Share on other sites

I need for you to answer this:

Using phpMyAdmin (or some other database management utility), look directly at the Cubecart_order_summary table, find cart_order_id of 121123-144314-4850, then look in the column 'basket'.

Please tell me if there is nothing, null, or something (doesn't matter what, it could say 'blob').

based on what Dirty Butter hinted, I am going to focus on whether or not an admin created order set to Pending will save something to the 'basket' column in CC_order_summary.

The basket column contains more things about the order than just what can be held in the individual columns of the CC_order_summary table.

Also, was there a discount (of any kind) available for this order?

Link to comment
Share on other sites

Hi

I have exactly the same problem, creating orders on 5.1.5 and confirm that the entry in the colum basket is empty, where as all the others have contents

along the lines of

a:16:{s:8:"contents";a:1:{s:32:"c69f11196b6d904da4...

etc

the information is not sent to the basket when you create an order in admin for a new customer. If the customer logs in to pay for a created order, it get diverted to a blank page

Complete Payment (sent to the Gateway _a=gateway&cart_order_id=121123-144314-4850&retrieve=1), I get bounced to _a=confirm with an empty basket.

If the customer can add it to their basket it seems to work okay, just orders created via the admin back end.

I get a bit concerned when i run a query and see how many empty baskets there actually are in this table. Does this represent lost sales and empty baskets ???

help, I do have a big order that we created that needs paying by Monday am!

thanks

David

Link to comment
Share on other sites

If I create the order as a customer would and add to basket, but do not pay, the details all appear as expected in the table.. I can even adjust the invoice in the back end which updates it the order the customer created and remains in its changed state, looking to admin to be okay... ie the back end order looks fine and can be updated and saves..

Having made a discount to the order, In this case it is a large order and we need to add in a courier charge of £20.When the customer logs into their account the order details appear when redirected to the confirm page, but the invoice is recreatead, the postage option is forced to select from the postage options, the discounts are removed and it actually shows the original invoice, based on quantity x price.. As though any change in the back end fails to update the basket contents, it cannot create new, or edit unpaid invoices. It does not display the courier charge that the customer needs to pay or the discounted rate on the order that was adjusted. It simply recreates the order..

can anyone edit an order and then see the adjusted invoice amounts when logged in, so the customer can pay the right amount??

table CubeCart_order_inventory has the right detail for the admin update.

the column in CubeCart_order_summary basket is not updated, or created it would seem when adding orders from the back end..

I hope that helps..

thanks.

David

Link to comment
Share on other sites

"The 'basket' column in CubeCart_order_summary is not being created/updated when adding/editing orders from the back end."

Correct. The table column 'basket' contains a serialized listing of the shopping basket that the customer uses and is created/stored when the customer is in the checkout process at the point the customer is ready to choose a method of payment.

I am working on a way to get the admin's actions to also add/edit the 'basket' column.

And for any order summaries in the database that has contents in the 'basket' column, in my opinion these orders were not created in the backend. So when comparing orders that can and cannot be completed when accessed via the customer's Account Order History list, be able to identify which of those orders were created by the admin in the backend, and which were created by a customer (even if it is the admin that is logged in as that customer) in the storefront.

Having said that, I am not finding any evidence where (stock) CC514 would have allowed a backend order to be seen when Complete Payment is chosen, either.

FYI: There are four locations where a customer's intended/actual purchases are stored:

1. The PHP Session file while actively browsing the store

2. The CC_saved_cart database table, if the setting Auto-Save Customer Cart is enabled in Store Settings (this allows for a session to time out, which usually loses the existing shopping basket contents), and auto-loaded back into the shopping basket when the customer re-logs back in

3. The 'basket' column of the CC_order_summary table which contains everything about the order, now called a "Cart", including all discounts, all taxes, all shipping, and the potential for a lot more.

4. The individual columns in CC_order_inventory and CC_order_summary that record just the final quantities and totals.

Link to comment
Share on other sites

Guest syrontech

If you can if a fix for this that'd be great smither?

I don't know why but my basket in is showing null and also the lang is null.

I have been very busy the last couple of days but I think you know what is going on...

Any help would be great...

Thanks...

Link to comment
Share on other sites

Ran into an issue with the code I am playing with: with SEO URLs engaged, whenever the "Add to Basket" button is clicked on the Product Description page, I get a complete copy of the Product Description page right where the shopping basket should be.

And, analyzing the code, I cannot see how anything but that is supposed to happen. Weird. Really held my interest for a couple of days.

But I finally had to set that aside, turn off the SEO URLs, and get back to work on finding a way for the customer to Complete Payment on an administratively created order.

Sorry for the delay.

Link to comment
Share on other sites

I am running my store still on CC4, but created a clean install of 5.1.5 and testing before I upgrade my store. This is one of the features I need to be working before I do the upgrade. I tested adding a new order in the admin panel, then logging in as the customer. I had the same problem, go to complete payment and it says "Your basket is empty." I noticed someone else posted this same issue back in September.

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

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

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