Skip to content

Instantly share code, notes, and snippets.

View VIVEKLUCKY249's full-sized avatar

VS VIVEKLUCKY249

View GitHub Profile
@VIVEKLUCKY249
VIVEKLUCKY249 / Generate_Local_SSL_Certificate.md
Created November 12, 2017 20:23
Generate New CA Certificate for Local Webserver
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST') {
$fileExt = $_POST['typeoffile'];
$finalUrl = "https://".$_POST['MAGEID'].":".$_POST['Download_Access_Token']."@www.magentocommerce.com/products/downloads/info/filter/version/".$_POST['Magento_Version'];
// $response = get_web_page($finalUrl);
// echo "<pre>"; print_r($response); echo "</pre>";
// function get_web_page($url) {
// $options = array(
// CURLOPT_RETURNTRANSFER => true, // return web page
Steps to remove/eradicate project concerns:
1. Collect all/basic the details of the project in concern.
2. Find out in which task client’s concerns/dissatisfactions are there.
3. Gather and analyse the client’s dissatisfaction/concern and deduce his requirement(output we have to achieve and show to client).
4. Discuss with your subordinate who is currently working on the project about how to achieve that requirement/output.
5. If the subordinate currently working on given project is a new assignee, then contact the subordinate who has worked in the given project for long time or from the initiation phase or the one who has enough knowledge/experience in the project platform/language. Let’s call this person a senior/mentor subordinate.
6. Instruct/suggest the current subordinate to take advice/guidance from the mentor subordinate and get the given issue/concern resolved.
7. If the current subordinate is still unable to resolve the issue/concern, then assign the issue/concern to mentor person, not before relie
<?php
$magePath = 'app/Mage.php';
require_once $magePath;
Varien_Profiler::enable();
Mage::setIsDeveloperMode(true);
ini_set('display_errors', 1);
error_reporting(E_ALL);
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
@VIVEKLUCKY249
VIVEKLUCKY249 / Abstract.php
Created January 30, 2017 21:50
Overrided Abstract.php for getting product's data by Sku
<?php
### Put this file inside [magentoroot_path]\app\code\local\Mage\Catalog\Model directory
/**
* 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:
public function mycoolAction()
{
/* ... Some code ...*/
$update = $this->getLayout()->getUpdate();
/* ... Some code ...*/
$this->addActionLayoutHandles();
/* ... Some code ...*/
$this->loadLayoutUpdates();
/* ... Some code ...*/
/* My stuff, add pure XML like you do from XML layout files <img src="http://inchoo.net/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley"> */

Magento Snippets

Set all categories to is_anchor 1

Find attribute_id

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

Update all of them with anchor_id from above (usually is ID 51)

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51
<?php
namespace Pokus;
class Exception extends \Exception
{
}
function tttt($string)
{
try {
@VIVEKLUCKY249
VIVEKLUCKY249 / exception.php
Created January 28, 2017 06:41
Magento How To Show Full Error/Exception Message Instead of Truncated One
<?php
function getExceptionTraceAsString($exception) {
$rtn = "";
$count = 0;
foreach ($exception->getTrace() as $frame) {
$args = "";
if (isset($frame['args'])) {
$args = array();
foreach ($frame['args'] as $arg) {
if (is_string($arg)) {
@VIVEKLUCKY249
VIVEKLUCKY249 / magento-code-snippets.md
Created January 28, 2017 06:40 — forked from arosenhagen/magento-code-snippets.md
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name