Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

NO.... nothing

 

Find in admin/edit_orders.php all three instances of

	<?php if (ORDER_EDITOR_USE_AJAX != 'true') { ?>
	 <!-- Begin Update Block, only for non-ajax use -->

			<div class="updateBlock">
			   <div class="update1"><?php echo HINT_PRESS_UPDATE; ?></div>
			   <div class="update2"> </div>
			   <div class="update3"> </div>
			   <div class="update4" align="center"><?php echo ENTRY_SEND_NEW_ORDER_CONFIRMATION; ?> <?php echo tep_draw_checkbox_field('nC1', '', false); ?></div>
			   <div class="update5" align="center"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></div>
			</div>

  <br>
  <br>
  <!-- End of Update Block -->
	   <?php } ?>

and change each to

	  <!-- Begin Update Block, only for non-ajax use -->

			<div class="updateBlock">
			   <div class="update1"><?php echo HINT_PRESS_UPDATE; ?></div>
			   <div class="update2"> </div>
			   <div class="update3"> </div>
			   <div class="update4" align="center"><?php echo ENTRY_SEND_NEW_ORDER_CONFIRMATION; ?> <?php echo tep_draw_checkbox_field('nC1', '', false); ?></div>
			   <div class="update5" align="center"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></div>
	  </div>

  <br>
  <br>
  <!-- End of Update Block -->

 

Be careful when editing the third instance as the php tag

	<?php   }  //end if (ORDER_EDITOR_USE_AJAX == 'false') {
	  echo '</form>';
	}
?>

that closes the if statement "if (ORDER_EDITOR_USE_AJAX != 'true')" is used for other purposes, so you would not delete the php tag, just the first curly brace }.

Edited by djmonkey1

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

NO.... nothing

 

I had this problem too a while back. Give DJMonkey's suggestion a go (he's a top bloke, knows what he's doing!), but if you get no joy, my workaround was to use FireFox web browser instead of Internet Explorer.

 

Hope this helps,

Max

Link to comment
Share on other sites

Hi DJ,

 

Thanks for all your previous assistance with this contribution. I've installed version 5.0.5 and I have one minor problem with it. If I insert a comment on the order, and that comment happens to contain an apostrophe, it produces a MySQL error:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's the story')' at line 7

 

