Jump to:

2088 Posts in 1008 Topics by 455 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Field 'Amount' doesn't have a default value

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1155 Views
  • Roelfsche
    25 Posts

    Field 'Amount' doesn't have a default value Link to this post

    I've installed version 0.6 of the e-commerce-module together with payments.
    First there ist no relation between example product group and products on the website but I already saw a fix in this thread.
    The bigger problem is, that if I want to save an order, I get the message:

    [User Error] Couldn't run query: INSERT INTO `Payment` SET Created = NOW() Field 'Amount' doesn't have a default value

    The method stack looks as follows:

    * Couldn't run query: INSERT INTO `Payment` SET Created = NOW() Field 'Amount' doesn't have a default value
    Line 401 of MySQLDatabase.php
    * MySQLDatabase->databaseError(Couldn't run query: INSERT INTO `Payment` SET Created = NOW() | Field 'Amount' doesn't have a default value,256)
    Line 102 of MySQLDatabase.php
    * MySQLDatabase->query(INSERT INTO `Payment` SET Created = NOW(),256)
    Line 120 of DB.php
    * DB::query(INSERT INTO `Payment` SET Created = NOW())
    Line 836 of DataObject.php
    * DataObject->write()
    Line 187 of OrderForm.php
    * OrderForm->processOrder(Array,OrderForm,HTTPRequest)
    Line 246 of Form.php
    * Form->httpSubmission(HTTPRequest)
    Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 143 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 119 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 29 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(/checkout/OrderForm)
    Line 118 of main.php

    If I debug and print out the object in OrderForm there is an amount value...
    my _config.php looks like:



    Does anybody know, what's the reason for that? If I look in the DB the 'Amount' value is mandatory.
    Thank you,

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.