Jump to content

Impossible to add the product to the cart


Recommended Posts

  • 5 weeks later...
  • 1 month later...

Hi,

I have the same problem. Happened after upgrading to 1.6.1.2 but it persists after I rolled back to my previous version (1.6.0.1).

I've tried disabling ajax cart, disabling friendly url, disabling google analytics, even deleting and reinstalling the cart module. Nothing helps or makes a difference even. I have a test site on the same server where I run an exact copy of the main site. There everything runs fine both with and without the update.

I'm pretty much out of ideas of what to do and where to look now...???..

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...

I have a similar problem:

--> no paypal module

 

and getting this error: 

 

Impossible to add the product to the cart.
textStatus: 'parsererror'
errorThrown: 'SyntaxError: Unexpected token <'
responseText:
{"products":[{"id":11,"link":"http:\/\/...

 

any help is realy appreciated. 

 

--> www.boomfactory.ch

 

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...
i wanted to change order reference to numeric value in prestashop, i followed these steps by someone 

 

Copy the file /classes/PaymentModule.php to /override/classes/PaymentModule.php.

Edit the file /override/classes/PaymentModule.php as follows.

 

At lines 337-341 is a code block that should read like this:

 

if (!result)

{

  PrestaShopLogger::addLog('PaymentModule::validateOrder - Order cannot be created',

    3, null, 'Cart', (int)$id_cart, true);

  throw new PrestaShopException('Can\'t save Order');

}

Immediately after that code block, insert the following two lines of code:

$order->reference = str_pad($order->id, 9, '0', STR_PAD_LEFT);

$order->update();

 

Delete the file /cache/class_index.php so that Prestashop automatically re-creates this file taking into account the new override file.

 

after these steps, when i try to add product to cart, this error comes

"Impossible to add the product to the cart.

 

textStatus: 'error'

errorThrown: ''

responseText:?]"

 

i tried disabling ajax cart, then i cant delete product from cart, also cant change quantity of ordered product in cart. 

Link to comment
Share on other sites

Hi goeggmen,

 

If you are using third party modules pls disable it. And also please turn off the developer mode and try add the product to cart Suppose if you have any warnings and notices in your store means while adding the product to cart(AJAX functionality) will not successful response.

 

So try clear all warnings and notices and turn off the developer mode.

Link to comment
Share on other sites

@Samsung Outlet your way of making an override is incorrect. Don't copy the entire file from classes into override, create the file into override as an extend of the original class and copy only the function that you need to modify. Read the documentation to override code manually.

 

For your PaymentModule class, create file /override/classes/PaymentModule.php and inside:

class PaymentModule extends PaymentModuleCore
{
    // your override custom function here
}

Assuming that the code to have order reference as numeric value is correct, look into the original class to find what function you should override. In this case it's function validateOrder(). Copy the entire function into the override class and add your custom code there.

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...