INSERT into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('73', '1', now(), 0, 'what's the story')

 

If I use the text "whats the story" instead of "what's the story", it's inserted correctly.

 

Can you assist please? Also, is it OK to continue using 5.0.5, or should I upgrade to 5.0.6?

 

Max

Link to comment
Share on other sites

Hi DJ,

 

Thanks for all your previous assistance with this contribution. I've installed version 5.0.5 and I have one minor problem with it. If I insert a comment on the order, and that comment happens to contain an apostrophe, it produces a MySQL error:

 

If I use the text "whats the story" instead of "what's the story", it's inserted correctly.

 

Can you assist please? Also, is it OK to continue using 5.0.5, or should I upgrade to 5.0.6?

 

Max

 

I cannot recreate this problem on my testing server. Are you using AJAX to submit the new comments?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Does this module provide instructions for modifying the file catalog/includes/classes/shopping_cart.php?

 

 

No. It uses its own set of classes. The code for the abxCart where that function is found in the below file:

<?php
/*
 $Id: abxCart.php,v 1.17 2007/01/13 02:16:46 auctionblox Exp $

 AuctionBlox, sell more, work less!
 [url="http://www.auctionblox.com"]http://www.auctionblox.com[/url]

 Copyright © 2004 AuctionBlox
*/

 class_exists('shoppingCart') || require_once(DIR_WS_CLASSES . 'shopping_cart.php');
 class_exists('abxCheckout')  || require_once(dirname(__FILE__) . '/abxCheckout.php');

 class abxCart extends shoppingCart {

   var $email;

   function abxCart($email_address = '')
   {
     $this->email = $email_address;
     parent::shoppingCart();
   }

   // This function does not ALWAYS set the order id, but at least it updates the status
   // to checked out
   function reset($reset_database = false, $order_id = 0)
   {
     global $abxDatabase;

     parent::reset($reset_database);

     if ($reset_database == true) {

     	if($order_id === 0)
     	{
     		// find the last order id in the history table -- that's our target order.  surely, we don't have
     		// a site that is THAT active
     	  $orders_status = $abxDatabase->fetch_row("select orders_id from " . TABLE_ORDERS_STATUS_HISTORY . " order by orders_status_history_id desc limit 1");
     		$order_id = $orders_status['orders_id'];
     	}

       // Mark the items in the shopping cart completed.
       $abxCheckout = new abxCheckout();

       $auctionProducts = $this->internal_get_auction_products();

       foreach($auctionProducts as $key => $auction) {

         //quick fudge to accomodate selected admin Sales Order Entry
         if (isset($auction['is_excluded']) && $auction['is_excluded'] === true)
           continue;

         $auctionProduct = array(
           'ID'       => $auction['auction_basket_id'],
           'statusID' => $abxCheckout->CHECKEDOUT,
           'ordersID' => $order_id
         );

         $abxCheckout->update(null, $auctionProduct);

       }

     }
   }

   //@@deprecated
   function checkStatus()
   {
   }

   function internal_get_auction_products()
   {
     global $abxDatabase, $currencies;

     if (isset($this->email) === false || strlen($this->email) == 0) {

       if (isset($_SESSION['g_auction_email_address']) && strlen($_SESSION['g_auction_email_address']) > 0) {

         $this->email = $_SESSION['g_auction_email_address'];

       } else {

         global $customer_id;

         if (isset($customer_id) && $customer_id >= 0) {

           $customer = $abxDatabase->fetch_row("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = ". (int)$customer_id);

           $this->email = @$customer['customers_email_address'];

         }

       }
     }

     $abxCheckout = new abxCheckout();

     $auctions = $abxCheckout->getSales($this->email);

     $products_array = array();

     if (is_array($auctions)) {

       global $languages_id;

       foreach($auctions as $key => $auction) {
         $products = $abxDatabase->fetch_row("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$auction['product_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

         if (empty($products) === false) {
           $products_array[] = array(
             'id'                => $products['products_id'],
             'name'              => $auction['ext_title'] . " (eBay #" . $auction['ext_id'] . ", " . $auction['buyer_id'] . ")",
             'model'             => $products['products_model'],
             'image'             => $products['products_image'],
             'quantity'          => $auction['qty'],
             'weight'            => $products['products_weight'],
             'currency'          => $auction['currency'],
             'tax_class_id'      => $products['products_tax_class_id'],
             'price'             => $currencies->convertCurrency($auction['price_end'], $auction['currency']),
             'final_price'       => $currencies->convertCurrency($auction['price_end'], $auction['currency']),
             'shipping_type'     => $auction['shipping_type'],
             'shipping'          => $currencies->convertCurrency($auction['shipping'], $auction['currency']),
             'shipping_global'   => $currencies->convertCurrency($auction['shipping_global'], $auction['currency']),
             'insurance'         => $currencies->convertCurrency($auction['insurance'], $auction['currency']),
             'insurance_option'  => $auction['insurance_option'],
             'is_auction_item'   => true,
             'auction_basket_id' => $auction['id'],
             'item_url'          => $auction['item_url'],
             'attributes'        => array()
           );
         } else {

           $sImage = '../'.DIR_WS_MODULES.'auctionblox/images/product.gif';

           // product ID not set
           // We can't use weight based shipping since we don't know the weight
           $products_array[] = array(
             'id'                => $auction['ext_id'],
             'name'              => $auction['ext_title'] . " (eBay #" . $auction['ext_id'] . ", " . $auction['buyer_id'] . ")",
             'model'             => '',
             'image'             => $sImage,
             'quantity'          => $auction['qty'],
             'weight'            => -1,
             'tax_class_id'      => 0,
             'price'             => $currencies->convertCurrency($auction['price_end'], $auction['currency']),
             'final_price'       => $currencies->convertCurrency($auction['price_end'], $auction['currency']),
             'shipping_type'     => $auction['shipping_type'],
             'shipping'          => $currencies->convertCurrency($auction['shipping'], $auction['currency']),
             'shipping_global'   => $currencies->convertCurrency($auction['shipping_global'], $auction['currency']),
             'insurance'         => $currencies->convertCurrency($auction['insurance'], $auction['currency']),
             'insurance_option'  => $auction['insurance_option'],
             'is_auction_item'   => true,
             'auction_basket_id' => $auction['id'],
             'item_url'          => $auction['item_url'],
             'attributes'        => array()
           );

         }

       }

     }

     return $products_array;
   }

   function internal_get_store_products()
   {
     // Fix for bad programming in shopping cart
     return parent::get_products();
   }


   function get_products()
   {
     $store_products_array = $this->internal_get_store_products();

     // Fix for bad programming in shopping cart
     if ($store_products_array === false)
       $store_products_array = array();

     $auction_products_array = $this->internal_get_auction_products();

     return array_merge($auction_products_array, $store_products_array);
   }

   // get total number of items in cart
   function count_contents()
   {
     $count = 0;

     foreach($this->get_products() as $key => $product)
       $count += $product['quantity'];

     return $count;
   }

   function count_auction_contents()
   {
     $count = 0;

     foreach($this->internal_get_auction_products() as $key => $product)
       $count += $product['quantity'];

     return $count;
   }

   function count_store_contents()
   {
     $count = 0;

     foreach($this->internal_get_store_products() as $key => $product)
       $count += $product['quantity'];

     return $count;
   }

   function calculate()
   {
     parent::calculate();

     $auctionProducts = $this->internal_get_auction_products();

     if (is_array($auctionProducts) === false)
       return 0;

     reset($auctionProducts);

     foreach($auctionProducts as $key => $auctionProduct) {

       $qty = $auctionProduct['quantity'];

       //$prid = $product['products_id'];

       $products_tax = tep_get_tax_rate($auctionProduct['tax_class_id']);

       $products_price = $auctionProduct['price'];

       $products_weight = $auctionProduct['weight'];

       $this->total += tep_add_tax($products_price, $products_tax) * $qty;

       $this->weight += ($qty * $products_weight);

     }
   }

 }//end class
?>

Link to comment
Share on other sites

No. It uses its own set of classes. The code for the abxCart where that function is found in the below file:

 

What I would do is take the function count_store_contents() as it is defined in that file:

function count_store_contents()
{
$count = 0;

foreach($this->internal_get_store_products() as $key => $product)
$count += $product['quantity'];

return $count;
}

and add it to admin/order_editor/cart.php. Then you can test it out and see what you get, most likely a similar error identifying another missing function. Add that one in the same manner and continue in this way until the errors dry up. It will take some fiddling with to get it right. You will probably have to mess with the variable names used as well, for instance I don't think $product['quantity'] has any value in the Order Editor cart.php file, I believe it's actually $this->contents[$products_id]['qty'].

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Hi DJ,

 

Yes, this is using AJAX.

 

Cheers,

Max

 

Open admin/edit_orders_ajax.php, find

'" . oe_iconv($_GET['comments'])  . "')");

change it to

'" . tep_db_input(oe_iconv($_GET['comments']))  . "')");

