Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Expiry Date with order


Guest

Recommended Posts

Posted

Hi,

 

I've developed a ticket brokering site with oscommerce.

The site has been live for two months now, but a problem or two still linger.

I've used the product expiry date as the date for the tickets (concert, sport, etc).

This is working well, but there is a significant problem.

The date is not being added to the invoice, packing slip, or in orders.php in the backend of the site.

Has anyone come up with a way to get the expiry date to be recorded to each order?

The problem this is causing is that tickets for the same event but different dates are indistinguishable, and we've had to contact customers to verify the date they'd purchased for.

Any help would be much appreciated.

The site is - www.needaticket.ie.

Thanks again for your time.

 

John

Posted

Hi,

I 'm not intentionally bumping this, but if I've overlooked something obvious, like a contribution or a feature of oscommerce, that will do this can you let me know?

Cheers.

I've searched the forum, manual and googled this but came up with nothing.

I've also tried to figure out how to do this myself, and I'm fairly resourceful, but I haven't the knowledge/skill to fix this.

Thanks in advance for any help.

 

John

 

Hi,

 

I've developed a ticket brokering site with oscommerce.

The site has been live for two months now, but a problem or two still linger.

I've used the product expiry date as the date for the tickets (concert, sport, etc).

This is working well, but there is a significant problem.

The date is not being added to the invoice, packing slip, or in orders.php in the backend of the site.

Has anyone come up with a way to get the expiry date to be recorded to each order?

The problem this is causing is that tickets for the same event but different dates are indistinguishable, and we've had to contact customers to verify the date they'd purchased for.

Any help would be much appreciated.

The site is - www.needaticket.ie.

Thanks again for your time.

 

John

Posted
I've developed a ticket brokering site with oscommerce.

The site has been live for two months now, but a problem or two still linger.

I've used the product expiry date as the date for the tickets (concert, sport, etc).

This is working well, but there is a significant problem.

The date is not being added to the invoice, packing slip, or in orders.php in the backend of the site.

Has anyone come up with a way to get the expiry date to be recorded to each order?

The problem this is causing is that tickets for the same event but different dates are indistinguishable, and we've had to contact customers to verify the date they'd purchased for.

 

John - where are you entering in the expiry date ? Under the 'new product' form ? I don't see a field for an expiry date.

 

 

david

Posted
John - where are you entering in the expiry date ? Under the 'new product' form ? I don't see a field for an expiry date.

david

Hi David,

 

Thanks for the reply.

Sorry, it's been ages since I first set the site up.

The expiry-date is a contribution I'd added - http://www.oscommerce.com/community/contri...l/search,expiry

This kind of changes it a bit now that I've realised my mistake.

However, the expiry-date contribution is based on the date-available code, so would it be possible to pass the date-available to the orders table in the db?

My coding is isn't great but is there a command to say append the products_date_available field(or in this case products_date_expire), from the products table, to the products_name field in the orders_products table?

Sorry about the confusion earlier, I've gotten so wrapped up in this thing I'm not thinking straight!

Thanks for any help you can give.

 

John

Posted
Hi David,

 

Thanks for the reply.

Sorry, it's been ages since I first set the site up.

The expiry-date is a contribution I'd added - http://www.oscommerce.com/community/contri...l/search,expiry

This kind of changes it a bit now that I've realised my mistake.

However, the expiry-date contribution is based on the date-available code, so would it be possible to pass the date-available to the orders table in the db?

My coding is isn't great but is there a command to say append the products_date_available field(or in this case products_date_expire), from the products table, to the products_name field in the orders_products table?

Sorry about the confusion earlier, I've gotten so wrapped up in this thing I'm not thinking straight!

Thanks for any help you can give.

 

Ok - you've kinda lost me.

 

When I select New Product and add a product, you are using the default drop down/pick list as an *expiry date* ?

And this field is called products_date_expire in the products table ?

 

Is this correct ?

 

Jeepers - I can't remeber your oringal question! lol

 

ah right - invoice, etc.

 

Ok - so no big deal. Do this :

 

Open up admin/includes/langiages/english/orders.php and add this line :

define('TABLE_HEADING_EXPIRY', 'Date of Event');

 

Open up admin/orders.php and find this block :

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

 

and change to this :

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_EXPIRY; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

 

also in admin/orders.php, find this :

$orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";

 

and change to this :

$orders_query_raw = " select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, p.products_date_expire, s.orders_status_name, ot.text as order_total ";

$orders_query_raw .= " from orders o ";

$orders_query_raw .= " left join orders_products op on (o.orders_id = op.orders_id ) ";

$orders_query_raw .= " left join products p on p.products_id = op.products_id ";

$orders_query_raw .= " left join manufacturers m on m.manufacturers_id = p.manufacturers_id ";

$orders_query_raw .= " left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s ";

$orders_query_raw .= " where o.orders_status = s.orders_status_id ";

