Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

Because I would like to show the published rate(which is the standard rate)instead of discounted rate, I checked the code and it shows "$data .= '1529,"1"'; // Quote discounted rates".

 

I changed 1 to 0, but seems I guess wrong, so how could I turn the discount rate off?

 

Thanks.

Link to comment
Share on other sites

Hi I have MVS in my site and everything works fine, except for recently those checking out with a particular vendor always were paying express, even when choosing an alternate shipping option @ check out, I resolved this by getting rid of express, now it will only pick first class and not priority, same routine even if wanting another usps option, though if you pick ups, etc your fine. I have found a thread saying to upgrad to usps methods, but I know there are special changes made to the mvs usps.php file can someone help me with this delima.

 

Thanks!

Link to comment
Share on other sites

Hi there,

 

I´m currently implementing a stockless vinery-shop with multiple vintners. So far so good.

But when trying to make a test order,i encounter some problems with sending the vendor e-mail.

Though i enabled vendor-shipping and having a contact as well as an e-mail adress in the vendors specifics, and adjusting the e-mail send trigger to catalog i don t receive an order e-mail.

Even when i try to manually send an e-mail order i get a pink message at the top saying "contact" which is quite well, not very clarifying.

 

Did anybody of you encounter the same problem as me, and found a solution?

If yes I´d be grateful to hear it.

 

Ty in advance.

 

Bazzi

Link to comment
Share on other sites

Hi I have MVS in my site and everything works fine, except for recently those checking out with a particular vendor always were paying express, even when choosing an alternate shipping option @ check out, I resolved this by getting rid of express, now it will only pick first class and not priority, same routine even if wanting another usps option, though if you pick ups, etc your fine. I have found a thread saying to upgrad to usps methods, but I know there are special changes made to the mvs usps.php file can someone help me with this delima.

 

Thanks!

You can modify the USPS Methods module to work with MVS. There are instructions for modifying modules in the MVS distribution.

 

I believe that USPS changed their interface recently, and the MVS module was not modified to the new standard. You might try comparing the MVS version in the distribution to the latest download of USPS. The sections not marked with //MVS are fair game.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Im trying to integrate it with other contributions Suppliers V2 and HTLM emailV2.

 

Im using 2 types of checkout proceses.

One (checkout_shipping.php) with the MVS contribution to process "urgent ships" from the vendor to the customer. And a second (checkout_shipping2.php) to process the "clasic metod" for orders sent from my fisical shop.

But I have issues that i cant resolve.

Using the checkout_shiping2.php "clasical" the email arrives to my customer white (without products), the total and delivered adreses are OK.

 

Using "MVS" checckout_process.php all works fine. The email arrives to may vendor right. Except for my customer , all right except the product option atributes. There are not optiones, al blank. ¿?

 

Im was changing ode on the checkout_process.php but i dont know were is the problem. Im thinking on remove the HTML emailV2 contrib.

 

Other problem is with the Send "HTML email to the vendor" page. When click to send , nothing happens and error line on top with "Contact" word appears on top.

 

¿can anyone help me?

Link to comment
Share on other sites

