Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 36253

Denotes a question related to the Magento products.

1
vote
0answers
- should be uploaded in path like p/a/pathtofile manner? I was trying to resue downloadable widget from downloadable product but my files are not uploaded. Also I have seen this one and I was trying to use modifiers from Downloadable module, but it also doesn't work for me. …
asked Jan 5 '17 by Bartosz Kubicki
1
vote
You can try to use Magento/Store/Model/StoreManager. Inject it into a constructor via Magento/Store/Model/StoreManagerInterface, more or less like this: public function __construct( \Magento\Stor …
answered Oct 31 '16 by Bartosz Kubicki
1
vote
I had similar problem in frontend -try not to load whole product model ans save it.but instead look for method updateAttributes() in product's resource model - it can save only attributes you need for only one store …
answered Dec 28 '16 by Bartosz Kubicki
1
vote
If Magento is not trying to create a new product, check if your products already don't have the same url key (it must be unique). …
answered Jun 16 '16 by Bartosz Kubicki
0
votes
I had similar issue. A key is that you retrieve product from collection, so basically it doesn't has all data you need. Take a look at vendor/magento/module-catalog/Helper/Image.php:514 … message, but that's only side note. Why you are unable to get image? Because your product object from collection doesn't have image attribute. On your collection object try to call ->addAttributeToSelect('image') and all should work normally. …
answered Dec 2 '16 by Bartosz Kubicki
0
votes
0answers
Magento 2.1.1. Is there any way to set custom created_at attribute on newly created product? I used method $product->setCreatedAt($date) before saving it. Value is set on product object, but …
asked Jul 7 '17 by Bartosz Kubicki
3
votes
2answers
Modifying product page I have encountered some methods touching stock and product availibility: $_product->isSaleable()); $_product->isSalable()); $_product->isAvailable()); $_product->isInStock …
asked Feb 10 '17 by Bartosz Kubicki
1
vote
0answers
->getCacheKey([$editMode, $storeId]); if (!isset($this->instances[$sku][$cacheKey]) || $forceReload) { $product = $this->productFactory->create(); $productId = $this … ->resourceModel->getIdBySku($sku); if (!$productId) { throw new NoSuchEntityException(__('Requested product doesn\'t exist')); } if ($editMode …
asked Mar 8 '17 by Bartosz Kubicki
1
vote
Ids in different way for example $productIds = array(3344); Although I suppose, this one should work, if you have just one product to update: $id = 43453; $product = Mage::getModel('catalog/product … ')->load($id); $product->setUpdatedAt(Mage::getModel('core/date')->gmtDate()); $product->save(); If piece Mage::getModel('core/date')->gmtDate() returns correct date (can't check it now), Third method - I am not sure if collection has method save. …
answered Jun 15 '16 by Bartosz Kubicki
1
vote
/Bundle/_files/product.php There is a script adding bundle product with one option and one linked product. …
answered May 31 '16 by Bartosz Kubicki
4
votes
2answers
OK, I have some bundled product to create and I want to do it programatically. Problem is, I want to add (to MediaGallery) some videos, as it can be done in case of images. It can be done via … adminhtml product edit form and works like a charm. So far I have found module-product-video in vendor. I'm not sure if that's it. I think maybe I should use then VideoEntryFactory and bind it with …
asked May 30 '16 by Bartosz Kubicki
4
votes
1answer
Today I came accross the issue of updating product's attribute programatically in observer on each visit on product page. As it should be really fast in that case I was wondering what is the best way … to achieve that. First of all one can get product model, set value on object using setter and save it using productRepository. But it is not fast, and it is really buggy on frontend. Second …
asked Dec 20 '16 by Bartosz Kubicki
11
votes
I have used method updateAttributes of class \Magento\Catalog\Model\ResourceModel\Product\Action. Method can update multiple products and attribute values, but if you want to update just one product … with one attribute value you can do it like this: $this->action->updateAttributes([$product->getId()], ['attribute_code' => $newValue], $storeId); …
answered Feb 1 '17 by Bartosz Kubicki