Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tuni-Soft unlocomqx

🏠
Working from home
View GitHub Profile
View category-cache-warming.txt
*DEBUG* v1.7.6.9 2022/10/28 - 22:58:37: https://dhm-online.com:443/83-bowden-drive?as_currency=1&as_group=1&as_lang=1&gdpr_opened=0&use_web=0
*DEBUG* v1.7.6.9 2022/10/28 - 22:58:38: https://dhm-online.com:443/83-bowden-drive?as_currency=1&as_group=1&as_lang=1&gdpr_opened=1&use_web=0
*DEBUG* v1.7.6.9 2022/10/28 - 22:58:38: https://dhm-online.com:443/83-bowden-drive?as_currency=1&as_group=1&as_lang=1&gdpr_opened=0&use_web=1
*DEBUG* v1.7.6.9 2022/10/28 - 22:58:38: https://dhm-online.com:443/83-bowden-drive?as_currency=1&as_group=1&as_lang=1&gdpr_opened=1&use_web=1
*DEBUG* v1.7.6.9 2022/10/28 - 22:58:39: https://dhm-online.com:443/fr/83-bowden-drive?as_currency=1&as_group=1&as_lang=2&gdpr_opened=0&use_web=0
*DEBUG* v1.7.6.9 2022/10/28 - 22:58:39: https://dhm-online.com:443/fr/83-bowden-drive?as_currency=1&as_group=1&as_lang=2&gdpr_opened=1&use_web=0
*DEBUG* v1.7.6.9 2022/10/28 - 22:58:40: https://dhm-online.com:443/fr/83-bowden-drive?as_currency=1&as_group=1&as_lang=2&gdpr_opened=0&use_web=1
*DEBUG* v1.7
View custom.js
$(function(){
if (prestashop.page.body_classes['product-id-category-138']) {
var btn = $('.dsn-customize').get(0)
if (btn) {
btn.childNodes[2].textContent = 'Je tune mon Pyjama';
}
}
})
View custom_script_example.php
<?php
// Pseudo code
// Attibute quantity coefficient map
// it only contains attrA and attrB because other attributes are more dynamic
$attr_qty_map = array(
'attrA' => 1,
'attrB' => 2,
'attrE' => 0,
View query.sql
SELECT `price`
FROM `shoppre__attribute_tier_pricing`
WHERE `id_attribute` = 28
AND `id_attribute_group` = 5
AND `min_qty` <= 1
AND `max_qty` >= 1
AND `id_customer` IN (0, 0)
ORDER BY id_customer DESC
LIMIT 1
View var_dump.php
<?php
if (isset($_COOKIE['XDEBUG_SESSION'])) {
echo '<pre>';
var_dump($literal_expression);
echo '</pre>';
exit();
}
View fields.php
<?php
$personnalisations = DynamicInput::getInputsByIdCart($this->order->id_cart);
$dims = array();
foreach($personnalisations as $dynamic_input) {
$values = array();
$fields = $dynamic_input->getInputFields(Context::getContext()->language->id);
foreach ($fields as $input_field) {
$values[$input_field->name] = $input_field->value;
}
View dynamic.css
.dp_group_options .content {
display: flex;
gap: 1em;
}
View phpstorm.md
  • auto import
  • extract variable
  • complete statement
  • cyclic search
  • postfix completion
View move-btn.js
$(moveCustomizeBtn);
prestashop.on('updatedProduct', moveCustomizeBtn);
function moveCustomizeBtn() {
$(".product-quantity").find(".dsn-customize").remove()
$(".dsn-customize").appendTo(".product-quantity").css("margin-top", 0).addClass("col")
}
View productX.php
<?php
/** @var DynamicProduct $module */
$module = Module::getInstanceByName('dynamicproduct');
$preis_pro_meter_tax_incl = $module->calculator->applyTax($preis_pro_meter, $id_product);