Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
gRoussac
2013-11-21 14:20:00 +01:00
5 changed files with 21 additions and 4 deletions
+2 -1
View File
@@ -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 .= '---<br />';
}
$customization_text = rtrim($customization_text, '---<br />');
$customization_text = Tools::rtrimString($customization_text, '---<br />');
$customization_quantity = (int)$product['customization_quantity'];
$products_list .=
+2
View File
@@ -85,6 +85,7 @@ class ProductSaleCore
foreach ($products as $product)
$ids[$product['id_product']] = 1;
$ids = array_keys($ids);
$ids = array_filter($ids);
sort($ids);
$ids = count($ids) > 0 ? implode(',', $ids) : 'NULL';
@@ -157,6 +158,7 @@ class ProductSaleCore
$ids[$product['id_product']] = 1;
$ids = array_keys($ids);
sort($ids);
$ids = array_filter($ids);
$ids = count($ids) > 0 ? implode(',', $ids) : 'NULL';
//Main query
+15 -1
View File
@@ -2739,6 +2739,20 @@ exit;
}
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'])
return -1;
return 0;
}
}
+1 -1
View File
@@ -120,7 +120,7 @@ class HomeFeatured extends Module
{
$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
$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(
'products' => $products,
+1 -1
View File
@@ -318,7 +318,7 @@ class MailAlerts extends Module
$customization_text .= '---<br />';
}
$customization_text = rtrim($customization_text, '---<br />');
$customization_text = Tools::rtrimString($customization_text, '---<br />');
}
$items_table .=