Skip to content

Instantly share code, notes, and snippets.

View groggu's full-sized avatar
🏠
Working from home

Greg Croasdill groggu

🏠
Working from home
View GitHub Profile
@groggu
groggu / nsGetOrderRec.php
Created October 12, 2015 20:00
Get an order records from NetSuite
//assumes you are using the PHPToolKit and have already
require_once 'lib/NetSuite/NetSuiteService.php';
$service = new NetSuiteService();
//if you have the internal ID
$request = new GetRequest();
$request->baseRef = new RecordRef();
$request->baseRef->internalId = $nsOrderId;
$request->baseRef->type = "salesOrder";
@groggu
groggu / nsCountryCpdes.php
Created October 12, 2015 20:06
Convert standard ISO country codes to NetSuite's constants
/***
* Convert standard ISO country codes to NetSuite's world
*
* @param $isoCode
*
* @return string|bool
*/
public function convertCountryCode($isoCode)
{
@groggu
groggu / GCB.php
Last active December 19, 2019 16:12
For Fishpig WordPress Series - Custom Wordpress Short Code in Magento http://www.demacmedia.com/magento-commerce/custom-wordpress-shortcode-in-magento-with-fishpig/
<?php
/*
All extended shortcode class are extended from the helper class - Fishpig_Wordpress_Helper_Shortcode_Abstract
There are two abstract functions you must implement
public function getTag()
this functions defines [tagname].
@groggu
groggu / opcheckout.js
Last active April 18, 2016 16:49
GA Goal tracking for Magento One Page Checkout
/**
* Magento Enterprise Edition
*
* NOTICE OF LICENSE
*
* This source file is subject to the Magento Enterprise Edition End User License Agreement
* that is bundled with this package in the file LICENSE_EE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.magento.com/license/enterprise-edition
* If you did not receive a copy of the license and are unable to
@groggu
groggu / installPorto.php
Created September 25, 2019 19:31
For use with the Porto Themes - If the Magento Proto Theme admin theme import is not working correctly, this script allows you to install themes via the command line.
<?php
/*
* Developed by Greg Croasdill
* Developed for Porto v3.1.8
* Sept 25, 2019
*
* For use with the Porto Themes (ThemeForest - http://bit.ly/2lAwRR2 or https://www.portotheme.com)
*
* Please read the Proto documentation to understand how to setup your selected Porto Theme.
*
@groggu
groggu / ta_reports.sql
Last active July 8, 2022 16:23
Reports for ThirstyAffiliates WordPress plugin
#Click details for last 7 days
SELECT
wp_posts.post_title as 'Link Name' ,
wp_ta_link_clicks.date_clicked ,
ip.meta_value as 'User IP Address',
redirect.meta_value as 'Affiliate Link',
cloaked.meta_value as 'Cloaked Link'
FROM
wp_ta_link_clicks
JOIN wp_posts ON wp_ta_link_clicks.link_id = wp_posts.ID
@groggu
groggu / post_tags.sql
Created August 3, 2022 17:30
List tags associated with wordpress posts
SELECT
wp_posts.ID AS 'Post ID' ,
wp_posts.post_title AS 'Post Title' ,
group_concat(
DISTINCT wp_terms.`name` SEPARATOR ', '
) AS 'Tags'
FROM
wp_term_relationships
JOIN wp_posts ON wp_term_relationships.object_id = wp_posts.ID
JOIN wp_term_taxonomy ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id