and see if it works any better.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I'm wondering what I need to edit in order to remove the 'total without tax' line from the email.

 

Here's an example:

Price Per Item - $31.77

Total Without Tax - $31.77

Total Including Tax - $31.77

 

Also, what file would I need to edit?

 

Thanks!

Link to comment
Share on other sites

I'm wondering what I need to edit in order to remove the 'total without tax' line from the email.

 

Here's an example:

Price Per Item - $31.77

Total Without Tax - $31.77

Total Including Tax - $31.77

 

Also, what file would I need to edit?

 

Thanks!

 

Find the following code in both edit_orders.php and edit_orders_ajax.php:

	  for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
	$email_order .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n";
  }

 

and edit it to make it exclude any undesired elements; I recommend using the ot_class value of the component to do this. For instance if you wanted to exclude the the subtotal you would change it to

	  for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
  if (strstr($order->totals[$i]['class'], 'ot_subtotal')) continue;
	$email_order .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n";
  }

 

You can find the class value of each component stored in the orders_total table.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Thanks, I'll give it a shot!

 

Find the following code in both edit_orders.php and edit_orders_ajax.php:
	  for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
	$email_order .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n";
  }

 

and edit it to make it exclude any undesired elements; I recommend using the ot_class value of the component to do this. For instance if you wanted to exclude the the subtotal you would change it to

	  for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
  if (strstr($order->totals[$i]['class'], 'ot_subtotal')) continue;
	$email_order .= strip_tags($order->totals[$i]['title']) . ' ' . strip_tags($order->totals[$i]['text']) . "\n";
  }

 

You can find the class value of each component stored in the orders_total table.

Link to comment
Share on other sites

Found the code, if I wanted to just not include that tax reference what would I remove?

 

There is nothing to remove per se. Just follow the instructions that I've posted.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Where would the edit_orders_ajax.php file be located in the admin folder?

 

Yes, that's correct, admin/edit_orders_ajax.php

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I had the order editor installed some time ago and I was thinking to upgrade it but I don't know which version I have installed. Is there a way to find out this info so that I can upgrade correct.

thanx

 

At the top of the file admin/edit_orders.php there should be a line similar to this:

 

