This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getBrandName() { | |
var location = window.location.href, | |
taskNumber = location.substr(location.lastIndexOf('/')+1) | |
taskName = document.getElementById("summary-val").innerText.toLowerCase().replace(/\s+\|\s+/g, '|').replace(/[^a-z0-9]/g, '-').replace(/:/g, '').replace(/\|/g, '').replace(/-+/g, '-') | |
; | |
console.log(taskNumber +'-'+ taskName); | |
} | |
getBrandName(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
private function getBrowerName($user_agent) | |
{ | |
if (strpos($user_agent, 'Opera') || strpos($user_agent, 'OPR/')) return 'Opera'; | |
elseif (strpos($user_agent, 'Edge')) return 'Edge'; | |
elseif (strpos($user_agent, 'Chrome')) return 'Chrome'; | |
elseif (strpos($user_agent, 'Safari')) return 'Safari'; | |
elseif (strpos($user_agent, 'Firefox')) return 'Firefox'; | |
elseif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) return 'Internet Explorer'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo 'XXXX' | sudo -S su - | |
sudo su born <<'EOF' | |
cd /var/www/XXX | |
git pull origin master | |
EOF | |
~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DESCRIBE `enterprise_url_rewrite_redirect`; | |
INSERT INTO `enterprise_url_rewrite_redirect` (`identifier`, `target_path`, `options`, `description`, `category_id`, `store_id`) VALUES ('browse/by-packaging.html', 'browse/package', NULL, NULL, '28', '3'); | |
INSERT IGNORE INTO `enterprise_url_rewrite_redirect_cl` (`redirect_id`) VALUES (NEW.`redirect_id`); | |
SELECT `enterprise_mview_metadata`.* FROM `enterprise_mview_metadata` WHERE (`enterprise_mview_metadata`.`table_name`='enterprise_url_rewrite_redirect'); | |
START TRANSACTION; | |
DELETE `ur` FROM `enterprise_url_rewrite` AS `ur` | |
INNER JOIN `enterprise_url_rewrite_redirect_rewrite` AS `r` ON r.url_rewrite_id = ur.url_rewrite_id WHERE (ur.is_system = 0) AND (ur.entity_type = 1) AND (r.redirect_id = 12); | |
INSERT INTO `enterprise_url_rewrite` (`request_path`, `target_path`, `guid`, `is_system`, `identifier`, `value_id`, `store_id`, `entity_type`) SELECT CONCAT(r.identifier, CASE WHEN ur.inc IS NULL OR `m`.`value` = 1 THEN '' ELSE CONCAT('-', ur.inc) END) AS `request_pat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery.each(jQuery("#general_country_allow option"), function(){ | |
var $this = jQuery(this), val = $this.val(); | |
var arr = ["GB", "FR", "IT", "DE", "NL", "ES", "SE", "DK", "BE", "AT", "IE", "PT", "PL"]; | |
if(jQuery.inArray(val, arr) !== -1) { | |
$this.attr("selected", "selected"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class convertCsvToXml { | |
protected $arrCol = ["a", "b", "c"]; | |
protected $arrXPath = [ | |
0 => "product-families/product-family[name='{{f-name}}']/product-models", | |
1 => "product-families/product-family[name='{{f-name}}']/product-models/product-model[name='{{m-name}}']/accessory-types", | |
2 => "product-families/product-family[name='{{f-name}}']/product-models/product-model[name='{{m-name}}']/accessory-types/accessory-type[name='{{a-name}}' or sku='{{sku}}']", | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Features attributes helper | |
* | |
* @package timezone | |
* @author [email protected] | |
*/ | |
class BC_Future_Model_Date extends Mage_Core_Model_Date | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><body>You will be redirected to the PayPal website in a few seconds.<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" id="paypal_standard_checkout" name="paypal_standard_checkout" method="POST"><div><input name="form_key" type="hidden" value="m4Ux3YIWUZc3biqa" /></div><input id="business" name="business" value="[email protected]" type="hidden"/> | |
<input id="invoice" name="invoice" value="145000024" type="hidden"/> | |
<input id="currency_code" name="currency_code" value="USD" type="hidden"/> | |
<input id="paymentaction" name="paymentaction" value="sale" type="hidden"/> | |
<input id="return" name="return" value="http://rsmagento_1_14_01.app/paypal/standard/success/" type="hidden"/> | |
<input id="cancel_return" name="cancel_return" value="http://rsmagento_1_14_01.app/paypal/standard/cancel/" type="hidden"/> | |
<input id="notify_url" name="notify_url" value="http://rsmagento_1_14_01.app/paypal/ipn/" type="hidden"/> | |
<input id="bn" name="bn" value="Magento_Cart_Enterprise" type="hidden"/> | |
<inp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Go to Zend_Mail_Transport_Sendmail::_sendMail | |
2. input: | |
Mage::log($this->recipients, Zend_Log::INFO, "email.log"); | |
$this->recipients = preg_replace("/<([^>]*)>/", "<[email protected]>", $this->recipients ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$checkProductHaveOption = function() { | |
$productIds = Mage::getModel('catalog/product')->getCollection()->getAllIds(); | |
$productModel = Mage::getModel('catalog/product'); | |
$arrProductIdHaveOption = array(); | |
foreach ($productIds as $key =>$productId ) { | |
$productObj = $productModel->load($productId); | |
if($productObj->getHasOptions()) { |