Module written in 2.1.3 does not work in Magento 2.3.1Magento 2.3.1 installation ErrorMagento 2.3.1 Error on checkout getAdditionalInformation()Issue while generating db_schema file for existing module Magento 2.3.1Magento 2.3.1 is not working in XamppMagento 2.3.1- Problem with Payment not showing the payment optionshtmlContent not working in Magento 2.3.1 from Magento 2.3.0Categrory URL Rewrite Not Working After Upgrading To Magento 2.3.1 from Magento 2.3.0Magento 2.3.1 Incompatible argument typeMagento 2.3.1: Customer account edit page translationMagento - 2.3.1 Possible Problems?

Why are oscilloscope input impedances so low?

Where to draw the line between quantum mechanics theory and its interpretation(s)?

How do I, as a DM, handle a party that decides to set up an ambush in a dungeon?

Game artist computer workstation set-up – is this overkill?

Why would a military not separate its forces into different branches?

Is there precedent or are there procedures for a US president refusing to concede to an electoral defeat?

As black, how should one respond to 4. Qe2 by white in the Russian Game, Damiano Variation?

Is there a word for food that's gone 'bad', but is still edible?

Looking for sci-fi book based on Hinduism/Buddhism

Page count conversion from single to double-space for submissions

What happens if I accidentally leave an app running and click "Install Now" in Software Updater?

Krull dimension of the ring of global sections

Counting the Number of Real Roots of A Polynomial

Will a God Eternal enchanted with Deep Freeze shuffle back into the deck if it dies?

Is any special diet an effective treatment of autism?

Dangerous workplace travelling

Why didn't this character get a funeral at the end of Avengers: Endgame?

It isn’t that you must stop now

Should I simplify my writing in a foreign country?

What Kind of Wooden Beam is this

Is space itself expanding or is it just momentum from the big bang carrying things apart?

How to remap repeating commands i.e. <number><command>?

What is the closest airport to the center of the city it serves?

How to pass hash as password to ssh server



Module written in 2.1.3 does not work in Magento 2.3.1


Magento 2.3.1 installation ErrorMagento 2.3.1 Error on checkout getAdditionalInformation()Issue while generating db_schema file for existing module Magento 2.3.1Magento 2.3.1 is not working in XamppMagento 2.3.1- Problem with Payment not showing the payment optionshtmlContent not working in Magento 2.3.1 from Magento 2.3.0Categrory URL Rewrite Not Working After Upgrading To Magento 2.3.1 from Magento 2.3.0Magento 2.3.1 Incompatible argument typeMagento 2.3.1: Customer account edit page translationMagento - 2.3.1 Possible Problems?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I just upgraded my site from Magento 2.1 to 2.3 and while most of my site still works, I have a particular code which has partially failed to work. The code is supposed to get the "details" attribute and display it on my product page, but somehow I am unable to get the data anymore. The alt image still works, so I have no idea what's up. Help is much appreciated!



<?php
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Product additional attributes template
*
* @var $block MagentoCatalogBlockProductViewAttributes
*/
?>
<?php
$_helper = $this->helper('MagentoCatalogHelperOutput');
$_product = $block->getProduct()
?>
<table class="moreinfo">
<tr>
<td id="altimage">
<?php
$images = $_product->getMediaGalleryImages();
//$images = $this->getGalleryImages($_product);