// MVS Start
 if (SELECT_VENDOR_SHIPPING == 'true') {
?>

function selectRowEffect(object, buttonSelect, vendor) {

 var test='defaultSelected_' + vendor;//set aside defaultSelected_' . $vendor_id . '
 var el=document.getElementsByTagName('tr');//all the tr elements
 for(var i=0;i<el.length;i++){
   var p=el[i].id.replace(test,'').replace(/\d/g,'');//strip the $radio_buttons value
   if(p=='_'){//the only thing left is an underscore
     el[i].className = "moduleRow";//make the matching elements normal
   }
 }

 object.className = "moduleRowSelected";//override el[i].className and highlight the clicked row

 var field = document.getElementById('shipping_radio_' + buttonSelect + '_' + vendor);
 if (document.getElementById) {
   var field = document.getElementById('shipping_radio_' + buttonSelect + '_' + vendor);
 } else {
   var field = document.all['shipping_radio_' + buttonSelect + '_' + vendor];
 }
}

<?php 
 } else { 
// MVS End
?>

 

One more thing, when a customer arrives to checkout_shipping.php , it displays default shipping options. I want NOTHING SELECTED on the forms. Do anyone kwows how to modify the above code??

 

and add some type of button "All items in only one shipping"???

Link to comment
Share on other sites

You can only have one checkout_shipping.php. There are security measures in the cart to prevent hacking; these will defeat most attempts at substituting a different file. I don't understand why you would do this, so I can't offer any advice on how to work around it.

 

There is an HTML vendor email option available for MVS. Check the downloads area and a couple of pages back in this thread for the discussion.

 

The default options are supplied by checking $shipping->cheapest(). Removing the check should be simple. This will confuse and irritate your customers. Is that your goal?

 

How are you going to ship all items in one package when they are coming from different locations?

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Thanks for the replay Kymation.

You can only have one checkout_shipping.php

No, im working with two checkout_shipings and working.

 

shopping_cart.php---> [bUTTOM NORMAL SHIPPING-STANDARD]----> checkout_shiping.php ---> checkout_payment.php ---> checkout_confirmation.php --->*checkout_process.php ----> checkout_success.php

[bUTTOM URGENT SHIPPING-MVS]---------> checkout_shiping2.php ---> checkout_payment2.php ---> checkout_confirmation2.php --->*checkout_process2.php ----> checkout_success.php

 

Modified same files and renamed to *2.php

and then in includes/filenames.php

 

// BOF Normal Ship + CCC + Html EmailV2
 define('FILENAME_CHECKOUT_SHIPPING', 'checkout_shipping.php');
 define('FILENAME_CHECKOUT_PAYMENT', 'checkout_payment.php');
 define('FILENAME_CHECKOUT_CONFIRMATION', 'checkout_confirmation.php');
 define('FILENAME_CHECKOUT_PROCESS', 'checkout_process.php');
 define('FILENAME_CHECKOUT_SUCCESS', 'checkout_success.php');
// EOF Normal Ship + CCC + Html EmailV2


// BOF MVS Ship + CCC + Html EmailV2
 define('FILENAME_CHECKOUT_SHIPPING2', 'checkout_shipping2.php');
 define('FILENAME_CHECKOUT_PAYMENT2', 'checkout_payment2.php');
 define('FILENAME_CHECKOUT_CONFIRMATION2', 'checkout_confirmation2.php');
 define('FILENAME_CHECKOUT_PROCESS2', 'checkout_process2.php');
 define('FILENAME_CHECKOUT_SUCCESS2', 'checkout_success2.php');
// EOF MVS Ship + CCC + Html EmailV2

 

In configuration:

Shiping/packaging> Enable Multi-Vendor shipping-(true/false) = FALSE

 

Finally in checkout_shipping2.php change the conditions to:

if (SELECT_VENDOR_SHIPPING == 'false') {

 

 

ref:

There is an HTML vendor email option available for MVS...

The orders customers made arrives right to my vendors, and the order confirmation to my customers.

If you are referring to admin/vendor_email_send.php?&vID=6&oID=179&vOS=no

that doesnt work for me. I fill the textarea but when clincking on "SEND" gets an error that says Contact on red on the top.

This will confuse and irritate your customers. Is that your goal?

Yeah, Im was thinking on create or modify a shipping module to all the vendors. "Wait to send all items from the Central Store", except for my fisical shop and add an option to this "Send all items from this Store" (by default the contribution identifies your shop as other vendor .... INSERT INTO `vendors` VALUES (1, 'Store Owner', 'My Store', ....)

 

How are you going to ship all items in one package when they are coming from different locations?

My idea is to have 2 shippings methods. Using MSV is very fast, and if a customer makes an order at night my vendor have the order at first time afternoon. When i arrive at work i have the order half-made.

Here is a problem, that using diferent shipping methods the final price is higher to my customers and they fly away to other shops on the net. For that, I suggest to maintain the clasical shipping method as an alternative, when customers select this the vendors send the products to my shop(not to the customers) and then i send all the products to my customers in only one shipping. Also some vendors dont ships to final customers, they only work with distributors.

 

Do you understand what im trying?

Link to comment
Share on other sites

Your includes/filenames.php will not work. You can only define a constant once. The second definition will be ignored and a warning message will be logged. Given this, your system is not working. If you have some code in there to select which set of definitions to apply, then this might work. It still seems to be at odds with your statement that you will provide a choice of both MVS and standard store shipping, unless that choice is made at the time the customer clicks the checkout button in the cart. They will then never see the other shipping price(s).

 

I was referring to the automatic vendor email sent by MVS. I have no idea why the manual version is not working. HTML email in osCommerce has never worked properly. It usually requires some modification. Since MVS uses the stock osCommerce tep_mail() function, it has the same problems with HTML.

 

I understand what you're doing with the single shipment, but you are going to have to do a lot of work to make it functional. MVS splits all of the order data out by vendor. You'll need to recombine all of that information and run the shipping quote again. I still think that your customers will be upset by the slow shipping, even if you are very clear about the reason for the additional delay. Your choice.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Your includes/filenames.php will not work

Now is working. I have two buttons on shopping_cart.php. At Bottom of shopping_cart page is the shiping_estimator contrib(for the standard shipping) A customer can click the MVS button and look forward for the prices (checkout_shiping2.php) and then come back to the shopping_cart page and select the normal method (checkout_shiping.php), or delete products of some vendors to reduce the total shippings.

 

I dont know if using this mod could be dangerous to the security. The code of all files is the same , except in some cases changing some words , for example -tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); - for -tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT2, '', 'SSL'));

 

