New answers tagged

0

check out this handy tool to handle exactly these cases where you don't know where to look. https://github.com/magespecialist/m2-MSP_DevTools Cheers


0

I found the answer, i looked at the admin menu -> stores -> attribute set, and the custom attribute was unsigned. so i passed it to signed.


0

Please share your code so we can see how you create the two custom attributes. are the two attributes different from each other? maybe one is text/select/multiselect etc. We can't help you without the related code or specific informations. docs: https://devdocs.magento.com/videos/fundamentals/add-new-product-attribute/ Cheers


0

In my opinion you should create a custom attribute for the product and use the cart rules that magento 2 manages basically Cheers


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

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

In this case, You can do some customisation based on that attribute. You have to set Special price also and need to override/customise getFinalPrice() function. In that function you can check that attribute's value is yes then workflow as it is. If that attribute's value us no then getFinalPrice() == getActualPrice() and. return finalPrice.


0

You can create cart price rule based on Attribute. You have create and assign attribute to product. Attribute Type Yes/No. Based on that attribute value you can create cart price rule and set condition.


1

In order to create a data range attribute, you have to create two attributes first. in the Setup schema file you have to create a date attribute like below. InstallData.php if (!$this->attributeInfo->getAttributeId(\Magento\Catalog\Model\Product::ENTITY, self::PRESALE_START)) { $eavSetup->addAttribute( \Magento\Catalog\Model\...


0

the manufacturer filter appended like this in the url will only make sense to Magento if: manufacturer is an product attribute on product page, attribute are not normally used by magento module. So, unless your site has some customisations that read the product attribute manufacturer, then this manufacurer variable will be not used now, in category page, ...


0

Easy Solution here -> Go to Store-> Attributes ->Product ->open your attribute and go to proprties. here just change attribute scope to "Global" and you will get your value in your code. echo $product->getYourAttributeCode(); If this will fix your issue please mark as a solution. Thank You


0

In DataProvider.php to change From public function getData() { if (isset($this->loadedData)) { return $this->loadedData; } // {Vendor}\{Module}\Model\GridFactory // Returns Customer Resource Model $items = $this->gridFactory->create()->getCollection(); $items->getSelect()->join('...


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

it will help you to show your attribute on frontend. helper('Magento\Catalog\Helper\Output'); $_product = $block->getProduct(); $data = explode(',',$_product->getData('attribute_name')); if(count($data) > 1) { $attr = $_product->getResource()->getAttribute('custom_mask'); $attrTestLabel = $attr->getStoreLabel(); echo $attrTestLabel; foreach(...


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\...


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 ...


0

Create Vendor\Extension\view\adminhtml\layout\catalog_product_edit.xml <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <script src="Vendor_Extension::js/...


1

Try this code $customer_id = 3; $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $customerRepository = $objectManager->create('Magento\Customer\Api\CustomerRepositoryInterface'); $customer = $customerRepository->getById($customer_id); // get Custome Attribute value $cust_att = $customer->getCustomAttribute("datagruppo&...


0

First load your product attribute from its attribute code /** \Magento\Eav\Model\Config $eavConfig */ /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $eavAttribute */ $productAttribute = $this->eavConfig->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attributeCode); Then, load all its options: if (is_object($productAttribute) &&...


Top 50 recent answers are included