Jump to content

Problem s vlozenim zbozi do kosiku"...unable to add the product."


cilecek

Recommended Posts

Cauky,
mam problem s pridavanim zbozi do kosiku. Pokud chci pridat zbozi do kosiku z "doporucujeme" nebo ze stranky se seznamem produktu a produkt ma ruzne atributy a skladem je ho 0ks, vyhodi to tenhle error:

TECHNICAL ERROR: unable to add the product.
Details:
Error thrown: [object XMLHttpRequest]
Text status: parsererror

Dela to jenom AJAX kosik, kdyz vypnu AJAX tak to funguje. Po celym dni prohlizeni fora i googleni nejsem schopen najit reseni, i kdyz tu urcite nekde je :(

Predem dik za pomoc, milan

Link to comment
Share on other sites

  • 2 months later...

Ahoj,
problém je v souboru classes/product.php

řádek 321:

$sql = 'SELECT `id_product_attribute`
       FROM `'._DB_PREFIX_.'product_attribute`
       WHERE `default_on` = 1 AND `quantity` > 0 AND `id_product` = '.intval($id_product);
       $result = Db::getInstance()->getRow($sql);
       if (!$result)
           $result = Db::getInstance()->getRow('
           SELECT `id_product_attribute`
           FROM `'._DB_PREFIX_.'product_attribute`
           WHERE `quantity` > 0  AND `id_product` = '.intval($id_product));
       return $result['id_product_attribute'];



nahradit

        $sql = 'SELECT `id_product_attribute`
       FROM `'._DB_PREFIX_.'product_attribute`
       WHERE `default_on` = 1 '.(intval($minimumQuantity) > 0 ? 'AND `quantity` >= '.intval($minimumQuantity).' ' : '').'AND `id_product` = '.intval($id_product);
       $result = Db::getInstance()->getRow($sql);
       if (!$result)
           $result = Db::getInstance()->getRow('
           SELECT `id_product_attribute`
           FROM `'._DB_PREFIX_.'product_attribute`
           WHERE '.(intval($minimumQuantity) > 0 ? '`quantity` >= '.intval($minimumQuantity).' AND ' : '').'`id_product` = '.intval($id_product));
       if (!$result)
           $result = Db::getInstance()->getRow('
           SELECT `id_product_attribute`
           FROM `'._DB_PREFIX_.'product_attribute`
           WHERE `id_product` = '.intval($id_product));            
       return $result['id_product_attribute'];

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...