......
We have the same problem: Warning: Illegal string offset 'price_qty' in /opt/bitnami/apps/magento/htdocs/vendor/magento/module-catalog/Model/Product/Attribute/Backend/Tierprice.php on line 74
Please provide a solution and provide a workaround meanwhile.
@apurv-anand you can try this code:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_productTierPrice = $objectManager->create('Magento\Catalog\Api\ProductTierPriceManagementInterface');
$sku = "product";
$_productTierPrice->add($sku, 1, 100, 1);
OR:
$tierPrices = array(array(
'cust_group' => 1,
'price_qty' => 1,
'price' => 100,
'website_id' => 1
));
Notes:
$tierPrices = array(array(
......
));
Just check if you have entries for tier prices in catalog_product_entity_int table, as there is an eav attribute 'tier_price ' with attribute_id 92. For us deleting those entries resolved the issue.
This bug is crippling our website launch. We have tried everything and nothing is working.
Please fix this right away!
I'm having the same bug. My client imported about 2000 products with tier pricing. While the tier pricing is reflected accurately on the store front and in the cart, I can no longer save products.
Warning: Illegal string offset 'price_qty' in /var/www/vhosts/tlcelectronics.com/httpdocs/vendor/magento/module-catalog/Model/Product/Attribute/Backend/Tierprice.php on line 74
Solutions?
We have the same bug of @mzenner1. Imported products with tier pricing. Editing on backend, error.
Someone found a solution?
We had the same issue. Our client imported products through the backend, after which certain products would not save (Warning: Illegal string offset 'price_qty').
Solution for us was similar to what @lisaaugustine pointed out. A single attribute value was saved in one of the product entity tables. Steps to resolve:
Thank you @sduif, we resolved the problem in the same way.
@tranductrong92, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0, 2.2.0, 2.1.9
I'm also having this issue with 2.2.1 after importing tier pricing. I can no longer save the product: "Warning: Illegal string offset 'price_qty' in vendor/magento/module-catalog/Model/Product/Attribute/Backend/Tierprice.php on line 79"
Edit: Comment in https://github.com/magento/magento2/issues/8426#issuecomment-308691229 did work, not sure why they were there in the first place. Perhaps wrong import.
I have same issue with 2.1.2 and also follow last comment solution, But still getting error while save products.
Any Idea ?
I'm having this issue with Magento 2.1.11.
Same problem here with Magento 2.2.3
@magento-engcom-team A lot of people still have this bug, could you please re-investigate or tell, which information do you need to fix that?
I will look into it a little further. For whatever reason It seems like specific products are throwing errors and I haven’t quite found out why yet. My last upload I was able to add 75 products with no issue.
Sent from Mail for Windows 10
From: Max
Sent: Tuesday, April 3, 2018 8:56 AM
To: magento/magento2
Cc: johnmpasq; Comment
Subject: Re: [magento/magento2] Product Attribute Tier Price Error (#8426)
@magento-engcom-team A lot of people still have this bug, could you please re-investigate or tell, which information do you need to fix that?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
I encountered this issue too on Magento 2.2.2. If Adding tier pricing through the Magento interface, the issue doesn't seem to occur for us. Only on Import>Advanced Pricing.
This is the format I use to import. Is identical to the export, so can't see why it should break things.
sku,tier_price_website,tier_price_customer_group,tier_price_qty,tier_price,tier_price_value_type
SKU001,All Websites [GBP],Club,1,31.5,Fixed
Thanks to sduif for a workaround, worked great. Saved me a big job of deleting and re-importing the products (which was how I was overcoming the issue before)
I solved this problem deleting the tier prices directly from de database
you can find them on this table "CATALOG_PRODUCT_ENTITY_TIER_PRICE" just delete the row
I also have this issue on Magento 2.2.4. Fairly sure i've narrowed the problem down (at least for the one I was having). Due to no Tier Prices already existing on the given product, just trying to insert an array with the Tier Price values has the wrong formatting. I'm in the process currently of making sure the 'tier_price' attribute has the same format as a product already with preset Tier Prices.
Update:
By checking if there are no Tier Prices already set ($tierPrices == null) I can then add the following code:
$newTier = [[
//Tier price stuff
]];
The extra square bracket allows the formatting to be as it is on a product already created. I now have no problems and everything saves smoothly with no errors.
We had the same issue. Our client imported products through the backend, after which certain products would not save (Warning: Illegal string offset 'price_qty').
Solution for us was similar to what @lisaaugustine pointed out. A single attribute value was saved in one of the product entity tables. Steps to resolve:
- Backup your database
- Locate your "tier_price" attribute ID (Stores -> Attributes -> Product -> Search for "tier_price")
- Search catalog_product_entity_decimal, catalog_product_entity_int, catalog_product_entity_text, and catalog_product_entity_varchar for any records with the attribute_id of your tier_price attribute
- Delete these rows
- Clear cache and try to resave the affected products. The problem should be gone
Had this same issue on 2.2.5 Enterprise.
Thanks @sduif for your steps.
Most helpful comment
We had the same issue. Our client imported products through the backend, after which certain products would not save (Warning: Illegal string offset 'price_qty').
Solution for us was similar to what @lisaaugustine pointed out. A single attribute value was saved in one of the product entity tables. Steps to resolve: