Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 3
Upgrade to 1.5.1.0 stable - Admin Order Creation not working… Unable to add products
 
Flipmedia
Member
 
Avatar
Total Posts:  43
Joined:  2009-09-24
 
Novusweb - 29 June 2011 11:37 AM

In Safari Web Inspector, when clicking Add Selected Product(s) to Order, I was seeing an js error for giftmessage.js.

So, I began tracking that down.

In /js/mage/adminhtml/giftmessage.js, this is what was at lines 167-169:

var newPopupContainer = $('gift_options_configure_new');
$(
document.body).insert({topnewPopupContainer});
newPopupContainer.id 'gift_options_configure';

Now, I’m not a brilliant js guy, by any stretch, but I thought I would try changing line 169 to:

newPopupContainer.id 'gift_options_configure_new';

And, voila! It worked. Products showed up. The sun rose in the East.

Still testing to make sure everthing else is in place, but so far, so good.

I can confirm that changing:

newPopupContainer.id 'gift_options_configure';

to:

newPopupContainer.id 'gift_options_configure_new';

Worked for us…

Ensure you clear both Magento and Browser cache following making change.

Many thanks to Novusweb good work

 
Magento Community Magento Community
Magento Community
Magento Community
 
Novusweb
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2009-05-06
Texas
 

Well, I thought we had it.. but no.

When I first start an order, I cannot add products. If I refresh the page, I see “TypeError: Result of expression ‘newPopupContainer’ [null] is not an object.” as an error for Line 169 of giftmessage.js. (I’ve tried the file both original and as earlier revised; no go. I’m convinced looking at the file it must remain as originally set for the .id value.)

If I again refresh the page, then the error disappears and I can add products, but the CC and shipping information does not appear.

If I yet again refresh the page, the CC info appears, but not the shipping information. Can’t get that to appear in any manner now.

So, if someone has an idea as to how to fix this problem, that would be wonderful!

It appears that the div contents that the js is trying to assign to the new gift message container is not being loaded properly. I have gift options turned off for orders, but also tried it with them on. Again, no go.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Flipmedia
Member
 
Avatar
Total Posts:  43
Joined:  2009-09-24
 

Whilst I did not expereince Novusweb niggles with respect to the tweak to the gift message javascript… I did feel that it seemed a little odd to alter the source when the issue seemed to relate directly to the inclusion of a set of javascripts that where not required for order creation, namely ext js - as referred to by Magento.

I appear to have resolved the issue and I am currently testing to see if this fix has any side affects.

I have used the built-in Magento (as of 1.5) system for excluding certain sets of javascript from particular admin pages / processes.

Simply put I have added a flag stating that ext js should not be loaded for sales order create index via the layout xml for the aforementioned process / page.

As follows:

Edit the following layout xml file:

app/design/adminhtml/default/default/layout/sales.xml

Add the following xml:

<action method=\"setCanLoadExtJs\"><flag>0</flag></action>

In this file change the following:

<adminhtml_sales_order_create_index>
        <
reference name=\"left\">
            <
action method=\"setIsCollapsed\"><value>true</value></action>
        </
reference>
        <
reference name=\"head\">
            <
action method=\"addJs\"><file>mage/adminhtml/sales.js</file></action>

To:

<adminhtml_sales_order_create_index>
        <
reference name=\"left\">
            <
action method=\"setIsCollapsed\"><value>true</value></action>
        </
reference>
        <
reference name=\"head\">
            <
action method=\"setCanLoadExtJs\"><flag>0</flag></action>
            <
action method=\"addJs\"><file>mage/adminhtml/sales.js</file></action>

I will continue to test and hopefully this is the end of this issue…

 
Magento Community Magento Community
Magento Community
Magento Community
 
Novusweb
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2009-05-06
Texas
 

Thanks for this!

I’ll test and let you know.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Flipmedia
Member
 
Avatar
Total Posts:  43
Joined:  2009-09-24
 

Further to this prior version of Magento 1.4.0.2 does not include the ext js on the sales order create index page / process.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Novusweb
Sr. Member
 
Avatar
Total Posts:  89
Joined:  2009-05-06
Texas
 

So far, so good. It appears that after adding products, you still have to click “Update Items and Qty’s” button in order to get the CC information panel to show. I’m not sure if that’s the normal behavior or not.

We’ll continue to test, but it looks good!

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
John290981
Jr. Member
 
Avatar
Total Posts:  5
Joined:  2011-05-25
 

Hello Guys,

Im a Magento newbe, I have been reading thought your posts as i have the same problem.

I have made the amendment in sales.xml however when i do that and refresh cache the orders page is blank.

any more ideas would be appreciated smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
VanGilsWeb
Sr. Member
 
Total Posts:  97
Joined:  2010-03-26
 

