New answers tagged

0

Write a plugin on WysiwygConfigDataProcessor::process() method. The methods return wysiwyg parameters for admin product form. Create your own module Declare your plugin (app/code/Vendor/Module/etc/adminhtml/di.xml): <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=...


0

The code below should work. Also if it doesn't, you should see the catch message at least. try { $myProduct = $this->productRepository->getById(123, true, 0); $myProduct->setData('my_custom_attribute', 'test'); $this->productRepository->save($myProduct); } catch (Exception $e) { echo 'An error occured' }


0

There are many ways to save a product. List ranging from the "heaviest" to the lightest in terms of resources: Repository ResourceModel ResourceConnection, it is more difficult varies according to the type of product Via repository public $repo; __construct(\Magento\Catalog\Model\ProductRepository $repo) { $this->repo = $repo; } /** \Magento\...


0

On magento 2 there is the manufacturer attribute which however is a single string. What you need should be a multiselect with attached source model so as to select one or more matches. Here the link https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/ui-multiselect.html Cheers


0

Please try below code to save custom attribute value $product = $this->productRepository->getById($productId); $product->setCustomAttribute($attributeCode, $attributeValue); $this->productRepository->save($product); Hope this will help you.


1

I am assuming your attribute code is external_link Now copy: vendor/magento/module-catalog/view/frontend/templates/product/view/attributes.phtml to app/design/frontend/{Package}/{theme}/Magento_Catalog/templates/product/view/attributes.phtml Now we will add an if condition for external_link code and add a tag like: <?php if($_data['code']=='...


3

customize the code according to your requirement i have written it for one my work where i needed to export products from magento 1. i this code am just taking the sku, id , and price you can take other things as well if you want. <?php // output headers so that the file is downloaded rather than displayed header('Content-Type: text/csv; charset=utf-8'...


0

Create an Attribute in admin with text type say external_link Add phtml at: app/design/frontend/{Package}/{theme}/Magento_Catalog/layout/catalog_product_view.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/...


1

You need to create catalog_product_prices.xml into your extension on following path : vendor\Extension\view\base\layout\catalog_product_prices.xml Now copy the orginal file content catalog_product_prices.xml from following location : vendor\magento\module-catalog\view\base\layout\catalog_product_prices.xml Now replace following line <item name="...


0

Then you need to do the following things. first create one product attribute where you mention this link of third party. Now create one custom extension and create custom phtml file and call the file on product page on specific by using reference block. Now in that phtml file, fetch that product attribute value and show to customer.


1

You need to put some log at the function \Magento\Catalog\Model\Layer\Category\FilterableAttributeList::getList this is temporary and therefore can be in the vendor folder directly. The log we want to use is to know what query runs when the layer filters are pulled in the block \Magento\LayeredNavigation\Block\Navigation put the lines below just above the ...


1

I think you should fire the query directly on URL Rewrite table. $productUrl = Mage::getResourceModel('core/url_rewrite') ->getRequestPathByIdPath('product/' . $productId, $storeId); ou can try getting the product id as $product = $observer->getEvent()->getProduct(); $productId = $product->getId(); Hope it was helpful. Thanks


1

It does seem the one that is product attribute that is system does not want to be in the layer. I will look into it now. Having said that, one would think it might be worth creating a new product attribute identical to the no system one and then 'do assign your data to the new attribute and refresh index..' that should be a quick win, if you want to do this ...


0

you need to use plugin for the class Magento\Catalog\Pricing\Render\FinalPriceBox to change the pricehtml


0

post_max_size = for me, 2 Go (for Big projects) otherwise, post_max_size must be larger than upload_max_filesize max_input_vars = There is recommended or proper value, it depends on the size and complexity of your configuration. See Magento Help Center


1

Try it like this:- app/design/frontend/Vendor/theme/Magento_Catalog/templates/product/view/attr.phtml <?php echo $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getAttributeCode(), 'attribute_code'); ?> app/design/frontend/Vendor/theme/Magento_Catalog/layout/...


0

please assign value to that attribute in product edit, so that attribute display in product edit, if it not display than run the command php bin/magento indexer:reindex php bin/magento cache:flush


0

Try these commands. php bin/magento indexer:reindex rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/* php bin/magento setup:static-content:deploy -f; chmod -R 777 var/; chmod -R 777 pub/static/; chmod -R 777 generated/;


1

Your code is 99% right only change this sort($image_source_files); Replace with this line $image_source_files = sort($image_source_files); Click here to show reference Your code after change <div id="main_content_wrap" class="outer"> <section id="main_content" class="inner"> <ul id=&...


0

You want to update the attribute set for a product type: https://www.ubertheme.com/magento2/understanding-magento-2-product-attributes-attribute-sets/#:~:text=Some%20attributes%20are%20built%20into,2%20to%20customize%20your%20products.&text=Attribute%20set%20represents%20a%20list,to%20a%20specific%20product%20family. Check out this question/answer for ...


0

Did you try <?php foreach ($attribute->getOptions() as $option) { $src = $option->getLabel() ; $image_source_files[] = $src; $attributeValue = $option->getValue() ; // this } Edited, cant run this but hopefully it works <?php $om = \Magento\Framework\App\ObjectManager::getInstance(); /** @var \Magento\Catalog\Api\Data\...


1

Here is link for magento rest API : https://devdocs.magento.com/swagger/#/ . And you can add color options by this api /V1/products/attributes/{attributeCode}/options POST. Instance is Magento\Catalog\Model\Product\Attribute\OptionManagement-> add($attributeCode, $option);


0

I have made a module (minimalistic) that implements your requirement: the module is at https://bitbucket.org/magstaging/homematerial/src/master/ your code already shows attribute label and attribute value as it is. However, the module will enable you to use the code within your system either using normal layout syntax or directly from a cms block. This ...


1

The value will be save in this pattern: section_id/group_id/field_id Sot the identifier for any of the filed will follow this pattern For direct query in your database you can use: select * from core_config_data where path='*section_id/group_id/field_id' In your case query will be: select * from core_config_data where path='vsbridge_indexer_settings/...


0

Thank you so much for all your help and advice. I contacted our web developers and we have the reason and solution. There was a problem with the Flat Tables and indexing of it. From a certain amount on, they stopped indexing. But from Magento 2.3x on it, they are optional so we switched them off and on, and after a reindex, it worked.


0

If you just need an and operation you can call addFieldToFilter twice to get the result as follows; $collection = $this->_productCollection ->create() ->addFieldToSelect('*') ->addFieldToFilter('name', ['like' => '%'.$queryString.'%'])->addFieldToFilter('product_title', ['like' => '%'.$...


0

my be you not add a simple preselect value add simple preselect value http://prntscr.com/tf4vxt Ex. abcd than after create new child product


0

I think the webkul reference only links slave field to master field's initial value; it doesn't dynamically update slave field visibility/disability on master field toggling. For this, you must not import master field data source value but the :checked value of the uiElement linked to master field instead.


Top 50 recent answers are included