$Id: edit_orders.php v5.0.5 08/27/2007 djmonkey1 Exp $

 

where v5.0.5 is the version number. Unfortunately that is not always updated with every revision, but it should give you a fairly good idea of what you have.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I have installed the latest version of this contribution, and if using IE (6 or 7) I get an javascript error when positioning the mouse cursor over the tooltip icon and no tooltips are shown.

 

fehler.gif

 

With Firefox or Opera everything works fine, bur the store management only uses IE.

 

Would be great, if anyone has a solution to fix this problem.

 

BoF

Edited by BoF
Link to comment
Share on other sites

You can back up your database using osCommerce by going to Admin->Tools->Database Backup. I recommend storing the backups locally as well as on the server (ie, keep local backups of your backups).

 

In order to install Order Editor you must be able to modify your database. You should be able to login to your database and access it with a tool such as phpMyAdmin. If necessary ask your webhost how to access your database.

 

Once you have accessed your database, if you are using phpMyAdmin you should see a row of tabs across the top of the right hand frame. One of these tabs should say SQL. Click on that tab; once you are viewing the SQL pane you can copy and paste the entire SQL command into the text box and hit the "go" button. That should be it.

 

Okay thank you so much I do back up my stuff all the time so I will do that. I have that CPanel thing I think that's what you are talking about. Can I mess anything up in there, see I don't know how to really use that thing but I found it following you instructions.

 

Before I copy and paste I just want to know can I mess anything up by doing that?

 

See my husband set my two sites up before he died and I have no idea exactly what he put on here and I sure don't want to mess anything up.

 

Thanks so much for all your help I will await your answer before I do anything here.

 

God Bless

 

Judy

Link to comment
Share on other sites

Okay thank you so much I do back up my stuff all the time so I will do that. I have that CPanel thing I think that's what you are talking about. Can I mess anything up in there, see I don't know how to really use that thing but I found it following you instructions.

 

Before I copy and paste I just want to know can I mess anything up by doing that?

 

See my husband set my two sites up before he died and I have no idea exactly what he put on here and I sure don't want to mess anything up.

 

Thanks so much for all your help I will await your answer before I do anything here.

 

God Bless

 

Judy

 

 

Oh dear well after reading that message about versions........oh dear

$Id: edit_orders.php, v2.5.1 2006/05/09 18:19:44 ams Exp $

 

Now that is what I have already on my server what should I do now?

 

Judy

Link to comment
Share on other sites

Oh dear well after reading that message about versions........oh dear

$Id: edit_orders.php, v2.5.1 2006/05/09 18:19:44 ams Exp $

 

Now that is what I have already on my server what should I do now?

 

Judy

The installation instructions include steps for upgrading from previous versions. Look for this header:

***FOR VERSION 2.3 through v2.9.4 ***

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Okay thank you so much I do back up my stuff all the time so I will do that. I have that CPanel thing I think that's what you are talking about. Can I mess anything up in there, see I don't know how to really use that thing but I found it following you instructions.

 

Before I copy and paste I just want to know can I mess anything up by doing that?

 

See my husband set my two sites up before he died and I have no idea exactly what he put on here and I sure don't want to mess anything up.

 

Thanks so much for all your help I will await your answer before I do anything here.

 

God Bless

 

Judy

 

There are all sorts of things that you can mess up- that's what backups are for. :)

 

Everybody makes mistakes. You'll learn a lot as you go.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

I have installed the latest version of this contribution, and if using IE (6 or 7) I get an javascript error when positioning the mouse cursor over the tooltip icon and no tooltips are shown.

 

With Firefox or Opera everything works fine, bur the store management only uses IE.

 

Would be great, if anyone has a solution to fix this problem.

 

BoF

 

Do you get the error from every tooltip, a few of them, or just one?

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

What I would do is take the function count_store_contents() as it is defined in that file:

function count_store_contents()
{
$count = 0;

foreach($this->internal_get_store_products() as $key => $product)
$count += $product['quantity'];

return $count;
}

and add it to admin/order_editor/cart.php. Then you can test it out and see what you get, most likely a similar error identifying another missing function. Add that one in the same manner and continue in this way until the errors dry up. It will take some fiddling with to get it right. You will probably have to mess with the variable names used as well, for instance I don't think $product['quantity'] has any value in the Order Editor cart.php file, I believe it's actually $this->contents[$products_id]['qty'].

 

THANKS A LOT

 

I put all my files in php5 and ALL IS OK. inconv() OK

 

THANKS A LOT

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...