Skip to content

Instantly share code, notes, and snippets.

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

Tuni-Soft unlocomqx

🏠
Working from home
  • Module Dev - Tuni-Soft
  • [object Object]
View GitHub Profile
$(function() {
$.subscribe(dpTopics.RESULT_CALCULATED, (_, data) => {
// This function is called after calculating the price & weight
// data.input_fields contains all the fields values: data.input_fields[field_name].value
console.log(data.input_fields['nombre_de_montant'].value);
});
});
<?php
// first read the tax rate of the current product
/** @var $module DynamicProduct */
$tax_rate = $module->calculator->getTax($id_product);
// then remove it from the calculation result
$result = $result / (1 + $tax_rate/100);
.dp-hide-qty .product-quantity-touchspin {
display: none;
}
// File path: [prestashop root folder]/controllers/admin/AdminTranslationsController.php
// Replace this line (number 1256)
$regex = '/->l\((\')'._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U';
// By this line
$regex = '/->l\(\s*(\')' . _PS_TRANS_PATTERN_ . '\'(\s*,\s*?\'(.+)\')?(\s*,\s*?(.+))?\s*\)/Ums';
.dsn-item-image .ui-resizable-s,
.dsn-item-image .ui-resizable-e {
display: none !important;
}
const LiveReloadPlugin = require("webpack-livereload-plugin");
const md5File = require("md5-file");
LiveReloadPlugin.prototype.done = function done(stats) {
this.fileHashes = this.fileHashes || {};
const fileHashes = {};
for (let file of Object.keys(stats.compilation.assets)) {
fileHashes[file] = md5File.sync(stats.compilation.assets[file].existsAt);
}
$(function() {
$('.dsn-product-variants').addClass('product-detail-primary')
});
.dsn-product-variants .custom-select {
background-color: #ececec;
color: #000 !important;
}
select.dp_dropdown {
height: auto !important;
}
@unlocomqx
unlocomqx / Distinct.js
Last active March 30, 2020 17:16
A way to get distinct values from a svelte subscription
import cloneDeep from "lodash.clonedeep";
import isEqual from "lodash.isequal";
export class Distinct {
constructor() {
this.lastValue = null;
}
subscribe(data) {