$orders_query_raw .= " and s.language_id = '1' ";

$orders_query_raw .= " and ot.class = 'ot_total' ";

$orders_query_raw .= " order by o.orders_id DESC";

// echo $orders_query_raw; exit;

 

Upload :

admin/includes/languages/english/orders.php, and

admin/orders.php

 

Hit /catalog/admin/orders.php and you should see a new column called Date of Event and the expiry date (which is obviously really the event date) :-)

 

Open up admin/includes/languages/english/invoice.php :

define('TABLE_HEADING_EXPIRY', 'Date of Event');

 

Open up admin/invoice.php and change this :

<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>

 

to this :

<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_EXPIRY; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>

 

 

in admin/invoice.php change this :

 

echo ' </td>' . "\n" .

' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";

 

to this :

echo ' </td>' . "\n" .

' <td class="dataTableContent" valign="top">'.$order->products[$i]['expiry'].'</td>' . "\n";

' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";

 

 

Open up admin/includes/classes/order.php and change this :

$orders_products_query = tep_db_query("select op.orders_products_id, op.products_id, op.products_name, op.products_model, op.products_price, op.products_tax, op.products_quantity, op.final_price, p.manufacturers_id, m.manufacturers_name from " . TABLE_ORDERS_PRODUCTS . " op left join " . TABLE_PRODUCTS . " p on p.products_id = op.products_id left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id = p.manufacturers_id where op.orders_id = '" . (int)$order_id . "' order by p.manufacturers_id");

 

 

while ($orders_products = tep_db_fetch_array($orders_products_query)) {

$this->products[$index] = array('qty' => $orders_products['products_quantity'],

'name' => $orders_products['products_name'],

'model' => $orders_products['products_model'],

'tax' => $orders_products['products_tax'],

'price' => $orders_products['products_price'],

'final_price' => $orders_products['final_price']);

 

To this :

$orders_products_query = tep_db_query("select op.orders_products_id, op.products_id, op.products_name, op.products_model, op.products_price, op.products_tax, op.products_quantity, op.final_price, p.products_date_expire, p.manufacturers_id, m.manufacturers_name from " . TABLE_ORDERS_PRODUCTS . " op left join " . TABLE_PRODUCTS . " p on p.products_id = op.products_id left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id = p.manufacturers_id where op.orders_id = '" . (int)$order_id . "' order by p.manufacturers_id");

 

 

while ($orders_products = tep_db_fetch_array($orders_products_query)) {

$this->products[$index] = array('qty' => $orders_products['products_quantity'],

'expiry' => $orders_products['products_date_expire'],

'name' => $orders_products['products_name'],

'model' => $orders_products['products_model'],

'tax' => $orders_products['products_tax'],

'price' => $orders_products['products_price'],

'final_price' => $orders_products['final_price']);

 

 

Now go and click on Invoice in your admin tool, and the event date should be displaying beside the Product

 

Open up admin/includes/languages/english/packingslip.php and add this line :

define('TABLE_HEADING_EXPIRY', 'Date of Event');

 

Open up admin/packingslip.php and change this :

<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

 

to this :

<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_EXPIRY; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

 

and change this :

echo ' </td>' . "\n" .

' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .

 

to this :

echo ' </td>' . "\n" .

' <td class="dataTableContent" valign="top">' . $order->products[$i]['expiry'] . '</td>' . "\n" .

' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .

 

Upload admin/packingslip.php, and

admin/includes/languages/english/packingslip.php

 

Hit : /catalog/admin/packingslip.php?oID=<order number> and you should see your event date

 

Open up /catalog/checkout_process.php and change this line :

$order_size = sizeof($order->products);

for ($i=0; $i<$order_size; $i++) {

 

to this :

$order_size = sizeof($order->products);

for ($i=0; $i<$order_size; $i++) {

// david get the expiry date

$expiryis_query = tep_db_query("SELECT products_date_expire from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

$expiryis_values = tep_db_fetch_array($expiryis_query);

// david format YYYY/MM/DD

$expiryis_values['products_date_expire'] = date("Y/m/d");

 

then find this :

$products_ordered .= $order->products[$i]['expiry'] .' david '. $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";

 

and change to this :

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . " - Date of Event : ". $expiryis_values['products_date_expire'] . "\n";

 

 

Upload /catalog/checkout_process.php

Make an order - the expiry date should be shown on the outgoing email.

 

Post back if you have any questions.

 

davidinottawa

Posted

Wow!

 

Thanks a million David.

I'm not a coder, but this looks like it'll do what I want. You're a legend.

I'll put this into the site later and let you know the result.

 

Thanks again,

John

Posted
Wow!

 

Thanks a million David.

I'm not a coder, but this looks like it'll do what I want. You're a legend.

I'll put this into the site later and let you know the result.

 

No problem. Let me know how it goes.

 

I sent you a PM as well John.

 

david

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...