Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -369,7 +369,8 @@ abstract class PaymentModuleCore extends Module
|
|||||||
$customization_text .= sprintf(Tools::displayError('%d image(s)'), count($customization['datas'][Product::CUSTOMIZE_FILE])).'<br />';
|
$customization_text .= sprintf(Tools::displayError('%d image(s)'), count($customization['datas'][Product::CUSTOMIZE_FILE])).'<br />';
|
||||||
$customization_text .= '---<br />';
|
$customization_text .= '---<br />';
|
||||||
}
|
}
|
||||||
$customization_text = rtrim($customization_text, '---<br />');
|
|
||||||
|
$customization_text = Tools::rtrimString($customization_text, '---<br />');
|
||||||
|
|
||||||
$customization_quantity = (int)$product['customization_quantity'];
|
$customization_quantity = (int)$product['customization_quantity'];
|
||||||
$products_list .=
|
$products_list .=
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ class ProductSaleCore
|
|||||||
foreach ($products as $product)
|
foreach ($products as $product)
|
||||||
$ids[$product['id_product']] = 1;
|
$ids[$product['id_product']] = 1;
|
||||||
$ids = array_keys($ids);
|
$ids = array_keys($ids);
|
||||||
|
$ids = array_filter($ids);
|
||||||
sort($ids);
|
sort($ids);
|
||||||
$ids = count($ids) > 0 ? implode(',', $ids) : 'NULL';
|
$ids = count($ids) > 0 ? implode(',', $ids) : 'NULL';
|
||||||
|
|
||||||
@@ -157,6 +158,7 @@ class ProductSaleCore
|
|||||||
$ids[$product['id_product']] = 1;
|
$ids[$product['id_product']] = 1;
|
||||||
$ids = array_keys($ids);
|
$ids = array_keys($ids);
|
||||||
sort($ids);
|
sort($ids);
|
||||||
|
$ids = array_filter($ids);
|
||||||
$ids = count($ids) > 0 ? implode(',', $ids) : 'NULL';
|
$ids = count($ids) > 0 ? implode(',', $ids) : 'NULL';
|
||||||
|
|
||||||
//Main query
|
//Main query
|
||||||
|
|||||||
+15
-1
@@ -2739,6 +2739,20 @@ exit;
|
|||||||
}
|
}
|
||||||
return $fileAttachment;
|
return $fileAttachment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a substring from another one starting from the right
|
||||||
|
* @param string $str
|
||||||
|
* @param string $str_search
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function rtrimString($str, $str_search)
|
||||||
|
{
|
||||||
|
$length_str = strlen($str_search);
|
||||||
|
if (strlen($str) >= $length_str && substr($str, -$length_str) == $str_search)
|
||||||
|
$str = substr($str, 0, -$length_str);
|
||||||
|
return $str;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2765,4 +2779,4 @@ function cmpPriceDesc($a, $b)
|
|||||||
elseif ((float)$a['price_tmp'] > (float)$b['price_tmp'])
|
elseif ((float)$a['price_tmp'] > (float)$b['price_tmp'])
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -120,7 +120,7 @@ class HomeFeatured extends Module
|
|||||||
{
|
{
|
||||||
$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
|
$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
|
||||||
$nb = (int)Configuration::get('HOME_FEATURED_NBR');
|
$nb = (int)Configuration::get('HOME_FEATURED_NBR');
|
||||||
$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8));
|
$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), "position");
|
||||||
|
|
||||||
$this->smarty->assign(array(
|
$this->smarty->assign(array(
|
||||||
'products' => $products,
|
'products' => $products,
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ class MailAlerts extends Module
|
|||||||
$customization_text .= '---<br />';
|
$customization_text .= '---<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
$customization_text = rtrim($customization_text, '---<br />');
|
$customization_text = Tools::rtrimString($customization_text, '---<br />');
|
||||||
}
|
}
|
||||||
|
|
||||||
$items_table .=
|
$items_table .=
|
||||||
|
|||||||
Reference in New Issue
Block a user