1

any one can solve this problem? Tabs are not showing for newly added product
enter image description here

Tabs are not showing for newly added product
I have This Problem Too But I cant Find Any Solution
I have This Error When Inspecting page:

Uncaught TypeError: Cannot read property 'up' of null
at (index):1011

also save button not working and when i click it it shows rhe error:

Uncaught TypeError: Cannot read property 'submit' of undefined at HTMLButtonElement.onclick ((index):1003)

I check all files and found the module that cause the problem in my case.
in this module we have two attribute that added to new product form:

domestic_shipping_cost
international_shipping_cost

and for some unknown reason they missed when magento wants to load general tab.

I search some more and found the line of code, in app\design\adminhtml\default\default\template\marketplace\catalog\product:
edit.phtml

<?php
/**
 * Template for Mage_Adminhtml_Block_Catalog_Product_Edit
 */
?>
<div class="content-header">
    <h3 class="icon-head head-products"><?php echo $this->getHeader() ?></h3>
    <p class="content-buttons form-buttons"><?php echo $this->getBackButtonHtml() ?>
    <?php echo $this->getCancelButtonHtml() ?>
    <?php if($this->getProductId()): ?>
        <?php echo $this->getDeleteButtonHtml() ?>
        <?php if($this->getProductSetId() && $this->getIsConfigured()): ?>
            <?php echo $this->getDuplicateButtonHtml() ?>
        <?php endif; ?>
    <?php endif; ?>
    <?php if($this->getProductSetId() && $this->getIsConfigured()): ?>
        <?php echo $this->getSaveButtonHtml() ?>
        <?php echo $this->getSaveAndEditButtonHtml() ?>
    <?php endif; ?>
    </p>
</div>
<form action="<?php echo $this->getSaveUrl() ?>" method="post" id="product_edit_form" enctype="multipart/form-data">
    <?php echo $this->getBlockHtml('formkey')?>
    <div style="display:none"></div>
</form>
<script type="text/javascript">
<?php $seller = Mage::getModel('marketplace/seller')->isSeller(); ?>
<?php $type = Mage::app()->getRequest()->getParam('type'); ?>
<?php $product_state = Mage::app()->getRequest()->getActionName(); ?>
<?php $product_status = intval(Mage::getStoreConfig('marketplace/seller/product_status')); ?>

<?php if($seller) :?>
if($('product_status') != null)    
    {
     <?php if( $product_state == 'new'): ?>
        document.getElementById("product_status").value= <?php echo $product_status ?>;
    <?php endif; ?>
    $('product_status').up().up().hide();
    }
<?php endif; ?>
<!--Mahoski-->
<?php if(!Mage::getStoreConfig('carriers/marketplaceproductshipping/active') || ($type == 'virtual' || $type == 'downloadable')  ): ?>
    $('domestic_shipping_cost').up().up().hide();
    $('international_shipping_cost').up().up().hide();
<?php endif; ?>
//<![CDATA[
    var productTemplateSyntax = /(^|.|\r|\n)({{(\w+)}})/;
    var productForm = new varienForm('product_edit_form', '<?php echo $this->getValidationUrl() ?>');
    productForm._processValidationResult = function(transport) {
        var response = transport.responseText.evalJSON();
        if (response.error){
            if (response.attribute && $(response.attribute)) {
                $(response.attribute).setHasError(true, productForm);
                Validation.ajaxError($(response.attribute), response.message);
                if (!Prototype.Browser.IE){
                    $(response.attribute).focus();
                }
            }
            else if ($('messages')) {
                $('messages').innerHTML = '<ul class="messages"><li class="error-msg"><ul><li>' + response.message + '</li></ul></li></ul>';
            }
        }
        else{
            productForm._submit();
        }
    };
    function saveAndContinueEdit(urlTemplate) {
        var template = new Template(urlTemplate, productTemplateSyntax);
        var url = template.evaluate({tab_id:product_info_tabsJsTabs.activeTab.id});
        productForm.submit(url);
    }
    function setSettings(urlTemplate, setElement, typeElement) {
        var template = new Template(urlTemplate, productTemplateSyntax);
        setLocation(template.evaluate({attribute_set:$F(setElement),type:$F(typeElement)}));
    }

     function setSuperSettings(urlTemplate, attributesClass, validateField) {
        var attributesFields = $$('.' + attributesClass);
        var attributes = Form.serializeElements(attributesFields, true).attribute;
        if(typeof attributes == 'string') {
            attributes = [attributes];
        }

        if(!attributes) {
            $(validateField).value = 'no-attributes';
        } else {
            $(validateField).value = 'has-attributes';
        }

        if (productForm.validator.validate()) {
            var template = new Template(urlTemplate, productTemplateSyntax);
            var url = template.evaluate({
                attributes: encode_base64(attributes.join(',')).replace(new RegExp('/','g'),'%2F').replace(new RegExp('=','g'),'%3D')
            });
            setLocation(url);
        }
    }

    function checkMaxLength(Object, MaxLen)
    {
        if (Object.value.length > MaxLen-1) {
            Object.value = Object.value.substr(0, MaxLen);
        }
        return 1;
    }

Event.observe(window, 'load', function() {
    var objName = '<?php echo $this->getSelectedTabId() ?>';
    if (objName) {
        obj = $(objName);
        //IE fix (bubbling event model)
        product_info_tabsJsTabs.setSkipDisplayFirstTab();
        product_info_tabsJsTabs.showTabContent(obj);
    }
    Product.AttributesBridge.setTabsObject(product_info_tabsJsTabs);
});

Validation.addAllThese([
    ['validate-super-product-attributes', '<?php echo Mage::helper('catalog')->__('Please select one or more attributes.') ?>', function(v) {
                return (v != "no-attributes");
            }]]);
//]]>
</script>

when i remove this Condition:!Mage::getStoreConfig('carriers/marketplaceproductshipping/active') from if of above code :

<?php if(!Mage::getStoreConfig('carriers/marketplaceproductshipping/active') || ($type == 'virtual' || $type == 'downloadable')  ): ?>
    $('domestic_shipping_cost').up().up().hide();
    $('international_shipping_cost').up().up().hide();
<?php endif; ?>  

it will be fix and working good but i cant understand what this Condition mean and what happened to my database or attributes?

  • If you have exstensions installed that modifiy product edit page? If yes, please check JS files there. – sv3n Jun 15 '17 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.