The objetive is to finish right the order without errors.

 

a warning message will be logged

I have on application_top this set:

 

// set the level of error reporting
//   error_reporting(E_ALL & ~E_NOTICE);

 

I was referring to the automatic vendor email sent by MVS

Yes, that works fine and for that this contrib is incredible for me. A 10/10 for you kymation. :thumbsup:

 

 

I have no idea why the manual version is not working

For the moment is no problem . Im triyng with other contrib. Order_manufacturer_pdf by Audioshop. the problem this is send all items in pdf to only one vendor.

 

For the standard shipping im using Jim´s contrib Suppliers v22

 

I have this on my admin/catalog/edit product.

On top Manufacturers and product name

then Jim Suppliers V2

then MVS Select Box

finally the rest.

 

First I look for the cheapest price in the Suppliers Vendors Tab and then change the Vendor in the MVS Box.

 

All is working well except as I said before, the options of the product orders_products_attributes dont appear on the email taht receive my customer. Also in admin/orders are blank. This only ocurred with MVS. Using the standard shipping there is no problem.

Link to comment
Share on other sites

They will then never see the other shipping price(s).

 

SHIP_ESTIMATOR_BUTTON_PRODUCTS_INFO', 'false', 'Show the Shipping Estimator button on the Products Info page',
'SHIP_ESTIMATOR_BUTTON_SHOPPING_CART', 'false', 'Show the Shipping Estimator button on the Shopping Cart page',
'SHIP_ESTIMATOR_BUTTON_CART_BOX', 'false', 'Show the Shipping Estimator button in the Shopping Cart box', 

 

I have those options to false, because clicking the buttons gets the normal shipings.

 

I only have a button on shopping_cart.php with this:

 

<td align="right" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING2, '', 'SSL') . '">' . tep_image_button('button_checkout2.gif', IMAGE_BUTTON_CHECKOUT2) . '</a>'; ?></td>

 

 

 

if you are very clear about the reason for the additional delay

With the MVS- 12h-24H to arrive to my customer, but more money sure.

With the Normal Ship - 2-3days to arrive, less money.

 

