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
.dp_group_options_qty .content {
display: grid;
grid-auto-flow: column;
grid-template-rows: 1fr 1fr;
grid-auto-columns: auto;
justify-items: center;
justify-content: start;
column-gap: .5rem;
row-gap: 0;
}
@unlocomqx
unlocomqx / products.php
Created January 30, 2024 19:37
Read option sku
<?php
/** @var $id_product */
/* @var DynamicInputField[] $input_fields */
/* @var $dropdown */
/* @var $dropdown_ref */
use DynamicProduct\classes\models\dynamic_fields\DropDownField;
use DynamicProduct\classes\models\DynamicField;
<?php
// The ID of the current product
/** @var int $id_product */
// The selected combination ID
/** @var int $id_attribute */
// The current selected quantity
/** @var int $quantity */
{** 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'