snipt

Ctrl+h for KB shortcuts

PHP

Customer logged in?

<?php if ($this->helper('customer')->isLoggedIn() ) { ?>
https://snipt.net/embed/ab11d0f9c85ff095e732c0d5c08544d4/
/raw/ab11d0f9c85ff095e732c0d5c08544d4/
ab11d0f9c85ff095e732c0d5c08544d4
php
PHP
1
2019-08-23T08:50:15
True
False
False
/api/public/snipt/17747/
customer-logged-in
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> <span class="k">if</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-&gt;</span><span class="na">helper</span><span class="p">(</span><span class="s1">&#39;customer&#39;</span><span class="p">)</span><span class="o">-&gt;</span><span class="na">isLoggedIn</span><span class="p">()</span> <span class="p">)</span> <span class="p">{</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
magento

Text only

Get Basic Product Info From Magento DB

1
2
3
4
5
6
7
SELECT e.entity_id AS product_id, var.value AS product_name
FROM catalog_product_entity e, eav_attribute eav, catalog_product_entity_varchar var
WHERE 
   e.entity_type_id = eav.entity_type_id 
   AND eav.attribute_code = 'name' 
   AND eav.attribute_id = var.attribute_id
   AND var.entity_id = e.entity_id
https://snipt.net/embed/af58e82d413d6e3d0792d327c49dcf63/
/raw/af58e82d413d6e3d0792d327c49dcf63/
af58e82d413d6e3d0792d327c49dcf63
text
Text only
8
2019-08-23T05:03:22
True
False
False
/api/public/snipt/17576/
get-basic-product-info-from-magento-db
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>SELECT e.entity_id AS product_id, var.value AS product_name </span><span id="L-2"><a name="L-2"></a>FROM catalog_product_entity e, eav_attribute eav, catalog_product_entity_varchar var </span><span id="L-3"><a name="L-3"></a>WHERE </span><span id="L-4"><a name="L-4"></a> e.entity_type_id = eav.entity_type_id </span><span id="L-5"><a name="L-5"></a> AND eav.attribute_code = &#39;name&#39; </span><span id="L-6"><a name="L-6"></a> AND eav.attribute_id = var.attribute_id </span><span id="L-7"><a name="L-7"></a> AND var.entity_id = e.entity_id </span></pre></div> </td></tr></table>
magento, mysql, sql

Text only

Magento USPS gateway URL

USPS live gateway URL:
http://production.shippingapis.com/ShippingAPI.dll
https://snipt.net/embed/b1e0e2fd077012419a94f575929555f4/
/raw/b1e0e2fd077012419a94f575929555f4/
b1e0e2fd077012419a94f575929555f4
text
Text only
2
2019-07-16T10:35:57
True
False
False
/api/public/snipt/17308/
magento-usps-gateway-url
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>USPS live gateway URL: </span><span id="L-2"><a name="L-2"></a>http://production.shippingapis.com/ShippingAPI.dll </span></pre></div> </td></tr></table>
magento