Skip to content

Instantly share code, notes, and snippets.

View mukundthanki's full-sized avatar
🎯
Focusing

Mukund Thanki mukundthanki

🎯
Focusing
View GitHub Profile
@mukundthanki
mukundthanki / advanced-data-profile.md
Last active December 28, 2015 23:28
Import/Export Data using Adavanced data profile in magento.

Export All Products

Output as csv

<action type="catalog/convert_adapter_product" method="load">
    <var name="store"><![CDATA[0]]></var>
</action>
<action type="catalog/convert_parser_product" method="unparse">
    <var name="store"><![CDATA[0]]></var>
 <var name="url_field"></var>
@mukundthanki
mukundthanki / delete_all_products.sql
Last active December 31, 2015 14:29
Delete all products using sql queries in magento
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;
TRUNCATE TABLE `catalog_product_entity_text`;
<?php
/**
* Debugging WordPress things.
*
* All of this belongs in your wp-config.php file.
*
* This will make sure that the code you release is, at a minimum,
* relatively free of PHP notices and warnings.
*
* - WP_DEBUG: This turns on debugging mode.

Magento Snippets

Simulate and test AJAX fail() actions in Mangeto

<?php
public function testAction()
{
        $this->getResponse()
            ->setHeader('HTTP/1.1', '403 Session Expired')
            ->setHeader('Login-Required', 'true')
<div id="wanelo-button">
<a class="wanelo-save-button"
href="<?php echo $home_url; ?>"
data-url="<?php echo $this->helper('core/url')->getCurrentUrl();?>"
data-title="<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>"
data-image="<?php echo $_product->getImageUrl(); ?>"
data-price="<?php echo number_format($_product->getFinalPrice(),2);?>"></a>
<script async="true" type="text/javascript" src="//cdn-saveit.wanelo.com/bookmarklet/3/save.js></script>
</div>
@mukundthanki
mukundthanki / jet_php_api_template.php
Last active December 26, 2015 12:03 — forked from dsugarman/jet_php_api_template.php
Jet PHP API Template
<?php
/** To use this just:
1. put in your api information at the top
2. store/retreive your API token in the specified locations
3.store your api calls
Ex: $jet->uploadFile($feed_type, $path);
$jet->processOrdersByStatus('ready');
$jet->apiPUT("/orders/".$JET_ORDER_ID."/acknowledge", $data);
**/
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
<?php
namespace App\Models\Concerns;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Uri;
trait HasPhoto