Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Davi Souza

Tutorial para adicionar o número e complemento na loja virtual oscomme

Recommended Posts

########################################################################

Tutorial para adicionar o número e complemento na loja virtual oscommerce.

 

criado por Davi Souza - souzadavi2@gmail.com em segunda-feira, 30 de junho de 2008, 15:35:03

Hospedagem de Oscommerce http://linknacional.com.br

 

FORUM: http://forums.oscommerce.com/index.php?showtopic=307115

 

Tempo estimado 30 minutos e 9 arquivos alterados.

 

########################################################################

 

 

ARQUIVOS ALTERADOS:

- catalog/create_account.php

- catalog/checkout_process.php

- checkout_shipping_address.php

- catalog/includes/classes/order.php

- catalog/includes/modules/payment/pagseguro.php

- catalog/includes/form_check.js.php

- catalog/includes/general.php

 

 

-admin/includes/classes/order.php

-admin/includes/functions/general.php

 

 

 

SQL >>> NO BANCO DE DADOS ::::

TABELA

 

address_book

crie os campos após - ----- entry_lastname

- entry_number_address --- varchar 64

- entry_comple_address --- varchar 64

 

orders

crie os campos após - ----- customers_street_address

- customers_number_address --- varchar 64

- customers_comple_address --- varchar 64

 

crie os campos após ----- delivery_street_address

- delivery_number_address --- varchar 64

- delivery_comple_address --- varchar 64

 

crie os campor após ----- billing_street_address

- billing_number_address --- varchar 64

- billing_comple_address --- varchar 64

 

address_format

- no address_format_id 1 alterar o address_format para:

$firstname $lastname$cr $streets$cr $suburb$cr$city, $postcode$cr$statecomma$country

 

:::::::::: ABRIR :::::::::::: catalog/includes/general.php

 

PROCURE POR:

entry_street_address as street_address,

 

SUBSTITUIE POR:

entry_street_address as street_address, entry_number_address as number_address, entry_comple_address as comple_address,

 

PROCURE POR: //(linha + ou - 480)

$streets = $street;

SUBTITUE POR:

$streets = $street .' '. $number;

 

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

:::::::::: ABRIR :::::::::::: checkout_shipping_address.php

 

PROCURE POR:

$street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);

 

SUBSTITUE POR:

$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);

$number_address = tep_db_prepare_input($HTTP_POST_VARS['number_address']);

$comple_address = tep_db_prepare_input($HTTP_POST_VARS['comple_address']);

 

PROCURE POR:

'entry_street_address' => $street_address,

 

SUBSTITUE POR:

'entry_street_address' => $street_address,

'entry_number_address' => $number_address,

'entry_comple_address' => $comple_address,

 

PROCURE POR:

entry_street_address as street_address,

 

SUBSITUIE POR:

entry_street_address as street_address, entry_number_address as number_address, entry_comple_address as comple address,

 

 

 

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

:::::::::::::::::::::: create_account.php

 

PROCURE POR:

$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);

 

 

SUBSTITUA POR

$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);

$number_address = tep_db_prepare_input($HTTP_POST_VARS['number_address']);

$comple_address = tep_db_prepare_input($HTTP_POST_VARS['comple_address']);

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

'entry_street_address' => $street_address,

 

SUBSTITUIA:

'entry_street_address' => $street_address,

'entry_number_address' => $number_address,

'entry_comple_address' => $comple_address,

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

<tr>

<td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>

<td class="main"><?php echo tep_draw_input_field('street_address') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>

</tr>

 

SUBSTITUE POR:

<tr>

<td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>

<td class="main"><?php echo tep_draw_input_field('street_address') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>

</tr>

 

<tr>

<td class="main"><?php echo ENTRY_NUMBER_ADDRESS; ?></td>