For only one item, for example a 50" LCD Screen of 900€, to my customer will be interesting to select the MVS option.

 

But if select a blank dvds(12€) for one vendor, the dvd-writer(29€) from other vendor, and for example a 160GB hard disk(36€) from the third one, probably will be the ruin for him. He should pay 3 x shippings methods and of courde he never buy.

Link to comment
Share on other sites

  • 2 weeks later...

New question,

 

there is a contribution named: Vendor_Auto_E-mail (In_Development)

http://addons.oscommerce.com/info/2196

 

What is the purpouse of this???.

 

I need to send an e-mail to an specific vendor "after a cusotmer has purchased and you have received payment confirmation from your payment processor".

A button to send a copy/confirmation of the products to ship.

 

Like this contribution Order confirmation email text http://addons.oscommerce.com/info/3115

but sending it to vendor with the especific products asigned to it.

Link to comment
Share on other sites

Yeah, that seems to me. Because replacing the code was the same.

 

Need to fix:

1. A button to send to the vendor a copy of the order (only with the products assigned to it and after a customer makes the payment).

2. PDF invoice for admin. Doesnt work. All items white (empty).

3. A form to send all items from only one Shop with a unique price.

4. The atributions and options dont appear after the order.

 

 

Please Jim, work hard!!! :D

Link to comment
Share on other sites

1. Stock feature of MVS.

2. Not part of MVS. There is a PDF addon, but it will need to be modified to work with MVS.

3. What? I don't understand this.

4. Where? What page?

 

Remember that MVS is provided as is. If you find a bug, post the information here that is needed to reproduce it. If the information is not adequate to reproduce the bug, I can't find it. I can't fix something that I cannot find.

 

If you need a feature that is not in MVS, and cannot be provided by another addon in conjunction with MVS, it is not my job to provide it for you. It's up to you to make this new feature work. If yo can't do it, you may need to hire someone to do it for you.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

it is not my job to provide it for you.

I dont say you "must" provide to us. Im grateful wich you for your time Jim.

 

I sugested, as you are working on this contribution, you could add new features in a future like the ones I descrived before.

 

 

1. Stock feature of MVS.

Its incredible but now works (orders_by_vendor.php). I modified something and now its working.

In the order, the link also works but doesnt update. ref: "Email send to vendor: No."

 

2. Not part of MVS. There is a PDF addon, but it will need to be modified to work with MVS.

ok. I will try to modify it soon.

 

3. What? I don't understand this.

In checkout_shipping.php a form to select the main shop (ref:INSERT INTO `vendors` VALUES (1, 'Store Owner', 'My Store') and skip the others. And then in checkout_confirmation.php if this condition is tru, not to send any email to the vendors.

 

4. Where? What page?

The product attributes (products_attributes.php) dont appear in orders.php or edit_orders.php after a customer finishes the order.

Link to comment
Share on other sites

3. You are the only person who wants this, so it's up to you.

 

4. This works everywhere I've used MVS. Check your admin for errors; you've missed something.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

4. This works everywhere I've used MVS. Check your admin for errors; you've missed something.

 

I dont know why dispear.

 

these codes:

account_history_info.php

 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
 if ($order->products[$i]['model'] == "Custom"){
   echo '          <tr>' . "\n" .
        ' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . 'x</td>' . "\n" .
        ' <td class="main" valign="top">' . $order->products[$i]['name'] . '<small><i>' . $order->products[$i]['description'] . '</small></i>';
            }else{
   echo ' <tr>' . 
        ' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . 'x</td>' . "\n" . 
        ' <td class="main" valign="top">' . $order->products[$i]['name'];
    }


   if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
     for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
       echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
     }
   }

 

admin/orders.php