We also have this refresh problem. After all these posts I can not see the wood for the trees.

What exactly do we have to do to fix this problem???

 
Magento Community Magento Community
Magento Community
Magento Community
 
akizor88
Jr. Member
 
Total Posts:  6
Joined:  2011-08-17
 
lithiumav - 04 July 2011 01:52 AM

Hello Guys,

Im a Magento newbe, I have been reading thought your posts as i have the same problem.

I have made the amendment in sales.xml however when i do that and refresh cache the orders page is blank.

any more ideas would be appreciated smile

Also have that blank page after doing changes in sales.xml

EDIT

Flipmedia - 28 June 2011 10:14 AM

SOLVED [NikolaiDante] Please read carefully and be warned, I am yet to test if this “fix” impacts on anything / any other function…

I reviewed NikolaiDante fix...

The inclusion of extjs/ext-tree.js is part of the core build and the inclusion of this javascript file is performed via:

/magento/app/design/adminhtml/default/default/layout/main.xml

This is also the file that must be edited to implement this fix…

As pointed out by NikolaiDante, the xml config that includes this file must have an if condition… As my install was completely fresh my build did have the apprioprate “if” condition… As follows:

<action method="addItem"><type>js</type><name>extjs/ext-tree.js</name><params/><if/><condition>can_load_ext_js</condition></action>

In order to get this to work / exclude the ext-tree.js from the areas of the admin interface where it is not required, I change the shorthand xml if condition to a longhand (Note the <if> part below)… As follows:

<action method="addItem"><type>js</type><name>extjs/ext-tree.js</name><params/><if><condition>can_load_ext_js</condition></if></action>

Clear / refresh cache for configurtion / xml layout…

Please note: This appears to work in that, extjs/ext-tree.js is not included in the head of the create order admin page and products can now be added to the order table. I am yet to completely test this and with no documentation with regard to where ext-tree.js is required, it is a little diffcult to tell if it is being included where it should be.

It may be that it is being excluded from everywhere following this change… In turn this may break another part of the admin interface!

Impact of this modification!
If you make the modification in main.xml, “Edit Attribute Set” won’t show attributes for “Groups” and “Unassigned Attributes” panels.

EDIT AGAIN

