Jump to content
jhilgeman

NEW! Complete Order Editing Tool!

Recommended Posts

Which browser are you using? Did you try to off the AJAX of Order Editor. If yes, do still have the problem after adding product?

 

Other thing I notice is the payment method. I have only enabled Cash on Delivery & Check/Money order.

I have enabled Drop down for payment in OE Admin. When I select Cash on Delivery, it provides field for Credit card entry in the OE edit page for the order which is something comes up from the OE contribution. I am not sure if this is creating a problem.

Share this post


Link to post
Share on other sites

Yes i tested.. exist a bug that send you to login page.

 

i recreate the process.

 

1. open your browser (crome, firefox)

2. create new order (manual order)

3. add a product that has qtpro feature. (no bug when you add product without attributes)

4. you are redirected to log in page.

5. after you log in again, you can add more products without problem.

 

What I do now is add more products after the first product is added to the cart and OE page goes for a Login. I login after adding all the products and go to OE Page again and click update, all the products get added to the subtotal.

I dont see now my Redeem option after the subtotal which I want to investigate once OE editing works OK.

When I installed 5.0.9c previoualy, the redeem option was available after subtotal.

Share this post


Link to post
Share on other sites

I double check workinng with AJAX in Chrome on my real site. Everithing is working as usual as in Internet Explorer. I found nothing redirections after adding any portion of QT Pro products. It work excellent.

 

Never try OE without AJAX. For what purpouse? Otherwise code is generaly identicall except AJAX part.

 

I use v5.0.7 with my corrections to QT Pro. All code using to correct this is considered to QT Pro only and does not be called if QT Pro support is OFF. No portions of that code may do issues described above.

 

I compare my current code with latest v5.0.9c and found no differences in major logic of OE except support for emails and some additional contribs. That code coud not do above issues too. No special code was added or excluded to support Redeem option.

 

The only difference of 5.0.9c with my is line 20 in edit_orders_ajax.php:

my version:

  header('Content-type: text/html; charset="' . CHARSET . '"', true);

5.0.9c:

  header('Content-type: text/html; charset="' . CHARSET . '"');

I'am no so pro to describe the difference.

 

 

May be issues are come from PHP 5.3. I have no one to test and does not having plans to upgrade.

 

 

Other thing I notice is the payment method. I have only enabled Cash on Delivery & Check/Money order.

I have enabled Drop down for payment in OE Admin. When I select Cash on Delivery, it provides field for Credit card entry in the OE edit page for the order which is something comes up from the OE contribution. I am not sure if this is creating a problem.

There is a setting "Select your credit card payment method" with option "Other". Use it to prevent Credit Card info to show. But there is not a problem to let this field be empty.

Edited by RusNN

Share this post


Link to post
Share on other sites

I double check workinng with AJAX in Chrome on my real site. Everithing is working as usual as in Internet Explorer. I found nothing redirections after adding any portion of QT Pro products. It work excellent.

 

Never try OE without AJAX. For what purpouse? Otherwise code is generaly identicall except AJAX part.

 

I use v5.0.7 with my corrections to QT Pro. All code using to correct this is considered to QT Pro only and does not be called if QT Pro support is OFF. No portions of that code may do issues described above.

 

I compare my current code with latest v5.0.9c and found no differences in major logic of OE except support for emails and some additional contribs. That code coud not do above issues too. No special code was added or excluded to support Redeem option.

 

The only difference of 5.0.9c with my is line 20 in edit_orders_ajax.php:

my version:

  header('Content-type: text/html; charset="' . CHARSET . '"', true);

5.0.9c:

  header('Content-type: text/html; charset="' . CHARSET . '"');

I'am no so pro to describe the difference.

 

 

May be issues are come from PHP 5.3. I have no one to test and does not having plans to upgrade.

 

 

 

There is a setting "Select your credit card payment method" with option "Other". Use it to prevent Credit Card info to show. But there is not a problem to let this field be empty.

 

Thanks. I use IE8. I will add QT Pro Contrib and check again.

I enabled AJAX but found the click update option button not available. So additional items I added could not be updated in subtotal.

