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
{** If product has a required customization field **}
{if $product.customizable == 2}
show link
{else}
show cart btn
{/if}
@unlocomqx
unlocomqx / cypress.config.ts
Last active November 29, 2023 17:23
It's something like this
import { defineConfig } from 'cypress';
import { seed } from './cypress/plugins/seed';
import vitePreprocessor from 'cypress-vite';
export default defineConfig({
video: false,
e2e: {
baseUrl: 'http://localhost:5173',
specPattern: '**/*.cy.ts',
<?php
class Product extends ProductCore
{
public static function getPriceStatic($id_product, $usetax = true, $id_product_attribute = null, $decimals = 6, $divisor = null, $only_reduc = false, $usereduc = true, $quantity = 1, $force_associated_tax = false, $id_customer = null, $id_cart = null, $id_address = null, &$specific_price_output = null, $with_ecotax = true, $use_group_reduction = true, Context $context = null, $use_customer_price = true, $id_customization = null)
{
// si HT, on désactive l'ecotaxe
if (!$usetax) {
$with_ecotax = false;
}
return parent::getPriceStatic($id_product, $usetax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity, $force_associated_tax, $id_customer, $id_cart, $id_address, $specific_price_output, $with_ecotax, $use_group_reduction, $context, $use_customer_price, $id_customization); // TODO: Change the autogenerated stub
document.addEventListener('dp-loaded', function() {
const field_name = 'price_wt';
window.dp_calc.subscribe(function(calc) {
if (!calc.input_fields || !calc.input_fields[field_name]) return
$('.precio_IVA').text(calc.input_fields[field_name].value_formatted)
})
});
import Main from "Main.svelte"
window.mountMyWidget = function(target, props) {
const main = new Main({
target: target,
props
})
console.log(main)
}
@unlocomqx
unlocomqx / CHANGELOG.md
Created October 3, 2023 11:43
ProductDesigner
@unlocomqx
unlocomqx / sku.sql
Last active September 29, 2023 14:14
SELECT COALESCE(SUM(od.product_quantity), 0) FROM ps_dynamicproduct_dropdown_option op
LEFT JOIN ps_dynamicproduct_field f on op.id_field = f.id_field
LEFT JOIN ps_dynamicproduct_input_field inf on op.id_field = inf.id_field
LEFT JOIN ps_dynamicproduct_input inp on inf.id_input = inp.id_input
LEFT JOIN ps_order_detail od on inp.id_customization = od.id_customization
WHERE op.sku = 'XXXXXX'
@unlocomqx
unlocomqx / App.svelte
Created September 28, 2023 06:01 — forked from jrmoynihan/App.svelte
A helper function for setting Svelte 5 $state() runes on objects
<script lang="ts">
import { gettable, settable, runed } from './runes.js'
const createFruit = (obj) => {
// An optional object of default values if the provided prop is nullish
const defaults = {
color: 'purple',
consumed: true,
count: 0
}

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.176.0 (2023-09-14)

Features

  • Add possibility to change item dimensions unit (mm,cm,m,in,ft) (ed2c0bc)
<?php
// path: /override/classes/order/Order.php
class Order extends OrderCore
{
public function __construct($id = null, $id_lang = null)
{
$this->webserviceParameters['associations']['order_rows']['fields']['additional_content'] = ['required' => false, 'xlink_resource' => 'customizations'];
parent::__construct($id, $id_lang);