Skip to content

Instantly share code, notes, and snippets.

View UbaldoRosas's full-sized avatar
🛍️
Focusing on Shopify Development

Balo UbaldoRosas

🛍️
Focusing on Shopify Development
View GitHub Profile
@UbaldoRosas
UbaldoRosas / description-splitter.js
Last active March 11, 2021 17:42
Shopify product description splitter
// Contenedor en el cual buscar
var parent = $('#data-sections');
var titles = parent.find('h1');
function cleanString(str) {
// Función para reemplazar los caracteres especiales, acentos, espacios
var str = str
.toLowerCase()
.replace('á', 'a')
.replace('é', 'e')
@UbaldoRosas
UbaldoRosas / webpack.config.js
Created March 22, 2021 19:29
Getmore Workflow: single entry configuration for CSS & JS
module.exports = {
mode: 'development',
entry: {
js: path.resolve('zrc/main.js'),
"css-base": path.resolve('zrc/styles/_bundles/base.css'),
},
stats: 'minimal',
watchOptions: {
ignored: /node_modules/,
},
@UbaldoRosas
UbaldoRosas / order-confirmation-line-items.liquid
Last active May 4, 2021 21:25
Shopify - Order Confirmation: add line items
{% for p in line.properties %}{% unless p.last == blank %} - {{ p.first }}: {{ p.last }}{% endunless %}<br>{% endfor %}
@UbaldoRosas
UbaldoRosas / my-snippets.json
Created September 12, 2021 23:32
My VSCode snippets for CSS and Liquid
{
"Responsive Font Post CSS": {
"scope": "css, scss, postcss",
"prefix" : ["responsive-font"],
"body": ["font-size: responsive ${1:min}px ${2:max}px;\nfont-range: 320px 1024px;"],
"description": "Responsive font Post CSS"
},
"Media Query Max Width": {
"scope": "css, scss, postcss",
"prefix" : ["media-max-width"],
@UbaldoRosas
UbaldoRosas / boost-pfs-instant-search.js
Created November 9, 2021 23:01
Add conditionals for Products, Collections or Pages at search suggestions
var instantSearchTemplate = InstantSearchResultBlock.prototype.getTemplate;
InstantSearchResultBlock.prototype.getTemplate = function(tempType) {
if (['products', 'collections'].indexOf(tempType) === -1) return instantSearchTemplate.call(this, tempType);
return '<li class="{{class.searchSuggestionGroup}} ' + tempType + '" data-group="{{type}}" aria-label="{{label}}">' +
'<ul class="default">' +
'<li class="{{class.searchSuggestionHeader}}-{{type}} {{class.searchSuggestionHeader}}" aria-label="{{label}}">{{label}}</li>' +
'{{resultItems}}' +
'</ul>' +