When I turned off AJAX, I could see the update button and able to add remaining products to subtotal!!

Share this post


Link to post
Share on other sites

Thanks. I use IE8. I will add QT Pro Contrib and check again.

I enabled AJAX but found the click update option button not available. So additional items I added could not be updated in subtotal.

When I turned off AJAX, I could see the update button and able to add remaining products to subtotal!!

When you use AJAX, you have not UPDATE button, but have a "Add product". Click it. Select a product following be steps and your product with choosen option and quantity will added to your order. After adding of each product totals are updated automatically. You may add as many products as you want and close the window after you add all. I recommend wait until the totals updated after adding befor add another product. All information updated automatically after editing field lost focus.

You also may click on shipping modules and your total updated automatically. After that you may correct the shipping amount.

When adding you personal subtotals, enter the name of subtotal first. After subtotal reloaded enter the price. To delete custom subtotal, clear its name.

 

Using QT Pro is not obligatory.

Edited by RusNN

Share this post


Link to post
Share on other sites

When you use AJAX, you have not UPDATE button, but have a "Add product". Click it. Select a product following be steps and your product with choosen option and quantity will added to your order. After adding of each product totals are updated automatically. You may add as many products as you want and close the window after you add all. I recommend wait until the totals updated after adding befor add another product. All information updated automatically after editing field lost focus.

You also may click on shipping modules and your total updated automatically. After that you may correct the shipping amount.

When adding you personal subtotals, enter the name of subtotal first. After subtotal reloaded enter the price. To delete custom subtotal, clear its name.

 

Using QT Pro is not obligatory.

 

Thanks. What happens with AJAX ON is he 2nd and additional products I have added is seen in the OE Page but not added to subtotal. When I add new product, the first product is added to the subtotal but previous products added after the login page somes in still stays as it is. There is no option to update those.

Only I can add one product at a time, relogin and add one more product which is too time consuming.

When AJAX is off, I can add additional products and click update which corrects the subtotal.

Share this post


Link to post
Share on other sites

It is very strange and unusual. I use OE more than a year and half. Upgraded twice and never had problems like yours. Unfortunatelly solutions to such issues is very hard to find in distance. The problem may be not in OE itself. It might be in other modules, contributes, server settings and so on.

 

By the way. A year or ago same issue was found. No one find a solution, but in post 2908-2909 by phoenix04 describes his solution to this. I have no module free shipping and never use it. Let's try to disable this module and see on results.

Share this post


Link to post
Share on other sites

There is no way to deduct ot_custom (...) For some it is very simple, eg. ot_easy_discount. I do that (...)

 

Hello,

 

Would you be kind eough to post how you did it ?

 

Make OE work again once Easy Discount has been installed ?? Especially with the Daily specials Contrib.

 

 

That would be just great.

 

PS I use OE OE 5.05

 

Thanks a lot and best regards


david

Share this post


Link to post
Share on other sites

Hello,

 

Would you be kind eough to post how you did it ?

 

Make OE work again once Easy Discount has been installed ?? Especially with the Daily specials Contrib.

 

 

That would be just great.

 

PS I use OE OE 5.05

 

Thanks a lot and best regards

Well, I'm not planning to show this to public. First because it may be some special and install this you may get hard to update your OE to next version and may other versions work inaccurrate. Second, because if Jack, the Daily Special founder, may change his code but he would not support this part. And the last, because some changes may or will touch other order totals modules current or future. Some of them begin to work with OE and some may out of work.

 

Otherwise I post my solutionn and will happy if anyone can test and improve it.

 

SO, go on.

 

WARNING!!! I can't test it on OE 5.05. This changes excellent work on 5.0.7 and must work on newer versions. But I can't gues the what's happend on earlier versions.

 

1. in catalog\admin\edit_order.php find

		//this is where we call the order total modules
	require( 'order_editor/order_total.php');
	$order_total_modules = new order_total();
       $order_totals = $order_total_modules->process();  

