Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

You just need to set the $vendors_id globally. If your Admin Access names are stored in a database table, add a vendors_id column to that, then add some code to pull that value and set $vendors_id -- maybe in the session. Then you may need to modify the vendor-specific Admin pages to get that value at the top of the page, and remove any means of selecting a different value on the page.

 

Regards

Jim

 

Jim, thank you for the suggestion. This is definitely the direction. I was actually thinking to replace vendors_id with admin_id (from that specific contrib), but I sense that in your way probably I would need to edit less files, and especially mess less with categories.php.

On that matter: I noticed that the vendors_id values are pulled from the database with a query, stored into the vendors_array and then pushed into a select. Any suggestion on how to hide the field and replace it with a fixed value input depending on the session? No need to give me the full code, I just a sample to be directed to!

Thanks again for your time and effort.

Link to comment
Share on other sites

  $vendors_id = $_SESSION['admin_vendors_id']; 

 

Where $admin_vendors_id is the session variable that you have retrieved for this vendor/admin account. Then just remove the database query and pulldown that MVS uses to select the $vendors_id.

 

Regards

Jim

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

Link to comment
Share on other sites

@@marcochiana

MVS only handles shipping, not ordering. Search the Addons section for Minimum Order -- I believe there is one that you can set minimums by product or manufacturer.

 

@@Roaddoctor

I would love to, but I don't have the time. I have too many things to do as it is. I might do it if someone pays me to, or if I suddenly find myself with a lot of free time.

 

Regards

Jim

Jim - you mentioned a code adaptation for a payment. Do you have a price in mind for update to 2.3+?

Link to comment
Share on other sites

  • 3 weeks later...

Hi Jim,

 

Recently i have problem with MVS. MVS stop sending email into yahoo, gmail, bing when someone place order to dealer (dealer using public email). The strange thing, when i change the dealer email into private web mail(such as mail@@MyWebSiteScripts.com) the email to dealer going true. When i change back into yahoo or gmail, no email sending. I have make sure the site email function working with send email to customer that using gmail or yahoo mail. Do the problem with tep_mail in checkout_process?

Link to comment
Share on other sites

MVS uses the tep_mail() function in osCommerce. That function is designed to work with a local mail server, not a public service like gmail or yahoo mail. You would probably have to modify it to make that work. This is true of all email sent by osCommerce, not just MVS.

 

Regards

Jim

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

Link to comment
Share on other sites

No, the order is combined into a single checkout. I'm not sure how you would handle multiple checkouts from a single cart. That would take a lot of code changes to the core checkout files.

 

Regards

Jim

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

Link to comment
Share on other sites

By somehow i need split the checkout to each vendor. It's to avoid when someone order from 2 vendors and one of the vendors is out of stock or customer want cancelled order from one vendor. Instead asking the customer to replace the order, it's better to split the order into specific vendors so when someone cancelled the order for specific vendors, i just cancelled the order from admin panel.

 

Do you have any sample code or modules for split into each vendors? If the multiple checkout need changing alot of code, it's possible to split the order based on vendors? Thanks for reply.

Link to comment
Share on other sites

No, you're the only person who has ever asked for this. As I said before, it's going to be a huge amount of work.

 

Regards

Jim

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

Link to comment
Share on other sites

Hi Jim, i understand about how many work for change it. I try to code for split the order into each vendors. So far the order already split, i got abit problems on pass the orders id into 'orders_products' table. Since the orders_id  from 'orders' table generate based on auto increment, could you help me to pass the orders_id value from 'orders' table to 'orders_products' table?

 

Current i have seperate the orders in 'orders_products' table but the orders id still using latest auto increment(only one orders_id available instead 2 or more different orders_id).

 

 

I have read some solution, it's seem i need add mysql trigger to pass the auto increment value from table 'orders' into table 'orders_products';

Link to comment
Share on other sites

  • 2 months later...

