Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tuni-Soft unlocomqx

🏠
Working from home
View GitHub Profile
View product-prices.tpl
<div class="current-price-container">
<span class="current-price-label">{l s='Prix' d='Shop.Theme.Catalog'}</span>
<span itemprop="price" content="{$product.price_amount}">{$product.price}</span>
</div>
View Modifs.php
<?php
// Fichier /modules/ps_shoppingcart/ps_shoppingcart.php
// Fonction renderModal
// Avant la ligne $this->smarty->assign(array( , ajouter le code
$customization_value = (int)$id_customization ?
Db::getInstance()->getValue('SELECT value FROM ' . _DB_PREFIX_ . 'customized_data WHERE id_customization = ' . (int)$id_customization) :
null;
// Après la ligne 'product' => $product,
View Grid.php
public static function findValue($items, $value)
{
/** @var GridColumn[]|GridRow[] $item_values */
$item_values = array_values($items);
$count = count($item_values);
if (isset($item_values[0]) && $value <= $item_values[0]->value) {
return $item_values[0]->id;
}
for ($i = 0; $i < $count - 1; $i++) {
if ($value > $item_values[$i]->value && $value <= $item_values[$i + 1]->value) {
View custom.js
function moveDP() {
$('.dp_container').appendTo('.dsn-dp-container');
$('.dsn-dp-container').show()
}
View custom.js
$(function() {
if (+id_product_attribute === 3) {
$('#dsn-button, #dsn-product-footer').hide();
} else {
$('#dsn-button, #dsn-product-footer').show();
}
});
prestashop.on('updatedProduct', function(data) {
if (+data.id_product_attribute === 3) {
View script.js
$(window).on("load", function () {
dp_calc.subscribe(function (data) {
if (data && data.final_prices && data.final_prices.price_ht == 0) {
$(".price-error").fadeIn();
} else {
$(".price-error").fadeOut();
}
});
});
View custom.js
$(function() {
if (+id_product_attribute === 3) {
$('#dsn-button, #dsn-container').hide();
} else {
$('#dsn-button, #dsn-container').show();
}
});
prestashop.on('updatedProduct', function(data) {
if (+data.id_product_attribute === 3) {
View custom.js
function dp_zakryt_typ(value, id_option) {
var url = $('.dp_thumb_' + id_option + ' a:eq(0)').data('url');
console.log("id_option: " + id_option);
var container = $('#dp_r1_rozsirenie').closest('.dp_field_container');
var qtip_content = container.find('.dp_qtip');
qtip_content.find('img').prop('src', url);
var tooltip = container.find('.dp_tooltip');
tooltip.qtip('api').set('content.text', qtip_content.html());
var id_tooltip = tooltip.data('hasqtip');
console.log("id tooltip:" + id_tooltip);
View Product.php
<?php
// Customization price
if ((int)$id_customization) {
$customization_cost = Tools::convertPrice(Customization::getCustomizationPrice($id_customization), $id_currency);
if ((int)$id_cart) {
$discount_qty = 10;
$discount = 50;
$nb_total_customizations = (int)Db::getInstance()->getValue('
SELECT SUM(quantity)
View fix-shop-attribute-2.php
<?php
// CategoryCore::getProducts
// Changer la requête à
$sql = 'SELECT product_shop.cache_default_attribute, p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) AS quantity' . (Combination::isFeatureActive() ? ', IFNULL(product_attribute_shop.id_product_attribute, 0) AS id_product_attribute,
product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity' : '') . ', pl.`description`, pl.`description_short`, pl.`available_now`,
pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, image_shop.`id_image` id_image,
il.`legend` as legend, m.`name` AS manufacturer_name, cl.`name` AS category_default,
DATEDIFF(product_shop.`date_add`, DATE_SUB("' . date('Y-m-d') . ' 00:00:00",
You can’t perform that action at this time.