This file contains 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 | |
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag |
This file contains 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
body.on('click', '.js-add-to-cart', function(event) { | |
var sizeSelected = $('.size-selected').find(':selected'), | |
skuId = parseInt($('.size-selection').val()), | |
skuQty = parseInt($('.qty-selection').val()), | |
skuName = sizeSelected.text(), | |
skuPrice = sizeSelected.data('sku-price'), | |
skuCache = $('.size-selection').data('cache-version'), | |
requestUrl = '/checkout/cart/add?sku=' + skuId + '&qty=' + skuQty + '&price=' + skuPrice + '&seller=1&cv=' + skuCache + '&sc=1'; | |
event.preventDefault(); |
This file contains 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
https://instagram.com/oauth/authorize/?client_id=e4e2e067732640baa760eb82d0a624a8&redirect_uri=http://guilhermemarconi.me/instagram/&response_type=token |
This file contains 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
{ | |
"recommendations": [ | |
"thisismanta.stylus-supremacy" | |
] | |
} |
This file contains 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
$.ajax('/api/catalog_system/pub/products/search?fq=productId:' + skuJson.productId) | |
.done(function(product) { | |
product = product[0]; | |
if (!product['Desconto progressivo'][0]) return; | |
/** | |
* Pega a porcentagem de desconto, de acordo com a descrição da promoção | |
* Ex.: "<b>GANHE 10% DE DESCONTO</b> COLOCANDO <b>12 UNIDADES</b> OU MAIS NO CARRINHO." | |
*/ | |
var discountBase = +product['Desconto progressivo'][0].match(/\d+\%/g)[0].replace('%',''); | |
// Pega o preço do SKU |
This file contains 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
/api/checkout/pub/orders/?customerEmail=${email} |
This file contains 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
//marketingData Example | |
//vtexjs.checkout.orderForm.marketingData | |
import { getCookie } from 'path/to/cookies.js' | |
utms = { | |
utmCampaign: (getCookie('IPS') && ~getCookie('IPS').indexOf('Campanha') ? getCookie('IPS').split('Campanha=')[1].split('&')[0] : ""), | |
utmMedium: (getCookie('IPS') && ~getCookie('IPS').indexOf('Midia') ? getCookie('IPS').split('Midia=')[1].split('&')[0] : ""), | |
utmSource: (getCookie('IPS') && ~getCookie('IPS').indexOf('Parceiro') ? getCookie('IPS').split('Parceiro=')[1].split('&')[0] : ""), | |
utmiCampaign: (getCookie('ISICI') && ~getCookie('ISICI').indexOf('InternalCampaign') ? getCookie('ISICI').split('InternalCampaign=')[1].split('&')[0] : ""), | |
utmiPart: (getCookie('ISICI') && ~getCookie('ISICI').indexOf('InternalPart') ? getCookie('ISICI').split('InternalPart=')[1].split('&')[0] : "") |
This file contains 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
fetch(`/no-cache/postalcode/address/delete/${addressName}`, { | |
credentials: 'same-origin', | |
}) | |
.then(res => res.json()) | |
.then(addressData => { | |
// ... | |
}) |
This file contains 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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/home/marconi/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |
This file contains 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 gco | |
git checkout $argv | |
end | |
function gb | |
git branch $argv | |
end | |
function gcm | |
git checkout master | |
end | |
function gcd |