Categories
CMS Magento Mastering Development

magento 1.9, how correctly create mysql escap

I want to save a lot of data in a table with one request but this code don’t working for me Please,tell me how to implement the code correctly $insertInto = array(); foreach ($arrayDataFromCsv as $newCsvData){ $insertInto[] = array( ‘item_id’ => $newCsvData[0], ‘title’ => $newCsvData[1], ‘qty’ => $newCsvData[2], ‘cost’ => $newCsvData[3], ‘tracking_number’ => $newCsvData[4], ‘status’ […]

Categories
CMS Magento Mastering Development

How to set higher Tier Price then regular price in Magento 2

I am working in Magento 2. I want to set tier price higher than regular price. But it is not working as in price model it is returning minimum price from regular and tier. Example If One product has $100 regular price and $150 tier price then it should show $150 tier price. In short […]

Categories
CMS Magento Mastering Development

when iam paasing arugment to helper from controller iam getting error magento 2.3

Iam Getting the below error Recoverable Error: Object of class Magento\Framework\App\ObjectManager could not be converted to string in /var/www/html/development/amt/app/code/vendor/RequestForQuote/Controller/Index/Index.php on line 153 {“exception”:”[object] (Exception(code: 0): Recoverable Error: Object of class Magento\Framework\App\ObjectManager could not be converted to string in /var/www/html/development/amt/app/code/vendor/RequestForQuote/Controller/Index/Index.php on line 153 at /var/www/html/development/amt/vendor/magento/framework/App/ErrorHandler.php:61)”} [] My Controller : <?php namespace Sm\RequestForQuote\Controller\Index; use \Magento\Framework\App\Action\Context; use \Magento\Framework\View\Result\PageFactory; […]

Categories
CMS Magento Mastering Development

when iam paasing arugment to helper from controller iam getting error magento 2.3

Iam Getting the below error Recoverable Error: Object of class Magento\Framework\App\ObjectManager could not be converted to string in /var/www/html/development/amt/app/code/vendor/RequestForQuote/Controller/Index/Index.php on line 153 {“exception”:”[object] (Exception(code: 0): Recoverable Error: Object of class Magento\Framework\App\ObjectManager could not be converted to string in /var/www/html/development/amt/app/code/vendor/RequestForQuote/Controller/Index/Index.php on line 153 at /var/www/html/development/amt/vendor/magento/framework/App/ErrorHandler.php:61)”} [] My Controller : namespace Sm\RequestForQuote\Controller\Index; use \Magento\Framework\App\Action\Context; use \Magento\Framework\View\Result\PageFactory; use […]

Categories
CMS Magento Mastering Development

Product grid checkbox input at sales rule form Magento 2 not working

I’m using Magento 2.3.4 and want to add product grid with checkbox as an input for sales rule form (shopping cart price rule), i follow the instruction to add product grid input from here but when I print the $_POST value the input data does not exist. Here’s my code: app/code/Becom/Freegift/Block/Adminhtml/Products/Edit/Tab/Product.php namespace Becom\Freegift\Block\Adminhtml\Products\Edit\Tab; use Magento\Backend\Block\Widget\Grid; […]

Categories
CMS Magento Mastering Development

Product grid checkbox input at sales rule form Magento 2 not working

I’m using Magento 2.3.4 and want to add product grid with checkbox as an input for sales rule form (shopping cart price rule), i follow the instruction to add product grid input from here but when I print the $_POST value the input data does not exist. Here’s my code: app/code/Becom/Freegift/Block/Adminhtml/Products/Edit/Tab/Product.php namespace Becom\Freegift\Block\Adminhtml\Products\Edit\Tab; use Magento\Backend\Block\Widget\Grid; […]

Categories
Mastering Development

How to write a SQL Script to Insert/Update Data in table

In SQL Server I have a temporary table called – massupdate and a main table called retaildata The structure is as follows. Table massupdate: | retail_id | Qty| | 1 | 1 | | 2 | 2 | Table retaildata: | retail_id | Qty| | 1 | 1 | | 2 | 2 | retaildata […]

Categories
CMS Development Magento

Cataloginventory Stock Item Update fails on save

I’m trying to update Stock Qty for a Magento Product. I either create a new product or update an existing product with the same call. I do it like this: if ($product->getQty() !== ($productData[‘inventory’] ?? 0)) { $stockItem = $product->getStockItem(); $stockItem->assignProduct($product)->setData([ ‘qty’ => $productData[‘inventory’] ?? 0, ‘is_in_stock’ => 1, ‘use_config_manage_stock’ => 1, ‘manage_stock’ => 1, […]

Categories
Cryptocurrency Development Ethereum

How i can call one method inside another method result?

i want to call two methods first call one method then second method after first method success below is my code please check and let me know how i can achieve this this.state.token.methods.approve(this.state.neutralG.address, qty).send({ from: this.state.account}). then(‘receipt’, (receipt)=>{ this.state.neutralG.methods.createEscrow(intvalue, 3600, price, this.symbol, beneficiaryAddress, qty, this.tokenAddress).send({ from: this.state.account}). once(‘receipt’, (receipt)=>{ this.setState({loading: false}) }) }) this is […]

Categories
Cryptocurrency Development Ethereum

How i can call one method inside another method result?

i want to call two methods first call one method then second method after first method success below is my code please check and let me know how i can achieve this this.state.token.methods.approve(this.state.neutralG.address, qty).send({ from: this.state.account}). then(‘receipt’, (receipt)=>{*/ this.state.neutralG.methods.createEscrow(intvalue, 3600, price, this.symbol, beneficiaryAddress, qty, this.tokenAddress).send({ from: this.state.account}). once(‘receipt’, (receipt)=>{ this.setState({loading: false}) }) }) this is […]