Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Short Description in orders


strub

Recommended Posts

Posted

Hi,

 

I am trying to add the products short description to the checkout_confimation / shopping cart / Email sent to customers / admin orders.php

 

The only thing which needs to be changed is in checkout_process.php. But I am not that good at DB queries. Hope you can help me.

 

In checkout_process.php

 

about line 197

    tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

   $sql_data_array = array('orders_id' => $insert_id, 
                           'products_id' => tep_get_prid($order->products[$i]['id']), 
                           'products_model' => $order->products[$i]['model'],
		'products_name' => $order->products[$i]['name'],
						'short_desc' => $order->products[$i]['short_desc'], 
                           'products_price' => $order->products[$i]['price'], 
                           'final_price' => $order->products[$i]['final_price'], 
                           'products_tax' => $order->products[$i]['tax'], 
                           'products_quantity' => $order->products[$i]['qty']);
   tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
   $order_products_id = tep_db_insert_id();

 

 

 

But this does not work as this

'short_desc' => $order->products[$i]['short_desc'],

is not in TABLE_PRODUCTS but in TABLE_PRODUCTS_DESCRIPTION

 

But how should I add a second query to that?

 

Thanks in advance

Posted

First, it's time to learn SQL. I started by purchasing "SQL For Dummies".

 

Second, what is the product's short description? Is this something you're adding? I don't see that field in the products_description table.

Check out Chad's News.

Posted

But this does not work as this

 

'short_desc' => $order->products[$i]['short_desc'],

 

 

is not in TABLE_PRODUCTS but in TABLE_PRODUCTS_DESCRIPTION

 

 

this is not related with table but it s related with the order class.

 

in includes/classes/order.php, you need to collect the product description in a class variable product ($this->products[]).

 

If you know php and mysql and know the oscommerce coding flow,then you can do it very easily, else you have to bit work around the includes/classes/orders.php file

 

BEFORE DOING ANY CHNAGES, PLEASE TAKE BACKUP OF ORIGINAL FILES

 

Thanks

Posted

Hey thanks a lot for replying.

 

I have already changed order.php but it just won't work. I tried it before with taking the products_image as this is in the same DB table. And it worked. But when I take "short_desc" it doesn't.

 

 

 

In inludes/classes/order.php I added the short_desc

 

$products = $cart->get_products();
     for ($i=0, $n=sizeof($products); $i<$n; $i++) {
       $this->products[$index] = array('qty' => $products[$i]['quantity'],
                                       'name' => $products[$i]['name'],
                                       'model' => $products[$i]['model'],
									'short_desc' => $products[$i]['short_desc'],
                                       'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
                                       'price' => $products[$i]['price'],
                                       'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
                                       'weight' => $products[$i]['weight'],
                                       'id' => $products[$i]['id']);

 

I just do not get it how it gets the products data from the BD table "products" to the "orders_product" table?

Posted

Ok, I found the problem or the missing data.

 

in includes/classes/shopping_cart.php added short_desc

 

in includes/classes/price_formater.php added short_desc

 

in includes/classes/price_formaterStore.php added short_desc

 

and

 

in admin/order.php added short_desc

in admin/includes/classes/orders.php added short_desc

Archived

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

×
×
  • Create New...