Skip to content

Instantly share code, notes, and snippets.

gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
gsed -i '/^INSERT INTO `report_viewed_product_index.*/d' ./db.sql
<?php
/* Magento 2.4.3
* "Consumer with the same name is running"
* If this message Displays after all processes have been killed...
* This script unlock the consumer to allow run when there was an issue or a process was killed.
*/
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
@petarBozovic
petarBozovic / resaveProducts.php
Created January 14, 2019 15:57
Resave All Products (Magento1.9.x)
<?php
ini_set('memory_limit', '8192M');
require 'app/Mage.php';
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$products = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('*');
//->addAttributeToFilter('sku','testskuhere');
foreach ($products as $product) {
@petarBozovic
petarBozovic / removeFromCart.php
Last active January 14, 2019 15:58
Remove Product from Cart (Magento 1.9)
<?php
public function removeFromCart($productId){
$cart = Mage::helper('checkout/cart');
$items = $cart->getCart()->getItems();
foreach ($items as $item)
{
if ($item->getProductId() == $productId) {
$itemId = $item->getItemId();
$cart->getCart()->removeItem($itemId);
@petarBozovic
petarBozovic / storeList.php
Created December 22, 2017 20:25
Get all stores in a Magento 1
<?php
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
//Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$allStores = Mage::app()->getStores();
foreach ($allStores as $_eachStoreId => $val)
Verifying that +bozovic is my blockchain ID. https://onename.com/bozovic
Verifying that +petarbozovic is my blockchain ID. https://onename.com/petarbozovic
### Keybase proof
I hereby claim:
* I am petarBozovic on github.
* I am ipetey (https://keybase.io/ipetey) on keybase.
* I have a public key whose fingerprint is BB5C 6F5A 5374 EB2F BB0A 7973 8CE5 100C 482C BD7B
To claim this, I am signing this object: