Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tuni-Soft unlocomqx

🏠
Working from home
View GitHub Profile
View products.php
<?php
$combination = new Combination($id_attribute);
$attributes = array();
$attributes_str = '';
if (Validate::isLoadedObject($combination)) {
$attributes_names = $combination->getAttributesName(Context::getContext()->language->id);
if (is_array($attributes_names)) {
foreach ($attributes_names as $attributes_name) {
View hide-arrows.css
.dsn-item-wrapper .ui-resizable-e {
display: none !important;
}
.dsn-item-wrapper .ui-resizable-s {
display: none !important;
}
View custom.js
$(window).on('load', function() {
dp_calc.subscribe(function(data) {
$('.product-price-with-tax .price').text(data.formatted_prices.price_ttc)
});
});
View custom.css
.custom-checkbox input[type=checkbox]:checked+span i {
opacity: 1;
transition: opacity ease-in-out .2s;
}
.custom-checkbox input[type=checkbox]+span i {
opacity: 0;
pointer-events: none;
font-size: 15px;
position: absolute;
View script.php
<?php
$product = (new ProductAssembler(Context::getContext()))
->assembleProduct(array('id_product' => $id_product));
@unlocomqx
unlocomqx / Product.php
Created Mar 16, 2021
Fix customization displayed price
View Product.php
<?php
// at the end of the addCustomizationPrice function in the file /classes/Product.php
if ($customization_quantity) {
$product_update['total_wt'] = $product_update['unit_price_tax_incl'] * $product_quantity;
$product_update['total_customization_wt'] = $product_update['total_wt'];
$product_update['total'] = $product_update['unit_price_tax_excl'] * $product_quantity;
$product_update['total_customization'] = $product_update['total'];
}
View product.tpl
{block name='product_additional_info'}
{include file='catalog/_partials/product-additional-info.tpl'}
{/block}
View products.php
<?php
$discounted_price = Product::getPriceStatic(
$id_product,
false,
$id_attribute,
6,
null,
false,
true,
View custom.js
$(function(){
$('<span class="product-price">Dés </span>').insertBefore('#add-to-cart-or-refresh .product-price');
});
View style.css
@media only screen and (max-width: 400px) {
.dp_type_image-list li {
height: 150px !important;
}
}