Problem found
Seems like if u are using PfpjRom Extension(called “Legal entity & natural person Romanian Addresses") in version 1.5 it will certanly cause this problem.
To confirm this simple go to System -> Configuration -> Advanced and look for “PfpjRom” Module Output. If u have it, Disable “PfpjRom_AdminhtmlRom”. Then go to Sales -> Orders -> Create new order -> Create New Customer and see if now works! It should! (probably with some issues there)
This happens because PfpjRom is outdated and works only for Magento version 1.4. This is the only problem caused by this module. (so far)

In conclusion, let’s hope the dev who created this module will update it to Magento version 1.5.x and we shall live happily ever after.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vishal_2811
Jr. Member
 
Avatar
Total Posts:  20
Joined:  2011-04-17
 

Dear all,

I am also facing the same problem and have tried all of the suggestions posted into this thread but all in vain downer
I tried following solutions

<action method="addItem"><type>js</type><name>extjs/ext-tree.js</name><params/><if><condition>can_load_ext_js</condition></if></action>
into /app/design/adminhtml/default/default/layout/main.xml

var newPopupContainer = $('gift_options_configure_new');
$(
document.body).insert({topnewPopupContainer});
newPopupContainer.id 'gift_options_configure';
to
var newPopupContainer = $('gift_options_configure_new');
$(
document.body).insert({topnewPopupContainer});
newPopupContainer.id 'gift_options_configure_new';
into /js/mage/adminhtml/giftmessage.js

<adminhtml_sales_order_create_index>
        <
reference name="left">
            <
action method="setIsCollapsed"><value>true</value></action>
        </
reference>
        <
reference name="head">
            <
action method="addJs"><file>mage/adminhtml/sales.js</file></action>
to
<adminhtml_sales_order_create_index>
        <
reference name="left">
            <
action method="setIsCollapsed"><value>true</value></action>
        </
reference>
        <
reference name="head">
            <
action method="setCanLoadExtJs"><flag>0</flag></action>
            <
action method="addJs"><file>mage/adminhtml/sales.js</file></action>
into app/design/adminhtml/default/default/layout/sales.xml

but NO LUCK downer

Whenever I open the page Sales->Orders->"Create New Order” button, error console shows the error

ErrorproductConfigure is not defined
Source File
http://mydomain.com/index.php/admin/sales_order_create/index/  Line: 2453

and now after choosing the customer and the store when I click on “Add Products” and choose the products to add then hit “Add selected product(s) to order”, it does nothing but throws errors in console

ErrorproductConfigure is not defined
Source File
http://mydomain.com/js/mage/adminhtml/sales.js
Line723

Please help me into this, if anybody have fixed this.

This is very urgent.
Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
staceybw
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2010-04-14
Atlanta, GA
 

I have implemented a fix for the first issue after diving into the code.  It appeared that js/mage/adminhtml/product/composite/configure.js was not being loaded on the page, despite being included in the layout file (line 102 in app/design/adminhtml/default/default/layout/sales.xml):

<action method="addJs"><file>mage/adminhtml/product/composite/configure.js</file></action>

So, I manually added this include to app/design/adminhtml/default/default/template/sales/order/create/js.phtml:

<script type="text/javascript" src="http://mydomain.com/js/mage/adminhtml/product/composite/configure.js"></script>

The full js.phtml looks like this now:

<script type="text/javascript" src="http://mydomain.com/js/mage/adminhtml/product/composite/configure.js"></script>
<script type="text/javascript">
    
order.sidebarHide();
    
Event.observe(window'load',  function() {
        productConfigure
.addListType('product_to_add'{
            urlFetch
'<?php echo $this->getUrl('*/sales_order_create/configureProductToAdd') ?>'
        
});
        
productConfigure.addListType('quote_items'{
            urlFetch
'<?php echo $this->getUrl('*/sales_order_create/configureQuoteItems') ?>'
        
});
    
});
</script>

Now no more JS errors and I’m able to add products to orders created in Admin.

 
Magento Community Magento Community
Magento Community
Magento Community
 
staceybw
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2010-04-14
Atlanta, GA
 

Well, scratch that.  The JS fix only fixed a small part of the issue, but we continued to have other problems such as an error when using the Reorder button in admin.  For some reason, our install does not want to load the configure.js file, even though it is clearly in the sales.xml layout file.

My theme and extensions worked fine when I applied them to a fresh install of Magento 1.5.1.0.  That is, with the exception of one extension that I had to disable (Mageb2bextensions_Customattributes).  WHen it was on, the Sales > Order screen was blank.

So, I blew away my production magento directory (after making a backup, of course), and put this fresh install up there.  Now everything is working, although I still cannot exactly say what the issue was.

 
Magento Community Magento Community
Magento Community
Magento Community
 
esimon
Jr. Member
 
Total Posts:  4
Joined:  2010-02-10
 

No idea what caused this problem, but by simply disable the Mage_GiftMessage module, our problem solved.
so far so good…

Edit:
Well, it appears that we have to refresh the page once, before we add a product…

Edit again:
We need to refresh the page again to make shipping method to work…

It seems like ajax is not updating the page properly. Anyone has any idea to fix it?

Fixed:

It’s ext-tree.js which causes the problem, as mentioned above. However, their xml changes don’t work for me, here’s mine :

change :

<adminhtml_sales_order_create_index>
        <
reference name="left">
            <
action method="setIsCollapsed"><value>true</value></action>
        </
reference>
        <
reference name="head">
            <
action method="addJs"><file>mage/adminhtml/sales.js</file></action>

to :

<adminhtml_sales_order_create_index>
        <
reference name="left">
            <
action method="setIsCollapsed"><value>true</value></action>
        </
reference>
        <
reference name="head">
            <
action method="removeItem"><type>js</type><name>extjs/ext-tree.js</name></action>
            <
action method="addJs"><file>mage/adminhtml/sales.js</file></action>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Essteffan
Jr. Member
 
Total Posts:  8
Joined:  2008-07-03
 
akizor88 - 18 August 2011 06:11 AM

lithiumav - 04 July 2011 01:52 AM
Hello Guys,

Im a Magento newbe, I have been reading thought your posts as i have the same problem.

I have made the amendment in sales.xml however when i do that and refresh cache the orders page is blank.

any more ideas would be appreciated smile

Also have that blank page after doing changes in sales.xml

EDIT

Flipmedia - 28 June 2011 10:14 AM

SOLVED [NikolaiDante] Please read carefully and be warned, I am yet to test if this “fix” impacts on anything / any other function…

I reviewed NikolaiDante fix...

The inclusion of extjs/ext-tree.js is part of the core build and the inclusion of this javascript file is performed via:

/magento/app/design/adminhtml/default/default/layout/main.xml

This is also the file that must be edited to implement this fix…

As pointed out by NikolaiDante, the xml config that includes this file must have an if condition… As my install was completely fresh my build did have the apprioprate “if” condition… As follows:

<action method="addItem"><type>js</type><name>extjs/ext-tree.js</name><params/><if/><condition>can_load_ext_js</condition></action>

In order to get this to work / exclude the ext-tree.js from the areas of the admin interface where it is not required, I change the shorthand xml if condition to a longhand (Note the <if> part below)… As follows:

<action method="addItem"><type>js</type><name>extjs/ext-tree.js</name><params/><if><condition>can_load_ext_js</condition></if></action>

Clear / refresh cache for configurtion / xml layout…

Please note: This appears to work in that, extjs/ext-tree.js is not included in the head of the create order admin page and products can now be added to the order table. I am yet to completely test this and with no documentation with regard to where ext-tree.js is required, it is a little diffcult to tell if it is being included where it should be.

It may be that it is being excluded from everywhere following this change… In turn this may break another part of the admin interface!

Impact of this modification!
If you make the modification in main.xml, “Edit Attribute Set” won’t show attributes for “Groups” and “Unassigned Attributes” panels.

EDIT AGAIN

Problem found
Seems like if u are using PfpjRom Extension(called “Legal entity & natural person Romanian Addresses") in version 1.5 it will certanly cause this problem.
To confirm this simple go to System -> Configuration -> Advanced and look for “PfpjRom” Module Output. If u have it, Disable “PfpjRom_AdminhtmlRom”. Then go to Sales -> Orders -> Create new order -> Create New Customer and see if now works! It should! (probably with some issues there)
This happens because PfpjRom is outdated and works only for Magento version 1.4. This is the only problem caused by this module. (so far)

In conclusion, let’s hope the dev who created this module will update it to Magento version 1.5.x and we shall live happily ever after.

You are right.

That was my problem to.

Thanks!!!  best advice

Stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
cyberlab
Member
 
Avatar
Total Posts:  51
Joined:  2011-12-29
Brazil - Curitiba - PR
 

I have tested this for 1.6 version and is working fino, but not uninstallation has posible that not use in production mode.

This script needs to be copied in the root of your Magento installation and ran only once (in case of multiple executions exceptions will be threw, so no harm will be caused for your database).

regards

<?php

function pr($p_mData{
    
echo '<pre>'print_r($p_mDatatrue). '</pre>';
}

/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   Mage
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

if (version_compare(phpversion(), '5.2.0''<')===true{
    
echo  '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer. <a href="http://www.magentocommerce.com/install" target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>';
    exit;
}

/**
 * Error reporting
 */
error_reporting(E_ALL E_STRICT);

/**
 * Compilation includes configuration file
 */
$compilerConfig 'includes/config.php';
if (
file_exists($compilerConfig)) {
    
include $compilerConfig;
}

$mageFilename 
'app/Mage.php';
$maintenanceFile 'maintenance.flag';

if (!
file_exists($mageFilename)) {
    
if (is_dir('downloader')) {
        header
("Location: downloader");
    
else {
        
echo $mageFilename." was not found";
    
}
    
exit;
}

if (file_exists($maintenanceFile)) {
    
include_once dirname(__FILE__) . '/errors/503.php';
    exit;
}

require_once $mageFilename;

Varien_Profiler::enable();

//if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    
Mage::setIsDeveloperMode(true);
//}

ini_set('display_errors'1);

umask(0);

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE''';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE''store';

Mage::app($mageRunCode$mageRunType);

// the codes of the forms
$l_aFormCodes = array(
    
'customer_address_edit',
    
'adminhtml_customer_address'
);

// the attribute codes of the attributes that we need to add to the forms
$l_aAttributesCodes = array(
    
'pfpj_tip_pers',
    
'pfpj_cui',
    
'pfpj_reg_com',
    
'pfpj_banca',
    
'pfpj_iban',
    
'pfpj_cnp',
    
'pfpj_serienr_buletin',
    
'pfpj_for_billing',
    
'pfpj_for_shipping'
);

// attribute collection
$l_oAttributeCollection Mage::getModel('eav/entity_attribute')->getCollection()
    ->
addFieldToFilter('attribute_code', array('in' => $l_aAttributesCodes));

// table name
$l_sTableName Mage::getSingleton('core/resource')->getTableName('customer_form_attribute');

// write connection
$l_oWrite Mage::getSingleton('core/resource')->getConnection('core_write');

foreach (
$l_oAttributeCollection as $l_aAttribute{

    pr
('adding '$l_aAttribute->getAttributeCode(). ' to \'customer_address_edit\' form');
    
pr('adding '$l_aAttribute->getAttributeCode(). ' to \'adminhtml_customer_address\' form');

    
$l_iAttributeId $l_aAttribute['attribute_id'];

    
// adds the attribute to 'customer_address_edit' form
    
$l_sSQL " insert into $l_sTableName set form_code = 'customer_address_edit', attribute_id = ". (int)$l_iAttributeId;
    
$l_oWrite->query($l_sSQL);

    
// adds the attribute to 'adminhtml_customer_address' form
    
$l_sSQL " insert into $l_sTableName set form_code = 'adminhtml_customer_address', attribute_id = ". (int)$l_iAttributeId;
    
$l_oWrite->query($l_sSQL);
}

fin more:
http://magento.reea.net/?p=101

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 3