Jump to content

Cannot create an Order


Claudia
 Share

Recommended Posts

Well, you get one thing working right and something else pops up.  I cannot create an order. I have a custom admin skin and when I click create order this is what I get.  When I look in the web developer tools I get this error message. I tested this in Firefox and Microsoft Edge.  I don't have other browsers installed.

This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.

FYI:  the main template in admin / skins has the <!DOCTYPE html> at the top.

 

When I switch to the default admin skin it will let me input the order information, saves it, but then it doesn't show and it is gone.

393049498_CreateOrder.thumb.PNG.0bcf8ed75c7c5c4b49d334e387713e05.PNG

 

When I sell something on ebay or etsy I create an order for that in CC.  I move the main image to a folder I call aaa and delete the original folder the images were in.  There is no way to move the photos.  It just says "Please select …"  I went to the GitHub and saw the fix for this and applied it.
Link to comment
Share on other sites

Could this have anything to do with the code snippet your made for me to add a new tab in the orders?  Maybe it doesn't work with PHP 8?

 

<?php

if($_GET['_g'] == 'orders' && (!isset($_GET['node']) || $_GET['node'] == 'index') && isset($_GET['action']) && in_array($_GET['action'], array('add','edit'))) {

  $tab['name'] = 'More Order Info';

  $tab['tab_id'] = 'tab_moreorderinfo';

  $tab['target'] = '#moreorderinfo'; 

  $tabs[] = $tab;

}

Unique ID:  [email protected]

trigger: admin.tabs

Link to comment
Share on other sites

I have been working on this for days!!!!!!!  I have uploaded ALL stock files for 6.4.9 and I still cannot create an order.  It lets me input the info but when I click save I get a white screen.  I turned on debug in admin and this is the only warning I get

 

[Warning] /home/xxxxxxx/public_html/classes/language.class.php:94 - Undefined variable $cache[Deprecated]

 

I have cleared the cache thru admin and manually thru cPanel

 

This is driving me nuts!  At this point I don't even care if it was something stupid I did.  I just want to create an order! LOL

Link to comment
Share on other sites

A white screen.

That suggests that PHP crashed. I believe PHP cannot crash so bad that it fails to log an entry in its own error_log. So, if not having done so already, please see:

https://forums.cubecart.com/topic/51550-how-to-create-the-error-log/

However, I have also found that Smarty, the template rendering engine, if there is a syntax error in the template, will cause a white screen without allowing PHP to log the offending line of the template. (There may be a work-around.)

(The undefined variable is covered in this issue in the Github:)

https://github.com/cubecart/v6/issues/3116

In the browser's Developer's Tools (engaged via F12), the Network tab will show the POST action. IF! a response comes back from the POST, it will usually be a command to GET a certain page. The browser then sends a GET request for that page, the response being, perhaps happening here with you, an error: 500.

If you see a GET that followed the POST, then we know that CubeCart processed the POST - and hopefully databased the form's data.

If there is no GET after the POST, or no POST at all, then something went wrong processing the data.

There is also the possibility, however unlikely, that CubeCart has an undiscovered bug that the code execution simply comes to a dead end - with nothing to show for it.

