I am trying to get the related products from a specific product using the function getRelatedProducts. $relatedProductsArray = $productModel->getRelatedProducts(); if($relatedProductsArray && count($relatedProductsArray) > 0){ foreach($relatedProductsArray as $_relatedProduct){ ... } } It works when the related products are assigned directly to the product in the admin product details. However, when the […]
Magento
I tried defining a plugin, as per Magento 2: Change hompage on login, but it doesn’t seem to work for me. I could override the CMS default controller, but that seems overkill.
I’m querying the graphql endpoint of a magento test installation, and am constructing and sending an oauth 1.0 authorization header via an integration setup. When I query the products via a simple graphql query like so: query Products { products( filter: { price: { from: "0" } } pageSize: 20 […]
I am trying to include a product image that has a specific custom role (in the example below its hover_img) The file I am doing this on is: vendor/magento/module-page-builder/view/frontend/templates/catalog/product/widget/content/carousel.phtml I am trying to display it by doing this: <?php $customImg = $_item->getResource()->getAttribute('hover_img')->getFrontend()->getValue($_item); ?> <?= $customImg ?> But nothing is coming […]
I need to add a column containing a button to modify the product or add another button as a remove button in the actions column. the modify button action: open the product’s modification page.
Upon magento I am placing some values into the mariadb database via reading the csv: use PcmagasEmailsModelEmailFactory; use PcmagasEmailsModelEmail; use MagentoFrameworkFileCsv ; class MyController extends MagentoBackendAppAction { // This is populated via constructor private Csv $csv; private EmailFactory $factory; public function __construct( MagentoBackendAppActionContext $context, EmailFactory $factory, Csv $csv ) { […]
When a user visits my Magento 2 site for the first time, I want to display a multi-option cookie banner where I have a list of all non-essential cookies split into groups, allowing them to allow or deny various groups of cookies. I’d be interested to know how I can […]
I created a CMS page named Cookie but when I save it with the key URL “cookie” it cannot save and shows an error
Creating orders via REST no problem — similar to https://developer.adobe.com/commerce/webapi/rest/tutorials/orders/order-create-order/ Need to modify the shipping total either before (quote) or after (salesorder) and recalculate order totals — also via REST API. So far the best I can find is to manually recalculate everything and update the salesorder via POST to […]