<?php
   for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
   if ($order->products[$i]['model'] == "Custom"){
   echo ' <tr class="dataTableRow">' . 
        ' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . 'x</td>' . "\n" . 
        ' <td class="dataTableContent" valign="top">' . $order->products[$i]['name'] . '<small><i>' . $order->products[$i]['description'] . '</small></i>';
        $custom_computer="1";
   }else{
   echo ' <tr class="dataTableRow">' . 
        ' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . 'x</td>' . "\n" .
        ' <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];
   }

     if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
       for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
         echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
         if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
         echo '</i></small></nobr>';
       }
     }

 

Contrib installed:

Custom Computer Creator (this works because the options are a description)

Custom Product Builder

 

Quick atributes

Ajax Atribute Manager

Attribute Sorter and Copier v.6

Attribute Sort with Attribute Clone

 

The atributes are working well.

Also when a customer receives the confirmation email all atributes are right.

 

Looking in the database orders_products_attributes

in the orders_products_id all files are with number 0. ¿?

Link to comment
Share on other sites

The customer confirmation email is generated in catalog/checkout_process.php. This is also where the data is stored in the database. If the email is correct, but the values are not stored in the database, then the error is probably in that file.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Yes Jim.

Its in checkout_process.php, exactly when clicking the checkout confirmation button.

THERE IS NO RECORDS IN order_product_id COLUMN.(IN THE TABLE orders_products_atributes)!

All records appear as 0[/b]. ¿? If I edit them on hand all works fine.

 

I know isn´t problem of the MVS contrib.

But i dont see nothing extrange. The code is the same as a vanilla instalation:

 

checkout_process.php

...>

 $order_products_id = tep_db_insert_id();

//------insert customer choosen option to order--------
   $attributes_exist = '0';
   $products_ordered_attributes = '';
   if (isset($order->products[$i]['attributes'])) {
     $attributes_exist = '1';
     for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
       if (DOWNLOAD_ENABLED == 'true') {
         $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename 
                              from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
                              left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
                               on pa.products_attributes_id=pad.products_attributes_id
                              where pa.products_id = '" . $order->products[$i]['id'] . "' 
                               and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' 
                               and pa.options_id = popt.products_options_id 
                               and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' 
                               and pa.options_values_id = poval.products_options_values_id 
                               and popt.language_id = '" . $languages_id . "' 
                               and poval.language_id = '" . $languages_id . "'";
         $attributes = tep_db_query($attributes_query);
       } else {
         $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
       }
       $attributes_values = tep_db_fetch_array($attributes);

       $sql_data_array = array('orders_id' => $insert_id, 
                               'orders_products_id' => $order_products_id, 
                               'products_options' => $attributes_values['products_options_name'],
                               'products_options_values' => $attributes_values['products_options_values_name'], 
                               'options_values_price' => $attributes_values['options_values_price'], 
                               'price_prefix' => $attributes_values['price_prefix']);
       tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

       if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
         $sql_data_array = array('orders_id' => $insert_id, 
                                 'orders_products_id' => $order_products_id, 
                                 'orders_products_filename' => $attributes_values['products_attributes_filename'], 
                                 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 
                                 'download_count' => $attributes_values['products_attributes_maxcount']);
         tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
       }
       $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
     }
   }
//------insert customer choosen option eof ----
//BEGIN SEND HTML MAIL//

 

 

also looked in:

includes/application_top.php

nothing.

 

includes/general.php

 

