Jump to content

Adding new checkbox on order step (like recycled packaging)


Recommended Posts

Hi i try to add extra checkbox on order process with question for buyer.

I try to do someting like that - http://www.prestashop.com/forums/viewthread/13859/P0/configuring___using_prestashop/solved_adding_new_fields_to_new_account

I've changed
Order.php
order-address.tpl
AdminOrders.php
order.php

and database

but system dont read extra checkbox :(

If I change Order.php on

/** @var boolean Customer is ok for a question*/
   public        $extracheckbox = 1;



on protected $fieldsValidate = array(

'extracheckbox' => 'isBool',



on public function getFields()
{
parent::validateFields();

$fields['extracheckbox'] = intval($this->extracheckbox);



then database is 1 if $extracheckbox = 0 then db is 0
How to give decide to customer about tick or not
coz code in order-adress.tpl dont give a changes

<input type="checkbox" name="extracheckbox" id="extracheckbox" value="1" {if $extracheckbox == 1}checked="checked"{/if} />
{l s='Extra question'}.



in order.php:

/* Carrier step */

$cart->extracheckbox = (isset($_POST['extracheckbox']) AND !empty($_POST['extracheckbox'])) ? 1 : 0;




Where is mistake?

Link to comment
Share on other sites

  • 3 weeks later...

there is more files to change, the PaymentModule.php, Cart.php, order-carrier.tpl, order-detail.tpl ( for the customer account)

if you are using a payment module witch integrate the code of PaymenModules.php, you have to change it too ( /modules/yourpayment)

You have to add a new entry in the cart table too of the database (table Cart and Orders).

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...