0

I'm trying to create a new attribute, but my install script does not run.

etc/config.xml

<modules>
 <Namespace_ShippingPrices>
 <version>0.1.0</version>
 </Namespace_ShippingPrices>
</modules>
<global>
 ...
 <resources>
 <namespace_shippingprices_setup>
 <setup>
 <module>Namespace_ShippingPrices</module>
 <class>Mage_Eav_Model_Entity_Setup</class>
 </setup>
 </namespace_shippingprices_setup>
 </resources>
</global>

sql/namespace_shippingprices_setup/install-0.1.0.php

<?php
/* @var $installer Mage_Eav_Model_Entity_Setup */
$installer = $this;
$entityType = Mage_Catalog_Model_Product::class;
$productGroup = 'Prices';
$attributes = [
 'namespace_shipping_price' => [
 'type' => 'decimal',
 'label' => 'Shipping costs',
 ]
];
foreach ($attributes as $attributeName => $attribute) {
 $createdAttribute = $installer->addAttribute(
 $entityType,
 $attributeName,
 [
 'backend_type' => $attribute['type'],
 'label' => $attribute['label'],
 'group' => $productGroup,
 'user_defined' => true,
 'required' => false,
 ]
 );
}

I can't find anything in logs and also in core_resource the module is not available.

Marius
199k55 gold badges431 silver badges837 bronze badges
asked May 18, 2017 at 14:58
2
  • Do you see the module in Configuration > Advanced? Commented May 18, 2017 at 15:09
  • Yes, I can see the module in there Commented May 19, 2017 at 7:01

1 Answer 1

0

Seems I have a totally different issue. When changing app/code/core/Mage/Core/Model/App.php:424

if (!$this->_config->loadModulesCache()) {

To

if ($this->_config->loadModulesCache()) {

It does load. So I'm going to find out why my cache doesn't clear.

answered May 19, 2017 at 8:08
1
  • It is typically advised to manually clear cache after deploying a code change. Commented May 19, 2017 at 13:06

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.