Skip to content

Instantly share code, notes, and snippets.

git fetch upstream pull/PR_NUMBER/head:pr
<?php
namespace Fietsuniek\BaseConfig\Override\Cms\Model\Wysiwyg\Images;
use Magento\Cms\Model\Wysiwyg\Images\Storage as WysiwygImagesStorage;
/**
* Override thumbs directory name .thumbs folder not accessible in youwe hosting environment
*
* @SuppressWarnings(PHPMD.LongVariable)
* @SuppressWarnings(PHPMD.TooManyFields)
<?php
$begin = '75B4CA';
$end = '98F29F';
print_r(getRangeColors($begin, $end, 96));
function getRangeColors($begin, $end, $theNumSteps){
@meminuygur
meminuygur / addImage.php
Created August 14, 2017 20:21
Product Add Image Programmatically
<?php
require_once('../app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$product_ids = Mage::getModel('catalog/product')->getCollection()->getAllIds();
$c=0;
foreach( $product_ids as $id ) {
@meminuygur
meminuygur / ProductController.php
Created May 13, 2017 14:18
magento disabled deleteaction
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@meminuygur
meminuygur / Total.php
Created May 12, 2017 15:21
MSP_CashonDelivery_Model_Order_Total collects bug
<?php
/**
* IDEALIAGroup srl
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@meminuygur
meminuygur / rıun-delete.php
Created April 27, 2017 04:55
custom attribute for category
<?php
require_once 'app/Mage.php';
Mage::app()->getCache()->getBackend()->clean('old');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute = array(
'type' => 'int',
'label'=> 'Show Breadcrumb Image',
'input' => 'select',
'source' => 'eav/entity_attribute_source_boolean',
@meminuygur
meminuygur / addImages.php
Created February 8, 2017 15:18
Magento Add Product Images From Remote Url Programmatically
<?php
$product_id = 12; // Product ID
$product = Mage::getModel('catalog/product')->load($product_id);
$remoteImages = [
'http://www.example.com/dummyImage.jpg',
'http://www.example.com/dummyImage1.jpg',
'http://www.example.com/dummyImage2.jpg'
];
@meminuygur
meminuygur / reviewsForCategory.php
Created February 6, 2017 12:12
Magento1 Reviews List for a Category
<?php
$_category = // INITIALIZED CATEGORY etc Mage::registry('current_category') or Mage::getModel('catalog/category)->load(##CATID##);
$productCollection = Mage::getResourceModel('catalog/product_collection')
->addCategoryFilter($_category)
->getAllIds();
$reviewcollection = Mage::getModel('review/review')->getCollection()
->addStoreFilter(Mage::app()->getStore()->getId())
@meminuygur
meminuygur / acayipCarpim.php
Created November 11, 2016 10:00
acayip bir çarpım isteğiydi
<?php
$a = array(
0 => 1,
1 => 9,
2 => 2,
3 => 7);
function solution($a){
$b = array();