// Return a product ID with attributes
 function tep_get_uprid($prid, $params) {
   if (is_numeric($prid)) {
     $uprid = $prid;

     if (is_array($params) && (sizeof($params) > 0)) {
       $attributes_check = true;
       $attributes_ids = '';

       reset($params);
       while (list($option, $value) = each($params)) {
         if (is_numeric($option) && is_numeric($value)) {
           $attributes_ids .= '{' . (int)$option . '}' . (int)$value;
         } else {
           $attributes_check = false;
           break;
         }
       }

       if ($attributes_check == true) {
         $uprid .= $attributes_ids;
       }
     }
   } else {
     $uprid = tep_get_prid($prid);

     if (is_numeric($uprid)) {
       if (strpos($prid, '{') !== false) {
         $attributes_check = true;
         $attributes_ids = '';

 

// Return a product ID from a product ID with attributes
 function tep_get_prid($uprid) {
   $pieces = explode('{', $uprid);

   if (is_numeric($pieces[0])) {
     return $pieces[0];
   } else {
     return false;
   }
 }

 

////
// Check if product has attributes
 function tep_has_product_attributes($products_id) {
   $attributes_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "'");
   $attributes = tep_db_fetch_array($attributes_query);

   if ($attributes['count'] > 0) {
     return true;
   } else {
     return false;
   }
 }

Link to comment
Share on other sites

Yes Jim.

Its in checkout_process.php, exactly when clicking the checkout confirmation button.

THERE IS NO RECORDS IN order_product_id COLUMN.(IN THE TABLE orders_products_atributes)!

All records appear as 0[/b]. ¿? If I edit them on hand all works fine.

 

I know isn´t problem of the MVS contrib.

But i dont see nothing extrange. The code is the same as a vanilla instalation:

 

checkout_process.php

...>

 $order_products_id = tep_db_insert_id();

//------insert customer choosen option to order--------
   $attributes_exist = '0';
   $products_ordered_attributes = '';
   if (isset($order->products[$i]['attributes'])) {
     $attributes_exist = '1';
     for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
       if (DOWNLOAD_ENABLED == 'true') {
         $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename 
                              from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
                              left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
                               on pa.products_attributes_id=pad.products_attributes_id
                              where pa.products_id = '" . $order->products[$i]['id'] . "' 
                               and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' 
                               and pa.options_id = popt.products_options_id 
                               and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' 
                               and pa.options_values_id = poval.products_options_values_id 
                               and popt.language_id = '" . $languages_id . "' 
                               and poval.language_id = '" . $languages_id . "'";
         $attributes = tep_db_query($attributes_query);
       } else {
         $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
       }
       $attributes_values = tep_db_fetch_array($attributes);

       $sql_data_array = array('orders_id' => $insert_id, 
                               'orders_products_id' => $order_products_id, 
                               'products_options' => $attributes_values['products_options_name'],
                               'products_options_values' => $attributes_values['products_options_values_name'], 
                               'options_values_price' => $attributes_values['options_values_price'], 
                               'price_prefix' => $attributes_values['price_prefix']);
       tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

       if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
         $sql_data_array = array('orders_id' => $insert_id, 
                                 'orders_products_id' => $order_products_id, 
                                 'orders_products_filename' => $attributes_values['products_attributes_filename'], 
                                 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 
                                 'download_count' => $attributes_values['products_attributes_maxcount']);
         tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
       }
       $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
     }
   }
//------insert customer choosen option eof ----
//BEGIN SEND HTML MAIL//

 

 

also looked in:

includes/application_top.php

nothing.

 

includes/general.php

 

// Return a product ID with attributes
 function tep_get_uprid($prid, $params) {
   if (is_numeric($prid)) {
     $uprid = $prid;

     if (is_array($params) && (sizeof($params) > 0)) {
       $attributes_check = true;
       $attributes_ids = '';

       reset($params);
       while (list($option, $value) = each($params)) {
         if (is_numeric($option) && is_numeric($value)) {
           $attributes_ids .= '{' . (int)$option . '}' . (int)$value;
         } else {
           $attributes_check = false;
           break;
         }
       }

       if ($attributes_check == true) {
         $uprid .= $attributes_ids;
       }
     }
   } else {
     $uprid = tep_get_prid($prid);

     if (is_numeric($uprid)) {
       if (strpos($prid, '{') !== false) {
         $attributes_check = true;
         $attributes_ids = '';

 

// Return a product ID from a product ID with attributes
 function tep_get_prid($uprid) {
   $pieces = explode('{', $uprid);

   if (is_numeric($pieces[0])) {
     return $pieces[0];
   } else {
     return false;
   }
 }

 

////
// Check if product has attributes
 function tep_has_product_attributes($products_id) {
   $attributes_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "'");
   $attributes = tep_db_fetch_array($attributes_query);

   if ($attributes['count'] > 0) {
     return true;
   } else {
     return false;
   }
 }

Link to comment
Share on other sites

Yes Jim.

Its in checkout_process.php, exactly when clicking the checkout confirmation button.

THERE IS NO RECORDS IN order_product_id COLUMN.(IN THE TABLE orders_products_atributes)!

All records appear as 0[/b]. ¿? If I edit them on hand all works fine.

 

I know isn´t problem of the MVS contrib.

But i dont see nothing extrange. The code is the same as a vanilla instalation:

 

checkout_process.php

...>

 $order_products_id = tep_db_insert_id();

//------insert customer choosen option to order--------
   $attributes_exist = '0';
   $products_ordered_attributes = '';
   if (isset($order->products[$i]['attributes'])) {
     $attributes_exist = '1';
     for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
       if (DOWNLOAD_ENABLED == 'true') {
         $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename 
                              from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
                              left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
                               on pa.products_attributes_id=pad.products_attributes_id
                              where pa.products_id = '" . $order->products[$i]['id'] . "' 
                               and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' 
                               and pa.options_id = popt.products_options_id 
                               and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' 
                               and pa.options_values_id = poval.products_options_values_id 
                               and popt.language_id = '" . $languages_id . "' 
                               and poval.language_id = '" . $languages_id . "'";
         $attributes = tep_db_query($attributes_query);
       } else {
         $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
       }
       $attributes_values = tep_db_fetch_array($attributes);

       $sql_data_array = array('orders_id' => $insert_id, 
                               'orders_products_id' => $order_products_id, 
                               'products_options' => $attributes_values['products_options_name'],
                               'products_options_values' => $attributes_values['products_options_values_name'], 
                               'options_values_price' => $attributes_values['options_values_price'], 
                               'price_prefix' => $attributes_values['price_prefix']);
       tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

       if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
         $sql_data_array = array('orders_id' => $insert_id, 
                                 'orders_products_id' => $order_products_id, 
                                 'orders_products_filename' => $attributes_values['products_attributes_filename'], 
                                 'download_maxdays' => $attributes_values['products_attributes_maxdays'], 
                                 'download_count' => $attributes_values['products_attributes_maxcount']);
         tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
       }
       $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
     }
   }
//------insert customer choosen option eof ----
//BEGIN SEND HTML MAIL//

 

 

also looked in:

includes/application_top.php

nothing.

 

includes/general.php

 

// Return a product ID with attributes
 function tep_get_uprid($prid, $params) {
   if (is_numeric($prid)) {
     $uprid = $prid;

     if (is_array($params) && (sizeof($params) > 0)) {
       $attributes_check = true;
       $attributes_ids = '';

       reset($params);
       while (list($option, $value) = each($params)) {
         if (is_numeric($option) && is_numeric($value)) {
           $attributes_ids .= '{' . (int)$option . '}' . (int)$value;
         } else {
           $attributes_check = false;
           break;
         }
       }

       if ($attributes_check == true) {
         $uprid .= $attributes_ids;
       }
     }
   } else {
     $uprid = tep_get_prid($prid);

     if (is_numeric($uprid)) {
       if (strpos($prid, '{') !== false) {
         $attributes_check = true;
         $attributes_ids = '';

 

// Return a product ID from a product ID with attributes
 function tep_get_prid($uprid) {
   $pieces = explode('{', $uprid);

   if (is_numeric($pieces[0])) {
     return $pieces[0];
   } else {
     return false;
   }
 }

 

////
// Check if product has attributes
 function tep_has_product_attributes($products_id) {
   $attributes_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "'");
   $attributes = tep_db_fetch_array($attributes_query);

   if ($attributes['count'] > 0) {
     return true;
   } else {
     return false;
   }
 }

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...