(I haven't yet tried this, but it seems to me that if CubeCart cannot send the debug report, it stays "spooled" internally until a page can be sent out. So, after the white screen, the next page received could have several debug sections. If so, the first would be the POST being processed, the second would be the follow-on GET request that faulted, and the third would be the GET request that succeeded.)

Link to comment
Share on other sites

My error log in cPanel is 70.31 MB. It won't let me edit it to clear it.  I can view it.  Here's the last few entries

[19-Jan-2023 13:47:42 America/Louisville] PHP Warning:  Undefined array key "/images/cache/lunchbox-disney-magic-kingdom-wonderful-world/09-lunchbox-disney-magic-kingdom-wonderful-world-back-side.600.jpg" in /home/cambarga/public_html/classes/catalogue.class.php on line 2154
[19-Jan-2023 13:47:42 America/Louisville] PHP Warning:  Undefined array key "/images/source/lunchbox-disney-magic-kingdom-wonderful-world/09-lunchbox-disney-magic-kingdom-wonderful-world-back-side.jpg" in /home/cambarga/public_html/classes/catalogue.class.php on line 2154
[19-Jan-2023 13:47:42 America/Louisville] PHP Warning:  Undefined variable $random_product in /home/xxxx/public_html/classes/gui.class.php on line 1348
[19-Jan-2023 13:47:42 America/Louisville] PHP Warning:  Undefined variable $cache_id in /home/xxxx/public_html/classes/gui.class.php on line 1305
[19-Jan-2023 13:47:42 America/Louisville] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/xxxx/public_html/classes/cache/file.class.php on line 224

That luncbox has nothing to do with the order I was trying to create.

In the deBug when trying to create the order I get this:

PHP:
[Warning] /home/xxxxxx/public_html/classes/order.class.php:194 - Undefined global variable $cart[Exception] /home/xxxxx/public_html/classes/order.class.php:194 - method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given

https://github.com/cubecart/v6/issues/3116

I fixed code from above

This is what I get in developer tools thru Firefox.  Please remember you are really getting out of my depth here and I don't have a clue what any of this means.

GET-POST.thumb.PNG.a632e1bb4cf731dc147ba02592486292.PNG

Link to comment
Share on other sites

The "smoking gun" is this:

[Exception] /home/xxxxx/public_html/classes/order.class.php:194
- method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given 

When in admin, an instantiation of the Cart class (assigned to the variable $GLOBAL['cart']) just does not exist.

How this has not been found many, many versions ago, I cannot imagine.

Working on it.

Link to comment
Share on other sites

Please try this edit. (I haven't verified this myself.) In the file /controllers/controller.admin.pre_session.inc.php:

Find:

//Initialize Catalogue
$GLOBALS['catalogue'] = Catalogue::getInstance();

Add after:

// Instantiate Cart
$GLOBALS['cart'] = Cart::getInstance();

This particular white screen situation hasn't been found in prior versions because it is directly related to PHP8 (vs PHP7).

I will post this to the Github. There are several possible solutions to the essential issue here, this probably providing the broadest coverage for any other unknown situations.

Edited by bsmither
Link to comment
Share on other sites

For some reason the More Info tab you helped me with for my admin orders is still showing as way above in the first post if I use it.  If I comment it out all works as it should.  I know this sounds weird but it seems to be the input code.  Here's a sample.  Any ideas what's causing it not to work?

<table width="34%" style="margin-right: 4px;float:left;">
<thead>
            <tr>
                <th width="26%">Cost and Fees Value</th>
                </tr>
        </thead>
        <tbody>
    <tr> <td>{$SUMMARY.box_list} </td>  </tr>
    <tr> <td>{$product.cost_price / $product.quantity} x {$product.quantity} = {($product.quantity * $product.cost_price / $product.quantity)|string_format:"%01.2f"} </td> </tr>
    <tr> <td>{$SUMMARY.multi_cost} </td> </tr>
    <tr> <td>{$SUMMARY.cost_box} </td> </tr>
     <tr> <td>{$SUMMARY.cost_handling} </td>  </tr>
    <tr> <td>{$SUMMARY.fee_ebay_fvf} </td> </tr>
    <tr> <td>{$SUMMARY.fee_etsy_insert} </td> </tr>
    <tr> <td>{$SUMMARY.fee_etsy_fvf} </td> </tr>
    <tr> <td>{$SUMMARY.fee_etsy_sales} </td>  </tr>
    <tr> <td>{$SUMMARY.fee_pp} </td> </tr>
    <tr> <td>{$SUMMARY.actual_shipping} </td> </tr>
    </tbody>
</table>
        <table width="34%" style="margin-right: 4px;float:left;">
<thead>
            <tr>
                <th width="37%">Cost and Fees Input</th>
                </tr>
        </thead>
        <tbody>
    <tr> <td><input type="text" id="box_list" name="summary[box_list]" value="{$SUMMARY.box_list}" class="textbox" style="width:175px"> </td>  </tr>
    <tr> <td>{$product.cost_price / $product.quantity} x {$product.quantity} = {($product.quantity * $product.cost_price / $product.quantity)|string_format:"%01.2f"} </td> </tr>
    <tr> <td><input type="text" id="multi_cost" name="summary[multi_cost]" value="{$SUMMARY.multi_cost}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="cost_box" name="summary[cost_box]" value="{$SUMMARY.cost_box}" class="textbox" style="width:175px"> </td> </tr>
     <tr> <td><input type="text" id="cost_handling" name="summary[cost_handling]" value="{$SUMMARY.cost_handling}" class="textbox" style="width:175px"> </td>  </tr>
    <tr> <td><input type="text" id="fee_ebay_fvf" name="summary[fee_ebay_fvf]" value="{$SUMMARY.fee_ebay_fvf}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="fee_etsy_insert" name="summary[fee_etsy_insert]" value="{$SUMMARY.fee_etsy_insert}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="fee_etsy_fvf" name="summary[fee_etsy_fvf]" value="{$SUMMARY.fee_etsy_fvf}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="fee_etsy_sales" name="summary[fee_etsy_sales]" value="{$SUMMARY.fee_etsy_sales}" class="textbox" style="width:175px"> </td>  </tr>
    <tr> <td><input type="text" id="fee_pp" name="summary[fee_pp]" value="{$SUMMARY.fee_pp}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="actual_shipping" name="summary[actual_shipping]" value="{$SUMMARY.actual_shipping}" class="textbox" style="width:175px"> </td> </tr>
    </tbody>
</table>    
</td> </tr>
</table>

 

Link to comment
Share on other sites

"is still showing as way above in the first post"

I do not understand this. Your original post shows a selected area screen capture that obviously the CSS is not getting applied to any of the page.

Is that still happening?

The code posted above seems to be that of two tables, basically side-by-side if the browser window is wide enough.

However, the last two lines of code suggests that you are ending a table that encloses the previously mentioned two tables. But there is no beginning code to start that enclosing table.

Edited by bsmither
Link to comment
Share on other sites

This works fine if I don't use the More Info Tab you created with the code snippet. 

Sorry, I didn't give you the whole code for that one table.  There are more tables similair to this.

<table width="97%" style="float:left;margin-bottom:30px;">            
           <tr> <td>
            
            <table width="29%" style="margin-right: 4px;float:left;">
<thead>
        <tr>
                <th width="37%">Cost and Fees</th>
                </tr>
        </thead>
        <tbody>
   <tr> <td><strong>Removed from Box List</strong> </td>   </tr>
   <tr> <td><strong>Item Cost</strong> </td>  </tr>
   <tr> <td><strong>Items Cost</strong> </td> </tr>
   <tr> <td><strong>Box Cost</strong> </td> </tr>
   <tr> <td><strong>Total Box and Handling</strong> </td> </tr>
   <tr> <td><strong>eBay FVF</strong> </td> </tr>
   <tr> <td><strong>Etsy Insertion Fee</strong> </td> </tr>
   <tr> <td><strong>Etsy Transaction Fee</strong> </td> </tr>
    <tr> <td><strong>Etsy Processing Fee</strong> </td> </tr>
   <tr> <td><strong>PayPal Fee</strong> </td> </tr>
   <tr> <td><strong>Actual Shipping</strong> </td> </tr>

</tbody>
</table>

             <table width="34%" style="margin-right: 4px;float:left;">
<thead>
            <tr>
                <th width="26%">Cost and Fees Value</th>
                </tr>
        </thead>
        <tbody>
    <tr> <td>{$SUMMARY.box_list} </td>  </tr>
    <tr> <td>{$product.cost_price / $product.quantity} x {$product.quantity} = {($product.quantity * $product.cost_price / $product.quantity)|string_format:"%01.2f"} </td> </tr>
    <tr> <td>{$SUMMARY.multi_cost} </td> </tr>
    <tr> <td>{$SUMMARY.cost_box} </td> </tr>
     <tr> <td>{$SUMMARY.cost_handling} </td>  </tr>
    <tr> <td>{$SUMMARY.fee_ebay_fvf} </td> </tr>
    <tr> <td>{$SUMMARY.fee_etsy_insert} </td> </tr>
    <tr> <td>{$SUMMARY.fee_etsy_fvf} </td> </tr>
    <tr> <td>{$SUMMARY.fee_etsy_sales} </td>  </tr>
    <tr> <td>{$SUMMARY.fee_pp} </td> </tr>
    <tr> <td>{$SUMMARY.actual_shipping} </td> </tr>
    </tbody>
</table>
        <table width="34%" style="margin-right: 4px;float:left;">
<thead>
            <tr>
                <th width="37%">Cost and Fees Input</th>
                </tr>
        </thead>
        <tbody>
    <tr> <td><input type="text" id="box_list" name="summary[box_list]" value="{$SUMMARY.box_list}" class="textbox" style="width:175px"> </td>  </tr>
    <tr> <td>{$product.cost_price / $product.quantity} x {$product.quantity} = {($product.quantity * $product.cost_price / $product.quantity)|string_format:"%01.2f"} </td> </tr>
    <tr> <td><input type="text" id="multi_cost" name="summary[multi_cost]" value="{$SUMMARY.multi_cost}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="cost_box" name="summary[cost_box]" value="{$SUMMARY.cost_box}" class="textbox" style="width:175px"> </td> </tr>
     <tr> <td><input type="text" id="cost_handling" name="summary[cost_handling]" value="{$SUMMARY.cost_handling}" class="textbox" style="width:175px"> </td>  </tr>
    <tr> <td><input type="text" id="fee_ebay_fvf" name="summary[fee_ebay_fvf]" value="{$SUMMARY.fee_ebay_fvf}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="fee_etsy_insert" name="summary[fee_etsy_insert]" value="{$SUMMARY.fee_etsy_insert}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="fee_etsy_fvf" name="summary[fee_etsy_fvf]" value="{$SUMMARY.fee_etsy_fvf}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="fee_etsy_sales" name="summary[fee_etsy_sales]" value="{$SUMMARY.fee_etsy_sales}" class="textbox" style="width:175px"> </td>  </tr>
    <tr> <td><input type="text" id="fee_pp" name="summary[fee_pp]" value="{$SUMMARY.fee_pp}" class="textbox" style="width:175px"> </td> </tr>
    <tr> <td><input type="text" id="actual_shipping" name="summary[actual_shipping]" value="{$SUMMARY.actual_shipping}" class="textbox" style="width:175px"> </td> </tr>
    </tbody>
</table>    
</td> </tr>
</table>

 

Link to comment
Share on other sites

I don't understand what is going on here. If I put the above block of code in my "More Info" tab it looks fine for orders already created.  But, if I click on Create an Order the screen looks like this (Same as beginning of post).  Any ideas as to why?  I thought it might have to do with "input" but not sure

446640369_CreateOrder.thumb.PNG.efaa835067255af4850ef840b3552ab2.PNG

Link to comment
Share on other sites

If using Firefox, there may be a way to find the fault. Other browsers may or may not do this as well.

On this page, right click with the mouse. There may be a menu option to show the page source. If so, click that choice and new window will open.

This window will show the page's source - hopefully color-coded.

Scroll through the code looking for anything in a bright red color.

Link to comment
Share on other sites

I think it may be this line. When I deleted it, it seems to work. Very early testing.  I'm going to try your way with full code

    <tr> <td>{$product.cost_price / $product.quantity} x {$product.quantity} = {($product.quantity * $product.cost_price / $product.quantity)|string_format:"%01.2f"} </td> </tr>

I got this error:

[<strong>Exception</strong>] /home/xxxxxx/public_html/cache/skin/c026dd1e5327da79bb92cc396f86efc387fc62ea_0.file.orders.index.php.php:1223 - Division by zero
https://www.cambargainstore.com/admin_xxxxxx_g=orders&node=index&action=add

Edited by Claudia
Link to comment
Share on other sites

This can be simplified:

($product.quantity * $product.cost_price / $product.quantity)

is like:

A*B
---
 A

The rules of algebra will have
the A variables cancel each other.

But if {$product.quantity} is zero, that will cause a serious problem.

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

 Share

×
×
  • Create New...