Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi_Vendor_Shipping new thread


blucollarguy

Recommended Posts

In case someone ever wants to do free shipping at the cart/order total value level here is what I changed (and Jim let me know if you can see any issues). I took advantage of the constants and the fact that application_top stores the total of the shopping chart. :

 

In the checkout_payment.php around line 26 changed:

 

// if no shipping method has been selected, redirect the customer to the shipping method selection page
  if (!tep_session_is_registered('shipping')) {
       tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
  }

 

TO:

 

// if no shipping method has been selected, redirect the customer to the shipping method selection page
  if (!tep_session_is_registered('shipping')) {
      if ((MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING != 'true') && ($cart->total >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) {//check to see if free shipping at the total cart level it configured

       tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
      }
  }

 

And in checkout_confirmation.php around line 20:

// If a shipping method has not been selected for all vendors, redirect the customer to the shipping method selection page
  if (SELECT_VENDOR_SHIPPING == 'true') { // This test only works under MVS
    if (!is_array ($shipping['vendor']) || count ($shipping['vendor']) != count ($cart->vendor_shipping)) { // No shipping selected or not all selected
        tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL'));
    }
  }

 

TO:

 

// If a shipping method has not been selected for all vendors, redirect the customer to the shipping method selection page
  if (SELECT_VENDOR_SHIPPING == 'true') { // This test only works under MVS
    if (!is_array ($shipping['vendor']) || count ($shipping['vendor']) != count ($cart->vendor_shipping)) { // No shipping selected or not all selected
      if ((MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING != 'true') && ($cart->total >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) { //check to see if free shipping at the total cart level it configured
        tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL'));
      }        
    }
  }

 

After making the above changes to get it to work all you have to do is set the value and trun on Free Shipping in the in Admin->Modules->Order Totals -> shipping. And the site will we do free shipping at the total cart level with MVS. Now, one thing I noticed from a business perspective is that you need to watch the minimal amount you set the free shipping value to because we had a combination of items that were coming from different vendors when I set the value for free shipping to $50.00 that would have cause the business to loose money on that order. So, we change it to $100.00 so that they could cover the cost of the shipping and the product and still make a marginal profit.

 

The other improvement I am considering is on the checkout_shipping.php page is add a selector that is preselected for Free Shipping so that it matches the page when there is no free shipping. Also, I am considering changing the message/text on the page because is states something like "Please select from...." to be more align that there is a free shipping offer.

 

Jim, Like to know your thought on this approach and if you think it is userful.

Edited by nbkvh1i
Link to comment
Share on other sites

We did find one a bit of flaw/bug in the logic. What I discovered is that we needed apply a second layer or break up the logic a bit more. So, if the OSC Orders Module is off is one condition and the error should be check every time. Then if it is on we need to add the compound check that it is below the minimal amount. I think in my first attempt I was trying to combine the two and that left some use cases open that should have executed the error check. Here is the revised if statement:

// If a shipping method has not been selected for all vendors, redirect the customer to the shipping method selection page

  if (SELECT_VENDOR_SHIPPING == 'true') { // This test only works under MVS

    if (!is_array ($shipping['vendor']) || count ($shipping['vendor']) != count ($cart->vendor_shipping)) { // No shipping selected or not all selected

                  if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING != 'true') { //check to see if free shipping at the total char level it configured

                    tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL'));

        }

                                elseif((MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') && ($cart->total <= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) { //check to see if free shipping at the total char level it configured

                                    tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL'));                            

                                }

    }

  }

 

We are finding one other issue. And this is more user frustration type of flaw. I have not researched it, however, I think there is bug within the OSC Order Module within Checkout_Shipping.PHP page using grand total vs. cart sub-total. Here is the failed use case: A user creates an order that is below the minimal free shipping amount. They enter the checkout process and select one or more shipping options (if they have more than one vendor’s product). All seems to work without issue unless they abandon the checkout process (to go back and modify the cart items) after selecting one or more shipping methods.  What happens is that when they re-execute the checkout process they may get displayed that they qualify for free shipping even thru the cart amount is still below the minimal amount. What I believe is occurring is that what OSC is using is looking at the total order amount and not the cart sub-total amount. Because if the total order amount is over (with the prior selected shipping amounts) then they are getting displayed free shipping. Now, the funny thing is that the checkout_confirmation.php logic above is trapping for and sending back to select a new shipping method for the order because the cart amount is still below the minimal and no revised shipping method(s) was selected.  I could see this as point of frustration for a user being told they get free shipping and at very end they don’t qualify.  

 

I am going to take a look at the logic within checkout_shipping.php to see if I can find what it is using.

Edited by nbkvh1i
Link to comment
Share on other sites

  • 1 month later...

I have been up and down this thread to see if I can find a solution to my problem.

 

I receive the any of the following errors on checking_shipping.php:

 

 

Fatal error: Cannot use string offset as an array in /***/public_html/store/includes/modules/vendors_shipping/upsxml.php on line 381

 

 

Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway : Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway

 

Server PHP 5.2.17

upsxml.php version is 1.1.4

 

I have tried to enable the logging feature but have not had any luck in getting it to write anything to the log file.

 

Any help would be very much appreciated.

Link to comment
Share on other sites

Try commenting out line 381 of includes/modules/vendors_shipping/upsxml.php. That will remove the time in transit part of the shipping quote. It should also removes the error messages.

 

Regards

Jim

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

Link to comment
Share on other sites

Hey Jim,

 

If I comment that out it works "most of the time."  I no longer get the "Fatal Error" issue but I sometimes get a shipping rate and I sometimes get a generic "Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway : Rating and Service 1.0001 0 An unknown error occured while attempting to contact the UPS gateway" error.

 

Any ideas?

Link to comment
Share on other sites

And even when it gives me a shipping rate to select, if I select it and click on "Continue" it takes me right back to the same page with the following error:

 

 

Error: You have not selected a shipping method for all groups of products. Please select one shipping method for each group of products below.

 

The UPS shipping method now has the generic "Rating and Service 1.0001 0 An unknown...." error displayed.

Link to comment
Share on other sites

I need more information. Set up logging in the module. You need the complete route to the log file (see your configure.php for the basic file path) and you need to make the file writeable for your system.

 

Regards

Jim

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

Link to comment
Share on other sites


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

DATE AND TIME: 2016-01-24 00:01:21

UPS URL: https://wwwcie.ups.com:443/ups.app/xml/Rate

UPS REQUEST: <?xml version="1.0"?>

<AccessRequest xml:lang="en-US">

   <AccessLicenseNumber>***</AccessLicenseNumber>

   <UserId>***</UserId>

   <Password>***</Password>

</AccessRequest>

<?xml version="1.0"?>

<RatingServiceSelectionRequest xml:lang="en-US">

   <Request>

       <TransactionReference>

           <CustomerContext>Rating and Service</CustomerContext>

           <XpciVersion>1.0001</XpciVersion>

       </TransactionReference>

       <RequestAction>Rate</RequestAction>

       <RequestOption>shop</RequestOption>

   </Request>

   <PickupType>

       <Code>01</Code>

   </PickupType>

   <Shipment>

       <Shipper>

           <Address>

               <City>North Charleston</City>

               <StateProvinceCode>SC</StateProvinceCode>

               <CountryCode>US</CountryCode>

               <PostalCode>29405</PostalCode>

           </Address>

       </Shipper>

       <ShipTo>

           <Address>

               <City>North Charleston</City>

               <StateProvinceCode>SC</StateProvinceCode>

               <CountryCode>US</CountryCode>

               <PostalCode>29405</PostalCode>

<ResidentialAddressIndicator/>

           </Address>

       </ShipTo>

       <Package>

           <PackagingType>

               <Code>02</Code>

           </PackagingType>

           <PackageWeight>

               <UnitOfMeasurement>

                   <Code>LBS</Code>

               </UnitOfMeasurement>

               <Weight>32.5</Weight>

           </PackageWeight>

       </Package>

   </Shipment>

   <CustomerClassification>

       <Code>01</Code>

   </CustomerClassification>

</RatingServiceSelectionRequest>

 

Error from cURL: Error [35]: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

UPS RESPONSE:

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

DATE AND TIME: 2016-01-24 00:01:48

UPS URL: https://wwwcie.ups.com:443/ups.app/xml/Rate

UPS REQUEST: <?xml version="1.0"?>

<AccessRequest xml:lang="en-US">

   <AccessLicenseNumber>***</AccessLicenseNumber>

   <UserId>***</UserId>

   <Password>***</Password>

</AccessRequest>

<?xml version="1.0"?>

<RatingServiceSelectionRequest xml:lang="en-US">

   <Request>

       <TransactionReference>

           <CustomerContext>Rating and Service</CustomerContext>

           <XpciVersion>1.0001</XpciVersion>

       </TransactionReference>

       <RequestAction>Rate</RequestAction>

       <RequestOption>shop</RequestOption>

   </Request>

   <PickupType>

       <Code>01</Code>

   </PickupType>

   <Shipment>

       <Shipper>

           <Address>

               <City>North Charleston</City>

               <StateProvinceCode>SC</StateProvinceCode>

               <CountryCode>US</CountryCode>

               <PostalCode>29405</PostalCode>

           </Address>

       </Shipper>

       <ShipTo>

           <Address>

               <City>North Charleston</City>

               <StateProvinceCode>SC</StateProvinceCode>

               <CountryCode>US</CountryCode>

               <PostalCode>29405</PostalCode>

<ResidentialAddressIndicator/>

           </Address>

       </ShipTo>

       <Package>

           <PackagingType>

               <Code>02</Code>

           </PackagingType>

           <PackageWeight>

               <UnitOfMeasurement>

                   <Code>LBS</Code>

               </UnitOfMeasurement>

               <Weight>32.5</Weight>

           </PackageWeight>

       </Package>

   </Shipment>

   <CustomerClassification>

       <Code>01</Code>

   </CustomerClassification>

</RatingServiceSelectionRequest>

 

UPS RESPONSE: <?xml version="1.0"?>

<RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Rating and Service</CustomerContext><XpciVersion>1.0001</XpciVersion></TransactionReference><ResponseStatusCode>1</ResponseStatusCode><ResponseStatusDescription>Success</ResponseStatusDescription></Response><RatedShipment><Service><Code>03</Code></Service><RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>18.19</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>18.19</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery/><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>18.19</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>18.19</MonetaryValue></TotalCharges><Weight>32.5</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight></RatedPackage></RatedShipment><RatedShipment><Service><Code>12</Code></Service><RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>38.00</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>38.00</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>3</GuaranteedDaysToDelivery><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>38.00</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>38.00</MonetaryValue></TotalCharges><Weight>32.5</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight></RatedPackage></RatedShipment><RatedShipment><Service><Code>02</Code></Service><RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>52.28</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>52.28</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>2</GuaranteedDaysToDelivery><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>52.28</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>52.28</MonetaryValue></TotalCharges><Weight>32.5</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight></RatedPackage></RatedShipment><RatedShipment><Service><Code>13</Code></Service><RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>73.56</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>73.56</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>73.56</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>73.56</MonetaryValue></TotalCharges><Weight>32.5</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight></RatedPackage></RatedShipment><RatedShipment><Service><Code>14</Code></Service><RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>111.74</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>111.74</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery><ScheduledDeliveryTime>9:00 A.M.</ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>111.74</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>111.74</MonetaryValue></TotalCharges><Weight>32.5</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight></RatedPackage></RatedShipment><RatedShipment><Service><Code>01</Code></Service><RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>80.46</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>80.46</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery><ScheduledDeliveryTime>10:30 A.M.</ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>80.46</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>0.00</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>80.46</MonetaryValue></TotalCharges><Weight>32.5</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>33.0</Weight></BillingWeight></RatedPackage></RatedShipment></RatingServiceSelectionResponse>

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

DATE AND TIME: 2016-01-24 00:01:50

UPS URL: https://wwwcie.ups.com:443/ups.app/xml/Rate

UPS REQUEST: <?xml version="1.0"?>

<AccessRequest xml:lang="en-US">

   <AccessLicenseNumber>***</AccessLicenseNumber>

   <UserId>***</UserId>

   <Password>***</Password>

</AccessRequest>

<?xml version="1.0"?>

<RatingServiceSelectionRequest xml:lang="en-US">

   <Request>

       <TransactionReference>

           <CustomerContext>Rating and Service</CustomerContext>

           <XpciVersion>1.0001</XpciVersion>

       </TransactionReference>

       <RequestAction>Rate</RequestAction>

       <RequestOption>shop</RequestOption>

   </Request>

   <PickupType>

       <Code>01</Code>

   </PickupType>

   <Shipment>

       <Shipper>

           <Address>

               <City>North Charleston</City>

               <StateProvinceCode>SC</StateProvinceCode>

               <CountryCode>US</CountryCode>

               <PostalCode>29405</PostalCode>

           </Address>

       </Shipper>

       <ShipTo>

           <Address>

               <City>North Charleston</City>

               <StateProvinceCode>SC</StateProvinceCode>

               <CountryCode>US</CountryCode>

               <PostalCode>29405</PostalCode>

<ResidentialAddressIndicator/>

           </Address>

       </ShipTo>

       <Package>

           <PackagingType>

               <Code>02</Code>

           </PackagingType>

           <PackageWeight>

               <UnitOfMeasurement>

                   <Code>LBS</Code>

               </UnitOfMeasurement>

               <Weight>32.5</Weight>

           </PackageWeight>

       </Package>

   </Shipment>

   <CustomerClassification>

       <Code>01</Code>

   </CustomerClassification>

</RatingServiceSelectionRequest>

 

Error from cURL: Error [35]: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

UPS RESPONSE:

 

Edited by blaine109
Link to comment
Share on other sites

The only thing that I can see is that you are getting a TLS version warning. Ask your host to update their software, as TLS V1.0 is obsolete and will soon stop working. Also, PHP 5.2.x is long obsolete and no longer supported. Time to upgrade. PHP 5.6 is about the minimum I would recommend.

 

However, that should not cause the error that you are seeing. Sorry, but I don't have any more ideas. You'll probably just have to debug the thing.

 

Regards

Jim

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

Link to comment
Share on other sites

Thanks Jim, I actually think it's a TLS issue.  I found this for UPS:

 

 

Security Upgrade Required for UPS® Developer Kit APIs

Action is Required

UPS is in the process of upgrading communication security protocols for all web-based applications, including UPS Developer Kit Application Programming Interfaces (APIs), which are used to integrate UPS functionality into your website and applications.

Effective January 26, 2016, the UPS test environment will require the TLS 1.2 security protocol, and will be available for your system testing.

Effective May 31, 2016, UPS will require the TLS 1.2 security protocol in production. After that date, any communication requests submitted to UPS using older protocols (TLS 1.1 or earlier) will fail.

NOTE: From January 19 through May 31, 2016, you may see intermittent failures for any non-compliant transactions.

Please contact your company's IT department or your development team to ensure that any security protocols currently used meet the TLS 1.2 requirement. If you have Java enabled, you must be using version 1.7 or higher to use TLS 1.2.
Edited by blaine109
Link to comment
Share on other sites

  • 1 month later...

Hello Jim and everyone,

 

Are there any plans for you to port this over for Bootstrap OSC? 

 

I've been looking at the files and the functionality & it certainly seems to be a great addon for me to use.

 

Has anyone else reading this already got it to work with OSCBS, & would you be willing to share the files / changes needed?

 

Regards,

 

Simon

Link to comment
Share on other sites

Since I can't edit my post, one more quick question.

 

I'm now installing MVS on a virtually vanilla OSC 2.3.4 std version, using Beyond Compare to see the changes and merge into files.

 

I'm seeing this in the MVS files:

// Output a form input field
  function tep_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true) {
    global $_GET, $_POST;

But this in my current files:

// Output a form input field
  function tep_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true) {
    global $HTTP_GET_VARS, $HTTP_POST_VARS;

The only difference being the $HTTP parts of the lines. I ran an OSC installation (2.2 I think it was) many years ago & seem to remember discussion about which was the right one to use, so should I be merging these lines or leaving them, whilst adding the //MVS sections, which I know need to be there!

 

Regards,

 

Simon

Link to comment
Share on other sites

@@Spannerman1  The one disadvantage to the Bootstrap version of osCommerce is that there are not that many addons designed (or updated) for it yet. MVS is definitely on my list to update, but it's not very heavily used so it's not very far up the list.

 

It shouldn't be that hard to do. Just compare the files and add all of the sections marked MVS to the existing files, upload the new files, and it should work. You seem to be comfortable doing that.

 

I have no idea why osCommerce still has the long-form GET and POST variables. I think that was PHP 4.1 that introduced the short form, and nobody should still be using anything that old, much less older. If you want to relace all of those old variables with the new ones, it would make your code more modern. It's not necessary as osCommerce has a set of translation functions to make them equivalent, it just updates the code. It's your choice.

 

If you do update all of those variables in your code, the last line you showed from the MVS code is unnecessary and should be removed. All of the short form variables are globals to start with and don't need to be declared.

 

If you do make a Bootstrap version of MVS, please share it with the rest of us.

 

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,

 

Thanks for your prompt response.

 

I just find it strange that the files in the latest version for download have these old style tags in them, since they were for a much older version of PHP.

 

I shall replace them from your files :-)

 

As for the Bootstrap version, I did try to merge the files & whilst the Vendor Option did not appear in the Admin left hand navigation, I was able to get to it by calling Vendors.php directly. All the back-end seems to work but I get an "unexpected end of file" error in the first of the checkout pages, so I've obviously not got it right :-) 

 

I didn't post about it since the files used to display the cart etc are so different I know it's not a quick fix!

 

I hasten to add that I'm very much a script butcher & not a programmer, so the chances of me getting it to work on BS are very slim indeed.

 

In fact, I've got to verify the files on the std install, since I'm not getting any Shipping Modules listed to add to the Vendors I've defined, while they do appear in the BS version!

 

Regards, 

 

Simon

Link to comment
Share on other sites

Hello Jim,

 

I'm afraid I have a major functionality issue I really hope there is a simple answer to.

 

To briefly describe the scenario I'm using your add-on for: I am redesigning a site for a charity, who sell clothing, memberships and tickets for events. The idea is that clothing orders go to the office for dispatch, the membership orders go to the Membership Secretary and the event ticket sales go to the Rally Secretary. The Clothing orders have different Post & package values for the items - a cap is £7.50 with £1.50 P&P, a sweatshirt is £11 for members and £13 for non-members with £2.50 P&P etc.

 

I have set up vendors for each of the "departments", with Clothing having 3 vendors, each having the Handling Charge set to the amount of P&P required, and each article having the correct vendor. I have used Free Shipping by weight as the actual shipping module, with the weight set to 0.01 so every order should have "free shipping" but be charged the right Handling Charge for the item.

 

This itself seems to be working ok. The totals are correct in the cart, but I am not getting any order info in the emails sent to the "vendors" eg the Office, the Membership secretary or the Rally Sec & the emails are duplicated. I'm getting 4 emails for each order. The emails are sent to every vendor that has an item int he cart, but I can't tell if it's seperating the order info or just sending the whole lot out. This is a what I'm seeing in the email:

To: Office
Clothing1.50
webmaster@nxxxxxxxxx

, United Kingdom

------------------------------------------------------
Special Comments or Instructions:

------------------------------------------------------
From: Txxxxxxxxx
The Nxxxxxxxxxxxxxx
Uxxxxxxxx
Txxxxxxxxxxx
Rxxxxxxxxxx
Uxxxxxxxx
Mxxxxxxxxx
Mxxxxxxxxxx
Accnt #:
------------------------------------------------------
Order Number:
------------------------------------------------------

Shipping Method: freeamount -- Economy (9 - 14 Days)
------------------------------------------------------

Dropship deliver to:



,

Qty:

Product Name:

Item Code/Number:

Product Model:

Per Unit Price:

Item Comments:

 

 

The order email sent to the customer contains no info either, but a link to the detailed Invoice on the site works:

 

Date Ordered: Saturday 05 March, 2016

Test order

Products
------------------------------------------------------
There will be at least 0 packages shipped.
------------------------------------------------------
Sub-Total: £19.50
Royal Mail: £2.50
Total: £22.00


I'm hoping it's a simple query change to get the order ID into the pages that build the emails, but really need, and will be most grateful for, your assistance!

 

Email settings are "Smtp", "CRLF" & MIME set to True

 

Many many TIA's & Regards,

 

Simon

 

Link to comment
Share on other sites

@@Spannerman1  It looks like you've left something out, but I can't tell exactly what. I've never seen exactly what you are describing.

 

The first thing I would do is see if the data for the order is in the database. I would also turn on error messages in your template_top.php and take a look at your PHP error log. I need that information to figure out what's going on.

 

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,

 

Many thanks for your attention in thins matter.

 

I have checked and the Order data is in the Database. I have verified the files and they are the ones in the MVS mod.

 

I looked at Template_top and it's the file you supply in your Theme Switcher mod - I double checked I'd installed the Std version on this copy of the shop & not the BS version :-)

 