REPLACE with

		//this is where we call the order total modules
	require( 'order_editor/order_total.php');
	$order_total_modules = new order_total();
   $order_total_modules->prepare_order_total_values(); // RusNN all totals work
   $order_totals = $order_total_modules->process();

 

2. in catalog\admin\edit_order.php find

            if (!strstr($ot_class, 'ot_custom')) { //3
            for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { //4

REPLACE with

            if (!strstr($ot_class, 'ot_custom')) { //3

// RusNN order totals correction for right work BOF
           // Если после расчета модуля нет в списке $order_totals, то его не следует обрабатывать в $_POST['update_totals'],
           // чтобы не было лишних и зависающих значений, когда модуль не выдал значение, итоги посчитались верно, а в списке
           // примененных модулей (и в таблице итогов по заказу) висит число, не пришей рукав
            $found = false;
            for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
              if ($order_totals[$i]['code'] == $ot_class) $found = true;
            }
            if (!$found) continue;
// RusNN order totals correction for right work EOF

            for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { //4

 

3. in catalog\admin\edit_order_ajax.php find

 		//this is where we call the order total modules
	require( 'order_editor/order_total.php');
	$order_total_modules = new order_total();
       $order_totals = $order_total_modules->process();  

REPLACE with

 		//this is where we call the order total modules
	require( 'order_editor/order_total.php');
	$order_total_modules = new order_total();
   $order_total_modules->prepare_order_total_values(); // RusNN all totals work
   $order_totals = $order_total_modules->process(); 

 

4. in catalog\admin\edit_order_ajax.php find

            if (!strstr($ot_class, 'ot_custom')) { //3
            for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { //4

REPLACE with

            if (!strstr($ot_class, 'ot_custom')) { //3

// RusNN order totals correction for right work BOF
           // Если после расчета модуля нет в списке $order_totals, то его не следует обрабатывать в $_POST['update_totals'],
           // чтобы не было лишних и зависающих значений, когда модуль не выдал значение, итоги посчитались верно, а в списке
           // примененных модулей (и в таблице итогов по заказу) висит число, не пришей рукав
            $found = false;
            for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
              if ($order_totals[$i]['code'] == $ot_class) $found = true;
            }
            if (!$found) continue;
// RusNN order totals correction for right work EOF

            for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { //4

 

 

5. in catalog\admin\order_editor\order_total.php BEFORE last

  }
?>

ADD

// RusNN modify to all total modules work - BOF
// Следует учесть, что при использовании иных видов скидок, не только Daily Specials, они так же могут быть удалены!!!
// Данный механизм потребует доработки
   function is_module_installed($module_class) {
     foreach ($this->modules as $value) {
       if (strpos($value, $module_class) !== false) return true;
     }
     return false;
   }

   function prepare_order_total_values() {
     global $order, $cart;

     // требуется большинству модулей
     $GLOBALS['customer_id'] = (int)$order->customer['id'];

     // Enable ot_easy_discount module
     if ($this->is_module_installed('ot_easy_discount') && file_exists(DIR_WS_CLASSES . 'easy_discount.php')) {
       require_once(DIR_WS_CLASSES . 'easy_discount.php');
       $easy_discount = new easy_discount();

       $GLOBALS['easy_discount'] = &$easy_discount;

       require_once(DIR_WS_FUNCTIONS.'daily_specials_ot.php');

       $dsClear = true;

       if (DAILY_SPECIALS_ENABLE == 'true') {
          $ds_query = tep_db_query("select * from " . TABLE_DAILY_SPECIALS . " where date_start <= current_date() and date_stop >= current_date() and ( language_id = 99 or language_id = '" . (int)$languages_id . "')");

          if (tep_db_num_rows($ds_query) > 0)
          {
             $amt = 0;
             while ($ds = tep_db_fetch_array($ds_query))
             {
               $comparison = CheckConditions($ds, $cart, $amt);
               switch ($ds['condition1'])
               {
                  case TEXT_COUPON_CONDITION_CART_TOTAL:
                     if ($comparison)
                     {
                         $easy_discount->set('DS_CTTL',$ds['special_name'], $amt);
                         $dsClear = false;
                     } else {
                         $easy_discount->clear('DS_CTTL'.$ds['special_name']);
                     }
                     break;

                  case TEXT_COUPON_CONDITION_CART_QTY:
                     if ($comparison)
                     {
                         $easy_discount->set('DS_CQTY'.$ds['special_name'],$ds['special_name'],$amt);
                         $dsClear = false;
                     } else {
                         $easy_discount->clear('DS_CQTY'.$ds['special_name']);
                     }
                     break;
                  default:  //just displaying a banner //echo 'ERROR: No definition found -> '. $ds['condition1'];
               }
             }
          }
       }

       if ($dsClear) {
         if ($easy_discount->count() > 0)
         {
             $easy_discount->clear('DS_CTTL', true);
             $easy_discount->clear('DS_CQTY', true);
         }
       }
     } // ot_easy_discount
   }
// RusNN modify to all total modules work - EOF

 

 

6. CREATE A NEW FILE in catalog\admin\includes\functions\ and call them daily_specials_ot.php. This is a copy of daily_specials.php in client side with a very little modification. You may compare those files to anderstand the differrence. Text of the file:

<?php
/*
 $Id: daily specials, v 1.1 2009/09/01 by Jack_mcs

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce
 Portions Copyright 2009 oscommerce-solution.com

 Released under the GNU General Public License
*/

 /*************************************************************/
 /************ CHECK IF SPECIFIC CATEGORIES ARE USED **********/
 /*************************************************************/
 function CheckCategories($categoryArray, $productsArray)
 {
    $workArry = array('price' => 0, 'qty' => 0); //preset for return if none found

    foreach ($productsArray as $product)
    {
        $path = tep_get_product_path($product['id']);
        $parts = explode('_', $path);
        $cID = $parts[count($parts) - 1];
        $cats = explode(",", $categoryArray);

        if (in_array($cID, $cats))
        {
           $workArry['price'] += $product['final_price'] * $product['quantity'];
           $workArry['qty'] += $product['quantity'];
        }
    }

    return $workArry;
 }

 /*************************************************************/
 /******************** PREPARE THE CONDITIONS *****************/
 /*************************************************************/
 function CheckConditions($ds, $cart, &$amt)
 {
    $forceZero = false;
    $workArry = CheckProducts($ds['products_list'], $cart->get_products()); //check if special is for products

    if ($workArry['price'] == 0)      //nope
    {
       if (! tep_not_null($ds['products_list'])) //no products are set so check categories
       {
          $workArry = CheckCategories($ds['categories'], $cart->get_products()); //check if special is for categories

          if ($workArry['price'] == 0)      //nope
          {
             if (! tep_not_null($ds['categories'])) //no categories are set
             {
                $workArry['price'] = $cart->show_total(); //no products or categories are set so get the full total
             }
             else
                $forceZero = true;
          }
       }
       else
          $forceZero = true;
    }

    if (strpos($ds['coupon_amount'], '%') === FALSE)
       $amt = $ds['coupon_amount'];
    else
       $amt = $workArry['price'] * ($ds['coupon_amount'] / 100);

    if (tep_not_null($ds['condition1']) && tep_not_null($ds['condition2']) && tep_not_null($ds['condition3']))
    {
       $cond = ($ds['condition1'] == TEXT_COUPON_CONDITION_CART_QTY) ? sprintf("%d", (($workArry['qty'] > 0 && ! $forceZero) ? $workArry['qty'] : (($forceZero) ? 0 : $cart->count_contents()))) : sprintf("%d", (($workArry['price'] > 0 && ! $forceZero) ? $workArry['price'] : (($forceZero) ? 0 : $cart->show_total())));
       $oper = ($ds['condition2'] == TEXT_COUPON_CONDITION_EQL) ? " == " : " > ";
       $cmpamt = $ds['condition3'];
       $doit = ($amt > 0) ? '&& 1' : '&& 0'; //enable/disable based on discount

       return (tep_not_null($cmpamt) ? eval('return '.$cond.' '.$oper.' '.$cmpamt . ' ' . $doit .';') : 0);
    }
    return 0;
 }

 /*************************************************************/
 /************ CHECK IF SPECIFIC PRODUCTS ARE USED ************/
 /*************************************************************/
 function CheckProducts($productsList, $productsArray)
 {
    $workArry = array('price' => 0, 'qty' => 0); //preset for return if none found

    if (tep_not_null($productsList))
    {
       foreach ($productsArray as $product)
       {
           $parts = explode(',', $productsList);

           if (($pos = strpos($product['id'], "{")) !== FALSE)
              $product['id'] = substr($product['id'], 0, $pos); //remove attributes

           if (in_array($product['id'], $parts))
           {
              $workArry['price'] += $product['final_price'] * $product['quantity'];
              $workArry['qty'] += $product['quantity'];
           }
       }
    }

    return $workArry;
 }

 /*************************************************************/
 /***** CHECK IF THIS PAGE SHOULD SHOW THE DAILY SPECIAL ******/
 /*************************************************************/
 function IsPageEnabled($pages, $languageName)
 {
   if (! tep_not_null($pages))
      return true;

   $ctr = 0;
   $currentPage = basename($_SERVER['PHP_SELF']);  //what page is showing
   $pageArray = array();
   $pageArray = explode(",", $pages);
   $path = DIR_WS_LANGUAGES . $languageName . '/';
   $pathLength = strlen($path);
   $aFiles = glob($path . '*.php*');               //get all files

   foreach ($aFiles as $file)
   {
      if (in_array($ctr, $pageArray))
      {
         $filename = substr($file, $pathLength);   //get filename
         if ($filename === $currentPage)           //found a match
            return true;
      }
      $ctr++;
   }

   return false;
 }

 /*************************************************************/
 /*********** CHECK IF THIS SPECIAL IS IN TEST MODE ***********/
 /*************************************************************/
 function OKToContinue($test_mode, $customer_id)
 {
    if (! $test_mode)
       return true;

    if ($customer_id > 0)
    {
       $cust_query = tep_db_query("select customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = " . (int)$customer_id . " limit 1");
       if (tep_db_num_rows($cust_query) > 0)
       {
          $cust = tep_db_fetch_array($cust_query);
          if ($cust['customers_email_address'] === STORE_OWNER_EMAIL_ADDRESS)
             return true;
       }
    }

    return false;
 }
?>

 

7. in catalog\admin\includes\functions\general.php at the very and BEFORE last ?> ADD

////
// Recursively go through the categories and retreive all parent categories IDs
// TABLES: categories
 function tep_get_parent_categories(&$categories, $categories_id) {
   $parent_categories_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$categories_id . "'");
   while ($parent_categories = tep_db_fetch_array($parent_categories_query)) {
     if ($parent_categories['parent_id'] == 0) return true;
     $categories[sizeof($categories)] = $parent_categories['parent_id'];
     if ($parent_categories['parent_id'] != $categories_id) {
       tep_get_parent_categories($categories, $parent_categories['parent_id']);
     }
   }
 }

////
// Construct a category path to the product
// TABLES: products_to_categories
 function tep_get_product_path($products_id) {
   $cPath = '';

   $category_query = tep_db_query("select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int)$products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id limit 1");
   if (tep_db_num_rows($category_query)) {
     $category = tep_db_fetch_array($category_query);

     $categories = array();
     tep_get_parent_categories($categories, $category['categories_id']);

     $categories = array_reverse($categories);

     $cPath = implode('_', $categories);

     if (tep_not_null($cPath)) $cPath .= '_';
     $cPath .= $category['categories_id'];
   }

   return $cPath;
 }

 

Seems that's all.

 

-----------

INSTRUCTION

After you create your order through Manual Order contrib you get your order totals as usual. Add a product to an order and your totals will updated. Your Easy Discount should be deducted automatically.

 

WARNING!!!

After totals updeted some other totals such as ot_gv, ot_redeem, ot_coupon will be LOST! This is because we do steps 2 and 4 of installation. This totals are not updated automatically and prevent themself to manually enter amount after product added. So they are unnecesssary. If you need them, undo steps 2 and 4. But if you do that, your easy discount will present in the order in some cases, but not deducted. So you every time will have right totals, but you deal with a stick: one side old easy discount present (but not deducted if it can't be applicated) in the order and other side - some unmodified order totals modules will go out of the order (and easy discount too if it can't be applicated).

 

WARNING!!!

If you use easy_discount class without Daily Specials there may be collisions or malfunctions or right work or nothing. Not tested in this way.

 

WARNING!!!

If you get message HEADERS ALREADY SENT.... during updating totals, you must check all files, including daily_specials_ot.php for no leading spaces before the very first <?php clause and trailing spaces after very last ?>

 

-----------

INTEGRATION with other order totals module.

If you want to integrate with other simple modules that can deducted automatically, not ot_gv, ot_redeem, ot_coupon you need to add code into funtion prepare_order_total_values() in catalog\admin\order_editor\order_totalls.php like I do it for Daily Specials. A number of contribs will now work automatically, like ot_loyalty_discount, because all they need to work is global variable $customer_id (see funtion prepare_order_total_values()).

Share this post


Link to post
Share on other sites

Well, I'm not planning to show this to public. First because it may be some special and install this you may get hard to update your OE to next version and may other versions work inaccurrate. Second, because if Jack, the Daily Special founder, may change his code but he would not support this part. And the last, because some changes may or will touch other order totals modules current or future. Some of them begin to work with OE and some may out of work.

 

Otherwise I post my solutionn and will happy if anyone can test and improve it.

 

SO, go on ... (...)

 

Hello,

 

Really, thanks a lot !

 

Unfortunately even after install, when updating an order, I can not get further than this error message:

 

Fatal error: Call to a member function count() on a non-object in includes/modules/order_total/ot_easy_discount.php on line 17

 

To update any order it is necessary to uninstall the easy discount contrib :(

 

I have looked at the daily special forum where this error is reported but .. no solution yet. http://forums.oscommerce.com/topic/349666-daily-specials/page__view__findpost__p__1516750

 

Would you know why this function count() is not seen by OE

 

Best regards


david

Share this post


Link to post
Share on other sites

DAMN!!!

I'm sorry David. That's my fault! I forgot one step. Of cource it was not work. It can't work without main class!!!

 

STEP 8. Copy file catalog\includes\classes\easy_discount.php to catalog\admin\includes\classes.

 

And the last complex warning!!!

OE shopping cart has a great bug when deal with attributes, products weight and attributes weight. So some shipping modules dealing with weight gives incorrect results.

Edited by RusNN

Share this post


Link to post
Share on other sites

DAMN!!!

I'm sorry David. That's my fault! I forgot one step. Of cource it was not work. It can't work without main class!!!

 

STEP 8. Copy file catalog\includes\classes\easy_discount.php to catalog\admin\includes\classes.

 

And the last complex warning!!!

OE shopping cart has a great bug when deal with attributes, products weight and attributes weight. So some shipping modules dealing with weight gives incorrect results.

 

Hey ! Works like a charm now, it seems at least so far.

 

Thanks so much !!! I ll test this integration of easy discount, daily specials in order editor,

but as non programmer I will not be able to say much except maybe report possible errors on my side.

 

Best regards


david

Share this post


Link to post
Share on other sites

Sounds good! I appreciate your are like it!

Please contact me if you have any issues.

Share this post


Link to post
Share on other sites

Have a slight issue in admin/edit_orders.php?

 

I have SPPC installed, enabled the function in config to use SPPC with edit orders and allow Ajax to update

However, I created myself as trade and when editing a order and adding additional products the price remains at retail

 

Please help, any help


Getting the Phoenix off the ground

Share this post


Link to post
Share on other sites

Have a slight issue in admin/edit_orders.php?

 

I have SPPC installed, enabled the function in config to use SPPC with edit orders and allow Ajax to update

However, I created myself as trade and when editing a order and adding additional products the price remains at retail

 

Please help, any help

I'd like to help you, but I have no SPPC yet and never use it. May be in future I need it then a bug will be resolved.

Share this post


Link to post
Share on other sites

Hi Rusnn

 

This is a great contrib but because of my lack of knowlege I have a stupid question.

 

When you say. WARNING!! The additional field present in the SQL, don't miss it!

 

Do you mean I have to install something into mysql?

 

ATM I get an error

 

1136 - Column count doesn't match value count at row 1

 

insert into products_attributes values (null, '1', '3', '4', '0', '+')

 

[TEP STOP]

 

 

When I try to add a new attribute. Is this the problem?

 

 

Sorry if somone posted this already I did search but there is a lot of history.

Share this post


Link to post
Share on other sites

Hi Rusnn

 

This is a great contrib but because of my lack of knowlege I have a stupid question.

 

When you say. WARNING!! The additional field present in the SQL, don't miss it!

 

Do you mean I have to install something into mysql?

Somebody like me :) not copy and paste full instrctions, because they have highly modified store. They copy only new part and insert only modified lines. There will be a one more line in the code above that instruction. So, if you have QT Pro intalled, you need nothing to to your database. If you have no QT Pro you must not install this fixes.

 

To solve TEP STOP error you should exactly know the place in code where the error appears. Than check the SQL and columns in products_attributes table. Thay should be in right order and quantity. Now it sounds, like your products_attributes table doesn't have some columns.

Share this post


Link to post
Share on other sites

Ok I have figured it out.

 

I tried importing my customers from old database and imported attributes too :blush: , causing this error.

 

Thanks for your help and quick responce.

Share this post


Link to post
Share on other sites

hi guys im having a little trouble, this addon was working fine now i have just noticed, that when i edit an order the and recheck the order screen the sub-total delivery etc all disapear the values are still there but the rest dissapear.

 

when i goto edit the order in the order totals area it has <B><span style= in the box instead of it saying subtotal etc etc. so when i click update it removes those from the order part lol

 

hope that makes sence. its prob a cross reference somewhere but i dont know where to begin looking.

Share this post


Link to post
Share on other sites

hi guys im having a little trouble, this addon was working fine now i have just noticed, that when i edit an order the and recheck the order screen the sub-total delivery etc all disapear the values are still there but the rest dissapear.

 

when i goto edit the order in the order totals area it has <B><span style= in the box instead of it saying subtotal etc etc. so when i click update it removes those from the order part lol

 

hope that makes sence. its prob a cross reference somewhere but i dont know where to begin looking.

Not exactly clear. I know the problem with some order_total modules, they stay present in the totals list, but take no effect on Total. If I guess right (I'm not sure), you should install my fix posted here and forgotten step 8 here. But don't do it if you not sure what are you doing. Carefully read instructions and warnings and tr to understand them.

Share this post


Link to post
Share on other sites

Please help me .. I've got this module running 100% and now installed the MVS addon.

 

The MVS add a product requires a Vendors_id field to be added to the order of the product when the product is added to an order.

 

now that's a mouth full...

 

So what i need... when I manually create an order i need to call the vendors_id from the product info and add it to the orders_product table... but that's where my knowledge ends....

 

I've tried to edit the edit_orders_add_product to do this without any luck ... any advise would be appreciated. Thank you!

Share this post


Link to post
Share on other sites

Please help me .. I've got this module running 100% and now installed the MVS addon.

 

The MVS add a product requires a Vendors_id field to be added to the order of the product when the product is added to an order.

 

now that's a mouth full...

 

So what i need... when I manually create an order i need to call the vendors_id from the product info and add it to the orders_product table... but that's where my knowledge ends....

 

I've tried to edit the edit_orders_add_product to do this without any luck ... any advise would be appreciated. Thank you!

I never use MVS and does not know how it is work. You sad MVS adds a vendor_id to orders_product table... If this is only a field than you should edit only one edit_orders_add_product.php file. Seems pretty simple.

 

1. FIND around line 89

        $product_query = tep_db_query("select p.products_model, p.products_price, pd.products_name, p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id where p.products_id = '" . (int)$add_product_products_id . "' and pd.language_id = '" . $languages_id . "'");

and REPLACE with

        $product_query = tep_db_query("select p.products_model, p.vendor_id, p.products_price, pd.products_name, p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id where p.products_id = '" . (int)$add_product_products_id . "' and pd.language_id = '" . $languages_id . "'");

Only vendor_id is added to the query.

 

2. FIND around line 158

                                'products_model' => tep_db_prepare_input($product['products_model']),

and INSERT BEFORE

                                'vendor_id' => tep_db_prepare_input($product['vendor_id']),

 

If vendor_id only a field to add that's all. But I can't test my solution except as hypothetically. I don't know in what table the vendor_id is placed. If it is in table PRODUCTS that must work, if table is different... well, let me know, I'll try to see Multi Vendor System SQL.

Share this post


Link to post
Share on other sites

I never use MVS and does not know how it is work. You sad MVS adds a vendor_id to orders_product table... If this is only a field than you should edit only one edit_orders_add_product.php file. Seems pretty simple.

 

1. FIND around line 89

        $product_query = tep_db_query("select p.products_model, p.products_price, pd.products_name, p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id where p.products_id = '" . (int)$add_product_products_id . "' and pd.language_id = '" . $languages_id . "'");

and REPLACE with

        $product_query = tep_db_query("select p.products_model, p.vendor_id, p.products_price, pd.products_name, p.products_tax_class_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id where p.products_id = '" . (int)$add_product_products_id . "' and pd.language_id = '" . $languages_id . "'");

Only vendor_id is added to the query.

 

2. FIND around line 158

                                'products_model' => tep_db_prepare_input($product['products_model']),

and INSERT BEFORE

                                'vendor_id' => tep_db_prepare_input($product['vendor_id']),

 

If vendor_id only a field to add that's all. But I can't test my solution except as hypothetically. I don't know in what table the vendor_id is placed. If it is in table PRODUCTS that must work, if table is different... well, let me know, I'll try to see Multi Vendor System SQL.

 

Thanks, this one works like a charm, field now updated... However my problem isn't resolved. I'll troubleshoot further. Thanks again!!!

Share this post


Link to post
Share on other sites

ok... i need more help .. more php based than this topic but it is integrate my MVS and Order editor...

 

In edit_products_add I added this section and it now works however, now every time I add a product this field is pupulated, thus creating multiple records and duplicating reporting and notifications.

 

What I'd like it to do is check the table for matching records (if orders_id = &oID and vendors_id = vendors_id do nothing else run the below) I'd appreciate some help, Thanks!

 

$sql_data_array2 = array('orders_id' => tep_db_prepare_input($oID),

'vendors_id' => tep_db_prepare_input($product['vendors_id']));

tep_db_perform(TABLE_ORDERS_SHIPPING, $sql_data_array2);

 

$new_product_id = tep_db_insert_id();

Share this post


Link to post
Share on other sites

ok... i need more help .. more php based than this topic but it is integrate my MVS and Order editor...

 

In edit_products_add I added this section and it now works however, now every time I add a product this field is pupulated, thus creating multiple records and duplicating reporting and notifications.

 

What I'd like it to do is check the table for matching records (if orders_id = &oID and vendors_id = vendors_id do nothing else run the below) I'd appreciate some help, Thanks!

 

$sql_data_array2 = array('orders_id' => tep_db_prepare_input($oID),

'vendors_id' => tep_db_prepare_input($product['vendors_id']));

tep_db_perform(TABLE_ORDERS_SHIPPING, $sql_data_array2);

 

$new_product_id = tep_db_insert_id();

It is not clear what you nt. Please, explain a bit more and sorry may bad English.

 

You want to store vendor_id only once for an order for any number of products? Or has MVS another table for store orders and you want to store vendor_id in it? When should this information be recorded? As I understand it should be stored after ALL products have been added. But does vendor_id not different to each product? If I am right it will be tricky. Need testing and installing MVS. So takes more time. In other case I'm afraid sulution may not work.

Share this post


Link to post
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

×