//print "n" . ' here2 ' . get_class($images) . ' :: <br/>' . "n";
if ($images instanceof MagentoFrameworkDataCollection)
$i = 1;
foreach ($images as $image)
$item = $image->getData();
if ( !isset($item['media_type'])


?>
</td>
<td id="productdescriptiondt" class="hidden-xs" style="min-width:20em; vertical-align: middle">
<?php if ($_additional = $block->getAdditionalData()): ?>
<div class="additional-attributes-wrapper table-wrapper">
<table class="data table additional-attributes" id="product-attribute-specs-table">
<caption class="table-caption"><?php /* @escapeNotVerified */ echo __('More Information') ?></caption>
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th>
<td class="col data" data-th="<?php echo $block->escapeHtml(__($_data['label'])) ?>"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
</td>
</tr>
</table>
<div id="productdescriptionmobile" class="visible-xs">
<?php if ($_additional = $block->getAdditionalData()): ?>
<div class="additional-attributes-wrapper table-wrapper">
<table class="data table additional-attributes" id="product-attribute-specs-table">
<caption class="table-caption"><?php /* @escapeNotVerified */ echo __('More Information') ?></caption>
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th>
<td class="col data" data-th="<?php echo $block->escapeHtml(__($_data['label'])) ?>"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
</div>
<?php

// $_product->getAttributeSetId(); // 9 for Clocks

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$attributeSet = $objectManager->create('MagentoEavApiAttributeSetRepositoryInterface');
$attributeSetRepository = $attributeSet->get($_product->getAttributeSetId());
$attribute_set_name = $attributeSetRepository->getAttributeSetName();

if ( 'Clocks' == $attribute_set_name )

echo $block->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('product_view_clocks')->toHtml();

elseif ( 'Watches' == $attribute_set_name )

echo $block->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('product_view_watches')->toHtml();














share|improve this question







New contributor




user80030 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Can you please confirm block class is class="MagentoCatalogBlockProductViewAttributes" in catalog_product_view,xml.

    – Pritam Info 24
    2 days ago

















1















I just upgraded my site from Magento 2.1 to 2.3 and while most of my site still works, I have a particular code which has partially failed to work. The code is supposed to get the "details" attribute and display it on my product page, but somehow I am unable to get the data anymore. The alt image still works, so I have no idea what's up. Help is much appreciated!



<?php
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Product additional attributes template
*
* @var $block MagentoCatalogBlockProductViewAttributes
*/
?>
<?php
$_helper = $this->helper('MagentoCatalogHelperOutput');
$_product = $block->getProduct()
?>
<table class="moreinfo">
<tr>
<td id="altimage">
<?php
$images = $_product->getMediaGalleryImages();
//$images = $this->getGalleryImages($_product);

//print "n" . ' here2 ' . get_class($images) . ' :: <br/>' . "n";
if ($images instanceof MagentoFrameworkDataCollection)
$i = 1;
foreach ($images as $image)
$item = $image->getData();
if ( !isset($item['media_type'])


?>
</td>
<td id="productdescriptiondt" class="hidden-xs" style="min-width:20em; vertical-align: middle">
<?php if ($_additional = $block->getAdditionalData()): ?>
<div class="additional-attributes-wrapper table-wrapper">
<table class="data table additional-attributes" id="product-attribute-specs-table">
<caption class="table-caption"><?php /* @escapeNotVerified */ echo __('More Information') ?></caption>
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th>
<td class="col data" data-th="<?php echo $block->escapeHtml(__($_data['label'])) ?>"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
</td>
</tr>
</table>
<div id="productdescriptionmobile" class="visible-xs">
<?php if ($_additional = $block->getAdditionalData()): ?>
<div class="additional-attributes-wrapper table-wrapper">
<table class="data table additional-attributes" id="product-attribute-specs-table">
<caption class="table-caption"><?php /* @escapeNotVerified */ echo __('More Information') ?></caption>
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th>
<td class="col data" data-th="<?php echo $block->escapeHtml(__($_data['label'])) ?>"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
</div>
<?php

// $_product->getAttributeSetId(); // 9 for Clocks

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$attributeSet = $objectManager->create('MagentoEavApiAttributeSetRepositoryInterface');
$attributeSetRepository = $attributeSet->get($_product->getAttributeSetId());
$attribute_set_name = $attributeSetRepository->getAttributeSetName();

if ( 'Clocks' == $attribute_set_name )

echo $block->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('product_view_clocks')->toHtml();

elseif ( 'Watches' == $attribute_set_name )

echo $block->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('product_view_watches')->toHtml();














share|improve this question







New contributor




user80030 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Can you please confirm block class is class="MagentoCatalogBlockProductViewAttributes" in catalog_product_view,xml.

    – Pritam Info 24
    2 days ago













1












1








1








I just upgraded my site from Magento 2.1 to 2.3 and while most of my site still works, I have a particular code which has partially failed to work. The code is supposed to get the "details" attribute and display it on my product page, but somehow I am unable to get the data anymore. The alt image still works, so I have no idea what's up. Help is much appreciated!



<?php
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Product additional attributes template
*
* @var $block MagentoCatalogBlockProductViewAttributes
*/
?>
<?php
$_helper = $this->helper('MagentoCatalogHelperOutput');
$_product = $block->getProduct()
?>
<table class="moreinfo">
<tr>
<td id="altimage">
<?php
$images = $_product->getMediaGalleryImages();
//$images = $this->getGalleryImages($_product);

//print "n" . ' here2 ' . get_class($images) . ' :: <br/>' . "n";
if ($images instanceof MagentoFrameworkDataCollection)
$i = 1;
foreach ($images as $image)
$item = $image->getData();
if ( !isset($item['media_type'])


?>
</td>
<td id="productdescriptiondt" class="hidden-xs" style="min-width:20em; vertical-align: middle">
<?php if ($_additional = $block->getAdditionalData()): ?>
<div class="additional-attributes-wrapper table-wrapper">
<table class="data table additional-attributes" id="product-attribute-specs-table">
<caption class="table-caption"><?php /* @escapeNotVerified */ echo __('More Information') ?></caption>
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th>
<td class="col data" data-th="<?php echo $block->escapeHtml(__($_data['label'])) ?>"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
</td>
</tr>
</table>
<div id="productdescriptionmobile" class="visible-xs">
<?php if ($_additional = $block->getAdditionalData()): ?>
<div class="additional-attributes-wrapper table-wrapper">
<table class="data table additional-attributes" id="product-attribute-specs-table">
<caption class="table-caption"><?php /* @escapeNotVerified */ echo __('More Information') ?></caption>
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th>
<td class="col data" data-th="<?php echo $block->escapeHtml(__($_data['label'])) ?>"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
</div>
<?php

// $_product->getAttributeSetId(); // 9 for Clocks

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$attributeSet = $objectManager->create('MagentoEavApiAttributeSetRepositoryInterface');
$attributeSetRepository = $attributeSet->get($_product->getAttributeSetId());
$attribute_set_name = $attributeSetRepository->getAttributeSetName();

if ( 'Clocks' == $attribute_set_name )

echo $block->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('product_view_clocks')->toHtml();

elseif ( 'Watches' == $attribute_set_name )

echo $block->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('product_view_watches')->toHtml();














share|improve this question







New contributor




user80030 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I just upgraded my site from Magento 2.1 to 2.3 and while most of my site still works, I have a particular code which has partially failed to work. The code is supposed to get the "details" attribute and display it on my product page, but somehow I am unable to get the data anymore. The alt image still works, so I have no idea what's up. Help is much appreciated!



<?php
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

/**
* Product additional attributes template
*
* @var $block MagentoCatalogBlockProductViewAttributes
*/
?>
<?php
$_helper = $this->helper('MagentoCatalogHelperOutput');
$_product = $block->getProduct()
?>
<table class="moreinfo">
<tr>
<td id="altimage">
<?php
$images = $_product->getMediaGalleryImages();
//$images = $this->getGalleryImages($_product);

//print "n" . ' here2 ' . get_class($images) . ' :: <br/>' . "n";
if ($images instanceof MagentoFrameworkDataCollection)
$i = 1;
foreach ($images as $image)
$item = $image->getData();
if ( !isset($item['media_type'])


?>
</td>
<td id="productdescriptiondt" class="hidden-xs" style="min-width:20em; vertical-align: middle">
<?php if ($_additional = $block->getAdditionalData()): ?>
<div class="additional-attributes-wrapper table-wrapper">
<table class="data table additional-attributes" id="product-attribute-specs-table">
<caption class="table-caption"><?php /* @escapeNotVerified */ echo __('More Information') ?></caption>
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th>
<td class="col data" data-th="<?php echo $block->escapeHtml(__($_data['label'])) ?>"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
</td>
</tr>
</table>
<div id="productdescriptionmobile" class="visible-xs">
<?php if ($_additional = $block->getAdditionalData()): ?>
<div class="additional-attributes-wrapper table-wrapper">
<table class="data table additional-attributes" id="product-attribute-specs-table">
<caption class="table-caption"><?php /* @escapeNotVerified */ echo __('More Information') ?></caption>
<tbody>
<?php foreach ($_additional as $_data): ?>
<tr>
<th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th>
<td class="col data" data-th="<?php echo $block->escapeHtml(__($_data['label'])) ?>"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
</div>
<?php

// $_product->getAttributeSetId(); // 9 for Clocks

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$attributeSet = $objectManager->create('MagentoEavApiAttributeSetRepositoryInterface');
$attributeSetRepository = $attributeSet->get($_product->getAttributeSetId());
$attribute_set_name = $attributeSetRepository->getAttributeSetName();

if ( 'Clocks' == $attribute_set_name )

echo $block->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('product_view_clocks')->toHtml();

elseif ( 'Watches' == $attribute_set_name )

echo $block->getLayout()->createBlock('MagentoCmsBlockBlock')->setBlockId('product_view_watches')->toHtml();











phtml magento2.3.1






share|improve this question







New contributor




user80030 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




user80030 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




user80030 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked May 1 at 19:07









user80030user80030

61




61




New contributor




user80030 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user80030 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user80030 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Can you please confirm block class is class="MagentoCatalogBlockProductViewAttributes" in catalog_product_view,xml.

    – Pritam Info 24
    2 days ago

















  • Can you please confirm block class is class="MagentoCatalogBlockProductViewAttributes" in catalog_product_view,xml.

    – Pritam Info 24
    2 days ago
















Can you please confirm block class is class="MagentoCatalogBlockProductViewAttributes" in catalog_product_view,xml.

– Pritam Info 24
2 days ago





Can you please confirm block class is class="MagentoCatalogBlockProductViewAttributes" in catalog_product_view,xml.

– Pritam Info 24
2 days ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






user80030 is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f273107%2fmodule-written-in-2-1-3-does-not-work-in-magento-2-3-1%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








user80030 is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















user80030 is a new contributor. Be nice, and check out our Code of Conduct.












user80030 is a new contributor. Be nice, and check out our Code of Conduct.











user80030 is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f273107%2fmodule-written-in-2-1-3-does-not-work-in-magento-2-3-1%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form