In application_top error logging is set to

// Set the level of error reporting

  error_reporting(E_ALL & ~E_NOTICE);
I have changed this to just E_ALL and the error log is giving this:
 
1 instance of 
PHP Notice:  Undefined variable: orders_id in /home/useracc/public_html/domain name/new/shop/catalog/checkout_process.php on line 556
then 15  (or more) lines of;
PHP Notice:  Undefined index: vendor_orders_products in /home/useracc/public_html/domain name/new/shop/catalog/checkout_process.php on line 460
 
In the database each vendor has a sequential numeric vendors_id, the vendors_product_id is a mix of some numeric, some are text.
 
I have changed some of the text in the language files to display "Royal Mail" etc since that is the way we're sending stuff, no matter what the Vendor actually is.
 
I am getting between 5-10 emails per vendor for ALL vendors, even if there is only one item in the cart, with processing set to Pending and Check/Money Order as the payment method while the shop is in testing.
 
I have just looked at the Orders_shipping table after verifying that the SQL query created all the right stuff on installation;
There are now 26 rows, all having the right info EXCEPT the Orders_id column just contains zeros!
Can I assume that this is the root of the problem, since I've made 14 test orders on the store so far?
 
I am wondering if it's anything to do with changing the variables from HTTP_GET_VARS etc as per our previous conversation, since I've only done that in the files affected by the mod. Will both methods co-exist or do I need to change it throughout the site?
 
