Skip to content

Magento 2 – how to create order programmatically with custom price AND tax amount for each line item (not percent)

I created a module that creates an order programmatically and I can also set the custom price. This is part of my code: foreach($orderData[‘products’] as $product) { try { $quoteProduct = $this->productRepository->get($product[‘sku’]); $this->logger->info(sprintf(“Adding product to quote, id: %d, sku: %s,… Read More »Magento 2 – how to create order programmatically with custom price AND tax amount for each line item (not percent)

Indexer does not exist

We are facing this error during setup upgrade command while installing this extension. Unable to apply data patch AmastyMostviewedSetupPatchDataCreateGroupExamples for module Amasty_Mostviewed. Original exception message: amasty_mostviewed_rule_product indexer does not exist. Magento 2.4.7-p3

Hide a Ui Component Field based on condition on product edit

I have created custom field in Magento 2.4.1 product edit page, product_form.xml <field name=”type” formElement=”select”> <argument name=”data” xsi:type=”array”> <item name=”options” xsi:type=”object”>CeymoxDigitalCardModelDigitalCardOptions</item> <item name=”config” xsi:type=”array”> <item name=”source” xsi:type=”string”>block</item> </item> </argument> <settings> <dataType>select</dataType> <label translate=”true”>Digital Card Type</label> <dataScope>type</dataScope> </settings> </field> <file name=”csv_uploader”… Read More »Hide a Ui Component Field based on condition on product edit

Magento 2 – in a ui-select dropdown, how can I stop some nodes from being selected or clicked?

I added a custom field to product-form.xml in a custom module: <?xml version=”1.0″ encoding=”UTF-8″?> <form xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:module:Magento_Ui:etc/ui_configuration.xsd”> <fieldset name=”product-details”> <field name=”customfield”> <argument name=”data” xsi:type=”array”> <item name=”options” xsi:type=”object”>VendorModuleUiComponentProductFormCategoriesOptions</item> <item name=”config” xsi:type=”array”> <item name=”label” xsi:type=”string” translate=”true”>Fiel Label</item> <item name=”componentType” xsi:type=”string”>field</item> <item name=”formElement”… Read More »Magento 2 – in a ui-select dropdown, how can I stop some nodes from being selected or clicked?

Magento 2.4.5: Why is my custom tab not showing in the backend without fields?

I am using Magento 2.4.5 and I am trying to create a store configuration. The following code works fine, and the tab appears in the backend: <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:module:Magento_Config:etc/system_file.xsd”> <system> <tab id=”mageplaza” translate=”label” sortOrder=”200″> <label>Mageplaza</label> </tab> <section id=”helloworld”… Read More »Magento 2.4.5: Why is my custom tab not showing in the backend without fields?