Skip to content

Instantly share code, notes, and snippets.

@thuycom205
thuycom205 / ssh
Last active March 22, 2017 09:16
AbandonedCart
puttygen ~/Desktop/bemad_large.ppk -O private-openssh -o bemad.pem
ssh -i bemad.pem ubuntu@35.160.191.194
Laura@123
BemAAd2@15
URL: http://35.160.191.194/admin_1c8k69
@thuycom205
thuycom205 / vaultMoneris.java
Last active April 7, 2017 10:12
Moneris Vault
package Canada;
import JavaAPI.*;
public class TestCanadaEncResAddCC
{
public static void main(String args[])
{
String store_id = "moneris";
@thuycom205
thuycom205 / old.java
Created April 9, 2017 09:43
SoapApi
package org.rumman.magentoAPI;
import java.net.URL;
import org.rumman.services.Credentials;
import Magento.CatalogProductEntity;
import Magento.MagentoServiceLocator;
import Magento.StoreEntity;
model_fields = self.env['product.product'].fields_get()
for name, field in model_fields.iteritems():
@thuycom205
thuycom205 / ab.txt
Last active April 14, 2017 10:47
Connector
what
@thuycom205
thuycom205 / eway.js
Created May 17, 2017 14:48
ewayfixed
var EwayPayment = Class.create();
EwayPayment.isEwayRapidMethod = function(method) {
return ("ewayrapid_saved" === method || "ewayrapid_notsaved" === method || "ewayrapid_ewayone" === method);
};
EwayPayment.supportCardTypes = ['AE', 'VI', 'MC', 'JCB', 'DC', 'VE', 'ME'];
EwayPayment.prototype = {
paymentUrl : null,
ewayPayment: this,
initialize: function(form, encryptionKey) {
if (form) {
var placeSearch, autocomplete;
var componentForm = {
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'short_name',
country: 'long_name',
postal_code: 'short_name'
};
(function ($) {
///new
setInterval(function () {
$('.em-btn-addto a.button.btn-cart').each(function () {
var popup = $(this).data('popup');
if (popup != 'popup') {
$(this).on('click' ,function () {
$('body').addClass('open-popup');
});
<?php
public function order_item_meta($item_id, $values)
{
if (is_array($values)) {
if (isset($values['giftcard_option'])) {
if (!empty($values['giftcard_option'])) {
wc_add_order_item_meta($item_id, 'giftcard_option', $values['giftcard_option']);
$filtered_array = $values['giftcard_option'];
foreach ($filtered_array as $section) {
@thuycom205
thuycom205 / fb.php
Created July 28, 2017 16:59
fblogin
<?php
function item_check_fb_login_ajax() {
$user_id = get_current_user_id();
if (FGC_ActiveCampaign::check_active_subscription_by_user_id($user_id)) {
$cart_content = WC()->cart->cart_contents;
if (count($cart_content) > 0) {
foreach ($cart_content as $key => $value) {
if (!$value->is_type( 'subscription')) {
$return = array(