This is the content of the Customers Order History detail page - this order had 2 items, one from each of 2 vendors as defined in the Admin. (Address info redacted for Security, but correct in the History.)
Order #11 (Pending)
Order Total: £45.50Order Date: Saturday 05 March, 2016
Delivery Address Simon Freedman 
xxxxxxx
xxxxxxxx
xxxxxxxxx
xxxxxx, United Kingdom Shipping Method Combined Shipping Shipment Products Model Each Total Shipment Number 1 Economy (9 - 14 Days) Shipment Number 3 Economy (9 - 14 Days) Shipment Number 5 Royal Mail Shipment Number 7 Royal Mail Shipment Number 9 Royal Mail Shipment Number 11 Royal Mail Shipment Number 13 Royal Mail Shipment Number 15 Royal Mail Shipment Number 17 Royal Mail Shipment Number 19 Royal Mail Shipment Number 21 Royal Mail Shipment Number 23   <td colspan="4 class=" main"="" valign="center" align="left">Royal Mail Billing Information
Billing Address

Simon XXXXXX

xxxxxxx

xxxxxx

xxxxx

xxxxx

Payment Method Check/Money Order Sub-Total: £43.00 Combined Shipping: £2.50 Total: £45.50

Order History
03/05/2016 Pending  

Apologies if this is a little disjointed, I was looking at different things as thoughts came to me while I was writing this.

 

