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
@unlocomqx
unlocomqx / customization.tpl
Created September 1, 2025 17:52
Template fix
{*
open themes/[your theme]/templates/checkout/_partials/order-confirmation-table.tpl
look for {foreach from=$product.customizations item="customization"}
replace that block with the following block
*}
{foreach from=$product.customizations item="customization"}
{foreach from=$customization.fields item="field"}
<div class="product-customization-line">
<div class="label" style="text-align: left">
{$field.label}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
export const page_load = async (
{ fetch, route }: RequestEvent,
extra_data: Record<string, any> = {}
): Promise<any> => {
if (!route.id) {
return error(401, 'Bad request');
}
const backend_url = getBackendURL(route.id, 'page');
for (const [key, value] of Object.entries(extra_data)) {
backend_url.searchParams.set(key, value);
window.dp_calc.subscribe(function(calc) {
if (!calc.input_fields) {
return
}
if(calc.input_fields.max_largeur && calc.input_fields.max_hauteur){
const max_largeur = calc.input_fields.max_largeur.value;
const max_hauteur = calc.input_fields.max_hauteur.value;
window.updateField('largeur', {
document.addEventListener('DOMContentLoaded', function () {
var designer = document.getElementById('dsn-product-footer')
if (designer) {
var section = designer.closest('section')
section.insertAdjacentElement('afterend', designer)
}
})
if (result.resultCode == Activity.RESULT_OK && result.data != null) {
val uriList = mutableListOf<Uri>()
if (result.data?.clipData != null) {
for (i in 0 until result.data?.clipData?.itemCount!!) {
uriList.add(result.data?.clipData?.getItemAt(i)?.uri!!)
}
} else {
uriList.add(result.data?.data!!)
}
<?php
$unit_price = Product::getPriceStatic(
$id_product,
false,
$id_product_attribute,
6,
null,
false,
true,
<?php
// Attach module to hook
$this->registerHook('actionCartDuplicate');
// Run custom logic when the hook is triggered
public function hookActionCartDuplicate($params)
{
$id_cart_old = $params['oldCartId'];
$id_cart_new = $params['newCartId'];
# update id_module because it has changed after the new installation
UPDATE `pr_customized_data`
SET `id_module` = (SELECT `id_module` FROM `pr_module` WHERE `name` = 'dynamicproduct')
WHERE `id_module` = 96
# many rows are missing from the dynamicproduct_input table. To find the orders that have data
SELECT o.id_order, i.id_input, c.id_cart FROM `pr_cart` c
JOIN `pr_orders` o ON o.id_cart = c.id_cart
CREATE TABLE IF NOT EXISTS `ps_tunisoft_customization_field`
(
`id_customization_field` int(11) NOT NULL,
`id_module` int(11) NOT NULL,
PRIMARY KEY (`id_customization_field`, `id_module`)
) ENGINE = InnoDb
DEFAULT CHARSET = utf8;