how to print array to csv in standalone script

hi am trying to put my array data to csv in magento 1.9 where i fetching all the order details using standalone script my php script <?php require_once ‘app/Mage.php’; Mage::app(); Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID); $orderCollection = Mage::getModel(‘sales/order’)->getCollection(); foreach ($orderCollection as $order) { $orders[‘orders’][] = array( ‘id’ => $order->getIncrementId(), ‘store’ => ‘magento’, ‘status’ => $order->getStatus(), ‘name’ => $order->getCustomerName(), ’email’…

How to show tier price in Magento 2 catalog listing page

Tier price is working fine on the product page, but when we try to show on the listing page then it’s not working. <?php /* @escapeNotVerified */ echo ($block->getShowDetailedPrice() !== false) ? __( ‘Buy %1 for %2 each and <strong class=”benefit”>save<span class=”percent tier-%3″>&nbsp;%4</span>%</strong>’, $price[‘price_qty’], $priceAmountBlock, $index, $tierPriceModel->getSavePercent($price[‘price’]) ) : __(‘Buy %1 for %2 each’, $price[‘price_qty’],…

Extract array “qty” string from the array in Magento 2

Have a code that gets quantity from Magento 2 product class ClassName { private $getSalableQuantityDataBySku; public function __construct( GetSalableQuantityDataBySku $getSalableQuantityDataBySku ) { $this->getSalableQuantityDataBySku = $getSalableQuantityDataBySku; } public function execute(\Magento\Framework\Event\Observer $observer) { $sku = “testsimpleproduct1”; $salable = $this->getSalableQuantityDataBySku->execute($sku); echo json_encode($salable); } } it returns [{“stock_name”:”Default Stock”,”qty”:4,”manage_stock”:true}] How to extract array value “qty” from this and pass…

Pass function to array in Magento 2.3

I have this code to get the item quantity from Magento 2.3 product namespace Hello\SourceItemData\Model; use Exception; use Psr\Log\LoggerInterface; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\InventoryApi\Api\Data\SourceItemInterface; use Magento\InventoryApi\Api\SourceItemRepositoryInterface; class SourceItem { /** * @var SearchCriteriaBuilder */ private $searchCriteriaBuilder; /** * @var SourceItemRepositoryInterface */ private $sourceItemRepository; /** * @var LoggerInterface */ private $logger; public function __construct( SearchCriteriaBuilder $searchCriteriaBuilder, SourceItemRepositoryInterface…

How to implement rich results in magento 2?

Basically I am trying to add structured data such as AggregateRating for products with reviews, Offer – price and priceCurrency, Image(s), SKU, Product name, as JSON-LD code in all products page in magento 2 which would be added as markup to produce google rich search results so I have been referring to https://www.williamscommerce.com/add-rich-snippets-magento-products-using-schema-org-tags/ and https://feedarmy.com/kb/magento-microdata-for-google-shopping/…

Elasticsearch 6 unknown field [size], parser not found. How do i remove ‘size’ form the aggregate?

Im trying to get ES6 working after upgrading my site to 2.3.3. Whenever i search im getting [2020-01-17 19:26:10] report.CRITICAL: {“error”:{“root_cause”:[{“type”:”x_content_parse_exception”,”reason”:”[1:664] [extended_stats] unknown field [size], parser not found”}],”type”:”x_content_parse_exception”,”reason”:”[1:664] [extended_stats] unknown field [size], parser not found”},”status”:400} {“exception”:”[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\”error\”:{\”root_cause\”:[{\”type\”:\”x_content_parse_exception\”,\”reason\”:\”[1:664] [extended_stats] unknown field [size], parser not found\”}],\”type\”:\”x_content_parse_exception\”,\”reason\”:\”[1:664] [extended_stats] unknown field [size], parser not found\”},\”status\”:400} at /vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:636)”}…