Zadejte hledaný výraz...

XML Feed Prestashop – chyba při slevách

Makalouš
verified
rating uzivatele
(23 hodnocení)
5. 6. 2010 14:05:51
Zdravím,
mám problém při slevách v mém feedu u eshopu www.gadgeto.cz feed vypadá takto:
$shopUrl = 'gadgeto.cz';
$noShowCategory = "7,8,9,69,70,71,72,73,74,75,76,77,78,79";
$cfgFile = dirname(__FILE__) . '/config/settings.inc.php';
if (!file_exists($cfgFile))
{
die('Skript musi byt umisten v rootu prestashopu v config/settings.inc.php musi byt nastaveni databaze.');
}
require_once($cfgFile);
$db = @MySQL_Connect(_DB_SERVER_, _DB_USER_, _DB_PASSWD_);
if (!$db)
{
die('Nemohu se spojit s databazi.');
}
MySQL_Select_DB(_DB_NAME_, $db);
MySQL_Query("SET NAMES 'utf8'");
$prefix = "ps_";
header("Content-Type: text/xml");
echo '';
?>
echo "nn";
$res = MySQL_Query("
SELECT
p.id_product,
p.quantity,
p.price,
p.reduction_price,
p.reduction_percent,
p.reduction_from,
p.reduction_to,
pl.name,
pl.description_short,
pl.link_rewrite,
i.id_image
FROM {$prefix}product p
JOIN {$prefix}product_lang pl USING(id_product)
JOIN {$prefix}image i USING(id_product)
WHERE i.cover = 1 AND NOT (SELECT COUNT(*)
FROM {$prefix}category_product cp
WHERE cp.id_product = p.id_product
AND cp.id_category IN($noShowCategory))
ORDER BY p.id_product", $db);
$currentDate = date('Y-m-d');
while ($row = MySQL_Fetch_Assoc($res))
{
$desc = strip_tags(html_entity_decode($row, ENT_COMPAT, 'utf-8'));
if ($result == $result
|| ($result <= $currentDate
&& $currentDate <= $result))
{
if ($row && $row > 0)
{
if ($row >= $row)
{
$reduction = $row;
}
else
{
$reduction = $row;
}
}
elseif ($row && $row > 0)
{
if ($row >= 100)
{
$reduction = $row;
}
else
{
$reduction = $row * $row / 100;
}
}
}
echo "n";
echo "t" . mb_substr($row, 0, 64, 'utf-8') ." ". $row."n";
echo "t" . mb_substr($desc, 0, 512, 'utf-8') . "n";
echo "thttp://" . $shopUrl . "/" . $row .
"-" . $row . ".html
n";
echo "tnewn";
echo "t" . ($row > 0 ? "0" : "73") . "n";
echo "thttp://" . $shopUrl . "/img/p/" .$row .
"-" . $row . "-large.jpg
n";
echo "t" . round($row*1) . "n";
echo "tn";
echo "t" . round($row*1.2 - $reduction) . "n";
echo "
n";
}
echo "
n";
?>
Při slevách zobrazuje špatnou cenu (cenu bez slevy), vědel by nekdo co stím :)
Děkuji za odpvěd.
5. 6. 2010 14:05:51
https://webtrh.cz/diskuse/xml-feed-prestashop-chyba-pri-slevach#reply513111
Pro odpověď se přihlašte.
Přihlásit