<td class="main"><?php echo tep_draw_input_field('number_address') . ' ' . (tep_not_null(ENTRY_NUMBER_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_NUMBER_ADDRESS_TEXT . '</span>': ''); ?></td>

</tr>

<tr>

<td class="main"><?php echo ENTRY_COMPLE_ADDRESS; ?></td>

<td class="main"><?php echo tep_draw_input_field('comple_address') . ' ' . (tep_not_null(ENTRY_COMPLE_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPLE_ADDRESS_TEXT . '</span>': ''); ?></td>

</tr>

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

 

 

 

 

 

::::::::::::::::::::::: checkout_process.php

 

PROCURE:

'customers_street_address' => $order->customer['street_address'],

 

SUBSTITUA POR:

'customers_street_address' => $order->customer['street_address'],

'customers_number_address' => $order->customer['number_address'],

'customers_comple_address' => $order->customer['comple_address'],

 

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

'delivery_street_address' => $order->delivery['street_address'],

 

SUBSTITUA POR:

'delivery_street_address' => $order->delivery['street_address'],

'delivery_number_address' => $order->delivery['number_address'],

'delivery_comple_address' => $order->delivery['comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

PROCURE POR:

'billing_street_address' => $order->billing['street_address'],

 

SUBSITUIA POR:

'billing_street_address' => $order->billing['street_address'],

'billing_number_address' => $order->billing['number_address'],

'billing_comple_address' => $order->billing['comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

 

 

 

 

 

 

:::::::::::::::::::::::::::::: catalog/includes/classes/order.php

 

PROCURE POR:

customers_company, customers_street_address,

 

SUBSTITUIA POR:

customers_company, customers_street_address, customers_number_address, customers_comple_address,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

PROCURE POR:

delivery_company, delivery_street_address,

 

SUBSTITUA POR:

delivery_company, delivery_street_address, delivery_number_address, delivery_comple_address,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

billing_company, billing_street_address,

 

SUBSTITUA POR:

billing_company, billing_street_address, billing_number_address, billing_comple_address,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

'street_address' => $order['customers_street_address'],

 

SUBSTITUA POR:

'street_address' => $order['customers_street_address'],

'number_address' => $order['customers_number_address'],

'comple_address' => $order['customers_comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

PROCURE POR:

'street_address' => $order['delivery_street_address'],

 

SUBSTITUA POR:

'street_address' => $order['delivery_street_address'],

'number_address' => $order['delivery_number_address'],

'comple_address' => $order['delivery_comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

PROCURE POR:

'street_address' => $order['billing_street_address'],

 

SUBSTITUA POR:

'street_address' => $order['billing_street_address'],

'number_address' => $order['billing_number_address'],

'comple_address' => $order['billing_comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

$customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address,

 

SUBSTITUA POR:

$customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_number_address, ab.entry_comple_address,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

'entry_street_address' => $sendto['street_address'],

 

SUBSTITUA POR:

'entry_street_address' => $sendto['street_address'],

'entry_number_address' => $sendto['number_address'],

'entry_comple_address' => $sendto['comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

$shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address,

 

SUBSTITUA POR:

$shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_number_address, ab.entry_comple_address,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

'entry_street_address' => null,

 

SUBSTITUA POR:

'entry_street_address' => null,

'entry_number_address' => null,

'entry_comple_address' => null,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

PROCURE POR:

'entry_street_address' => $billto['street_address'],

 

SUBSTITUA POR:

'entry_street_address' => $billto['street_address'],

'entry_number_address' => $billto['number_address'],

'entry_comple_address' => $billto['comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

$billing_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address,

 

SUBSTITUE POR:

$billing_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_number_address, ab.entry_comple_address,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

PROCURE POR:

'street_address' => $customer_address['entry_street_address'],

 

SUBSTITUE POR:

'street_address' => $customer_address['entry_street_address'],

'number_address' => $customer_address['entry_number_address'],

'comple_address' => $customer_address['entry_comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

PROCURE POR:

'street_address' => $shipping_address['entry_street_address'],

 

SUBSTITUE POR:

'street_address' => $shipping_address['entry_street_address'],

'number_address' => $shipping_address['entry_number_address'],

'comple_address' => $shipping_address['entry_comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

'street_address' => $billing_address['entry_street_address'],

 

SUBSTITUE POR:

'street_address' => $billing_address['entry_street_address'],

'number_address' => $billing_address['entry_number_address'],

'comple_address' => $billing_address['entry_comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

$order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address,

 

SUBSTITUE POR:

$order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_number_address, customers_comple_address,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

 

 

::::::::::::::::::::::::: pagseguro.php

 

PROCURE POR:

'street_address' => $customer_address['entry_street_address'],

 

SUBSTITUIE POR:

'customers_street_address' => $order->customer['street_address'],

'customers_number_address' => $order->customer['number_address'],

'customers_comple_address' => $order->customer['comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

'delivery_street_address' => $order->delivery['street_address'],

 

SUBSTITUIR POR:

'delivery_street_address' => $order->delivery['street_address'],

'delivery_number_address' => $order->delivery['number_address'],

'delivery_comple_address' => $order->delivery['comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

PROCURE POR:

billing_street_address' => $order->billing['street_address'],

SUBSTITUIE POR:

'billing_street_address' => $order->billing['street_address'],

'billing_number_address' => $order->billing['number_address'],

'billing_comple_address' => $order->billing['comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

$cust_num = "s/n";

$cust_compl = "casa2";

 

SUBSTITUIE POR:

// $cust_num = "s/n";

// $cust_compl = "casa2";

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

//tep_draw_hidden_field('cliente_num', $cust_num) . "\n" .

//tep_draw_hidden_field('cliente_compl', $cust_compl) . "\n" .

 

SUBSTITUIE POR:

tep_draw_hidden_field('cliente_num', $order->delivery['number_address']) . "\n" .

tep_draw_hidden_field('cliente_compl', $order->delivery['comple_address']) . "\n" .

 

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

 

 

:::::::::::::::::::::::::::::::::: catalog/includes/form_check.js.php

 

PROCURE POR:

check_input("street_address", <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_STREET_ADDRESS_ERROR; ?>");

 

SUBSITUA POR:

check_input("street_address", <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_STREET_ADDRESS_ERROR; ?>");

check_input("number_address", <?php echo ENTRY_NUMBER_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_NUMBER_ADDRESS_ERROR; ?>");

 

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

 

 

 

:::::::::::::::::::::::::::::: admin/includes/classes/order.php

 

PROCURE POR:

customers_company, customers_street_address,

 

SUBSTITUIA POR:

customers_company, customers_street_address, customers_number_address, customers_comple_address,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

PROCURE POR:

billing_company, billing_street_address,

 

SUBSTITUA POR:

billing_company, billing_street_address, billing_number_address, billing_comple_address,

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

PROCURE POR:

'street_address' => $order['customers_street_address'],

 

SUBSTITUA POR:

'street_address' => $order['customers_street_address'],

'number_address' => $order['customers_number_address'],

'comple_address' => $order['customers_comple_address'],

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

 

 

 

:::::::::::::::::::::::::::::: admin/includes/functions/general.php

 

PROCURE POR:

$street = tep_output_string_protected($address['street_address']);

 

SUBSTITUA POR:

$street = tep_output_string_protected($address['street_address']) .' '. tep_output_string_protected($address['number_address']) . ' '.tep_output_string_protected($address['comple_address']);

 

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Excelente Davi

 

Obrigado por compartilhar

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.