Many thanks again & if there's any more info required, please let me know.

 

Regards,

 

Simon

Link to comment
Share on other sites

Just for clarification, in checkout_process.php the lines referenced are in the //MVS section and are starting at line 553, the error being line 556 - $oID=$orders_id;

 

//  echo $orders_id . 'The order number<br>';
        if ($order_sent_ckeck == 'no') {
          $status = '';
          $oID=$orders_id;
          $vendor_order_sent = false;
          $status=$order->info['order_status'];

          vendors_email ($vendors_id, $oID, $status, $vendor_order_sent);

 

and starting at line 460:
      for ($i=0, $n=sizeof($vendor_products[$l]['vendor_orders_products']); $i<$n; $i++) {
          $product_attribs = '';

          if (isset($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) && (sizeof($vendor_products[$l]['vendor_orders_products'][$i]['vendor_attributes']) > 0)) {

Regards,

 

Simon

Link to comment
Share on other sites

It looks like $orders_id is not getting set. Try changing that variable name to $insert_id (4 places in the file.)

 

Note that MVS was coded on an older version of osCommerce, so just dropping in the files is dangerous. I recommend comparing all of the modified files against the stock file and inserting the patches manually. All of the MVS patches are marked with comments.

 

Regards

Jim

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

Link to comment
Share on other sites

  • 1 month later...

Hi,

I have a recurring problem with the shipping modules getting uninstalled. This has happened several times and is difficult to replicate because it occurs out of the blue and rarely. I have a customized MS2.2 site with multi-vendor shipping installed.

The payment modules did not get uninstalled and the free shipping module was not uninstalled, but UPS, USPS, and FedEx - all need to be reinstalled.

Reinstalling them is not a big deal, but I would like to fix this if this is a bug or some sort of hack. The biggest issue is that I have no way of knowing when this happens unless I do a test checkout and see that there are no shipping methods displaying. I searched this thread but could not find anything, so,...

1) has anyone had this issue and is there a fix?
2) does anyone know where I can add a script to email me as soon as something like this happens?

Any and all help is greatly appreciated.

Demitry

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

@@Demitry  Shipping modules do nut uninstall themselves. The data is stored in the database (configuration table). Values could be deleted directly from the database, but are usually deleted by uninstalling the module from the Admin.

 

My first thought is that you have been hacked. I don't see how this benefits a hacker, unless they just want to destroy your business, but it could happen. osCommerce 2.2MS2 is extremely insecure, and it only runs on ancient versions of PHP that are also insecure, so there is no easy fix.

 

The other possibility is that someone (your host?) is reverting your database, possibly when the server crashes. How reliable is your host? Ask them if they have a backup, and if they have recently restored from a backup.

 

I suggest that you immediately start building a replacement site based on the latest version of osCommerce, either 2.3.4 or the community Responsive build. Once you have the site updated, keep it up to date to keep the hackers out.

 

Regards

Jim

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

Link to comment
Share on other sites

Jim,

 

Thank you for the reply. I have a pretty secure site with lots of security add-ons & features and I've upgraded to PHP5.3. I'm currently with webhostinghub and I just tried uploading a recent backup of the database but the modules are still showing as uninstalled. The weird thing is that for some items the shipping rates display at checkout even-though those modules in admin show as uninstalled. I'll probably just reinstall them again, because that's the easiest solution.

 

could you tell me where I could insert an email script to notify me if the shipping rates come up as blank at checkout? I can add an email script, I just need to know where to find and test for that condition. Thanks.

 

Demitry

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

The only shipping modules that count are in your Vendor manager. The ones in Modules >> Shipping do nothing under MVS. Could this be part of the problem?

 

I don't know of any easy way to send an email if the shipping modules are gone. I'm not certain this will work, but try something like this. In /includes/modules/vendor_shipping.php, find this line

    $vendor_shipping = $cart->vendor_shipping();

and add just after that

if (count ($vendor_shipping) == 0) {
  $to_name = '';
  $to_email_address = '';
  $email_subject = '';
  $email_text = '';
  $from_email_name = '';
  $from_email_address = '';
  tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address);
}

Fill in the information for each of the variables in the above. I think this will trigger correctly, but I haven't tested it, so please test and let me know if it works.

 

Regards

Jim

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

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