Dear reader, I am a new poster on this forum (and still learning to code), so forgive me when I missed something or made mistake ;-)

 

We have a shop in an old version of OSC and in this shop the MVS module is working like a charm, and is really a great module.

 

Since the last weeks I have been trying to implement this module in the latest OSC 2.3.4. (MySQL 5.5.36 and PHP Version: 5.3.28. I have come quite far thanks to all great post on this topic and forum.

 

 

But I am stuck and running mad on a few things I can't get working:

1.    Account history info (account_history_info.php)
Has no error messages but is not displaying the vendor specific information (order with two vendors). Checked the DB and all data is there….
Doesn’t go through the statement if (tep_not_null ($orders_shipping_id)) { 

Has probably something to do with this code:

    $orders_shipping_id = '';
    $check_new_vendor_data_query = tep_db_query ("select orders_shipping_id,
                                                         orders_id,
                                                         …….

 

2.    Orders by vendor
Displays no data, no error messages is not working in the old site as well, probably PHP or SQL 5 problem….

 

3.    Move products between vendors
When I click the “update” button the screen refreshes with no errors but noting is changed in the Database.

 

@ Jim, I have documented all errors and changes until now to get it working, so if I can help in return to get a 2.3.4. package…. 

Working functionality without errors until now (in English, Dutch and German partially):

 

Backend

-       Changed SQL script to update the DB

-       Menu item Vendors

-       Vendor manager

-       Vendor Shipping modules

-       Products reports

-       Orders (sends vendor mails, not fancy yet)

 

Front

-       Checkout Shipping

-       Checkout Payment

-       Checkout Confirmation

-       Checkout Process (vendor mails not working jet).

-      

Link to comment
Share on other sites

Dear Jim,

 

Thanks for the response on the other tread and will as asked continue on this one.

 

No I have installed the official version from: http://addons.oscommerce.com/info/4129.

This because in the documentation of the link above there is mentioned this is an Alfa version do not use on live store ;-)

 

I ran in quite a bit of error messages and solved a lot of them, is there a good way on sharing them so you can use it (for .e.g. a new package)?

 

 

Kind greetings,

 

Fabien

Link to comment
Share on other sites

The files would be useful if you are installing on a clean copy of osCommerce. The other one that I linked on the other thread was installed on a heavily modified store, so cleaning it up for release is quite a job.

 

You could use that Alpha code as a model to find the problems with yours. Otherwise it's just a matter of debugging what you have.

 

Regards

Jim

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

Link to comment
Share on other sites

Dear Jim, ill try to compare with the alfa code and will report the results.

 

I ran in to another problem with the PDF Packingslip module and got it fixed with a workaround.

And hope to learn if there is a better solution. There is probably a underlying problem (php 5 and SQL 5) with declaring variables (and maybe the solution for my other problems).

 

Description, in the pdf_packingslip module there was no product content displayed in the table with orders that where created with the MVS module.

After implementing all the SQL code (from the order class) in the file it worked like a charm. But it was a dirty solution and don't want to solve it with a workaround.

 

I found that it had to be something with the file:             catalog\admin\includes\classes\order.php

And found out that the code standed on:                        if (tep_not_null($this->orders_shipping_id)) {

After changing the code below it still doen't work (maybe not needed and will be glad to hear this).

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Code in MVS pack:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

  class order {

    var $info, $totals, $products, $customer, $delivery;

 

    function order($order_id) {

      $this->info = array ();

      $this->totals = array ();

      $this->products = array ();

      $this->customer = array ();

      $this->delivery = array ();

      $this->query($order_id);

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Changed code in

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

//FvD 11-10-2014 MVS $shipping added

  class order {

    var $info, $totals, $products, $customer, $delivery, $shipping;

 

    function order($order_id) {

      $this->info = array();

      $this->totals = array();

      $this->products = array();

      $this->customer = array();

      $this->delivery = array();

//FvD 11-10-2014 MVS shipping added

      $this->shipping = array();

      $this->query($order_id);

 

 

I hope to learn if there is a proper solution for the problems with the variables and the underlying problem.

 

 

 

Kind greetings,

 

Fabien 

Link to comment
Share on other sites

The above MVS code just initializes a variable that will be filled later. I don't understand what that has to do with your problem.

 

Regards

Jim

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

Link to comment
Share on other sites

It works, but you need to patch all of the existing files rather than replace them, since those files are still 2.2x. Or you can start from this code, which is 2.3 but has some other addons mixed in that will need to be scrubbed out. 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

Hi Jim,

 

I found some other posts from you where you explain how to display the data from the variables, tnx!!

 

With this I looked at the problem with the PDF invoice and packingslip and found out that the string $order from class\order.php returns data. The problem is that when $orders_shipping_id = is not null the string returns in a different format and nothing is displayed in de PDF.... The solution I made (there are probably better solutions...) was adding two data query's (with and without vendor ID) to the pdf_packingslip.php and one to pdf_invoice.php.

 

if ($vID > '0'){ // specific packingslip when there is a vendor ID.
 
  $index = 0;
  $order_packslip_query = tep_db_query ("select vendors_id, orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $oID . "' and vendors_id = '" . (int) $vID . "'");
  while ($order_packslip_data = tep_db_fetch_array( $order_packslip_query) ) {
    $packslip_products[$index] = array (
      'qty' => $order_packslip_data['products_quantity'],
      'name' => $order_packslip_data['products_name'],
      'model' => $order_packslip_data['products_model'],
      'tax' => $order_packslip_data['products_tax'],
      'price' => $order_packslip_data['products_price'],
      'final_price' => $order_packslip_data['final_price']
    );
 
    $subindex = 0;
    $packslip_attributes_query = tep_db_query ("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $oID . "' and orders_products_id = '" . (int) $order_packslip_data['orders_products_id'] . "'");
    if (tep_db_num_rows ($packslip_attributes_query)) {
      while ($packslip_attributes = tep_db_fetch_array ($packslip_attributes_query) ) {
        $packslip_products[$index]['packslip_attributes'][$subindex] = array (
          'option' => $packslip_attributes['products_options'],
          'value' => $packslip_attributes['products_options_values'],
          'prefix' => $packslip_attributes['price_prefix'],
          'price' => $packslip_attributes['options_values_price']
        );
 
        $subindex++;
      }
    }
    $index++;
  }
  }
  else {   // general packingslip when there is no vendor ID.
 
    $index = 0;
    $order_packslip_query = tep_db_query ("select vendors_id, orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int) $oID . "'");
  while ($order_packslip_data = tep_db_fetch_array( $order_packslip_query) ) {
    $packslip_products[$index] = array (
      'qty' => $order_packslip_data['products_quantity'],
      'name' => $order_packslip_data['products_name'],
      'model' => $order_packslip_data['products_model'],
      'tax' => $order_packslip_data['products_tax'],
      'price' => $order_packslip_data['products_price'],
      'final_price' => $order_packslip_data['final_price']
    );
 
    $subindex = 0;
    $packslip_attributes_query = tep_db_query ("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $oID . "' and orders_products_id = '" . (int) $order_packslip_data['orders_products_id'] . "'");
    if (tep_db_num_rows ($packslip_attributes_query)) {
      while ($packslip_attributes = tep_db_fetch_array ($packslip_attributes_query) ) {
        $packslip_products[$index]['packslip_attributes'][$subindex] = array (
          'option' => $packslip_attributes['products_options'],
          'value' => $packslip_attributes['products_options_values'],
          'prefix' => $packslip_attributes['price_prefix'],
          'price' => $packslip_attributes['options_values_price']
        );
 
        $subindex++;
      }
    }
    $index++;
  }
  }

 

Of course I had to change the names of the vars in the rest of the file.

 

 

Kind greetings,

 

Fabien

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