Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Free shipping with other options


sinopia

Recommended Posts

Hello, I'm using v2.3.4, and I was looking to have free shipping but also other options for express shipping.

Currently I have zones and table but when free shipping is enable it disabled both and only show the free shipping option.

Does anyone knows how I can show free shipping and table option for express shipping? (they pay a bit more but it's faster delivery).

Link to comment
Share on other sites

@sinopia

Is this a new installation? If so, please realize that osC v2.3.4 is way out of date, and will not continue to run as our hosts upgrade to the newer versions of PHP. So, if this is a new install, I'd strongly suggest you start over with the Community build of osC (see link in my signature below).

If this is not a new installation, you should begin thinking about moving your shop up to the latest version. Unfortunately, it is not an in-place upgrade. You'd basically create the new store in a separate sub-directory, migrate over your database and images, and re-apply any add-ons and/or styling changes you made (you kept good notes, didn't you?)

M

Link to comment
Share on other sites

It's a current live websit, it's has been updated to new PHP 7. As this moment just was looking for this issue.

Free delivery gets enable at over 29.90, but when it appers it disabled zones and table modules. I just needed to keep the tables when free shipping is enabled.

Also the free shipping is only for country of the store. Otherwise I've to change zones to set free shipping only for the country and over X€ price...

Link to comment
Share on other sites

@sinopia

A stock 2.3.4 shop will have issues with PHP 7. To try and make your old store work under PHP 7 will take a lot of work, and will result in a FrankenShop fork that no-one else will be able to support.

Your choices are:

1) Spend a lot of time and effort to make your shop run under PHP 7 (not recommended), or ...

2) Ask your host to roll PHP back to 5.x (a temporary fix, while you ...)

3) Upgrade your shop to the latest Community build of osC (link in my signature below).

M

Link to comment
Share on other sites

@ArtcoInc I completly understand, and I'm thank you that you're answering me. But I've change already to have compatibility with PHP 7, it works everything fine.

The issue is only about the shipping.. Just needed to set free shipping only for zones (only country zone because I've also foreign) and keep always table module...

Link to comment
Share on other sites

I'm having some issues in the radio buttons now... The selectRowEffect works but the input is now selected/checked and at the checkout_confirmation.php I get always the free shipping option by default..

Any suggestion how to fix this?

Edited by sinopia
edit
Link to comment
Share on other sites

8 hours ago, sinopia said:

The issue is only about the shipping.. Just needed to set free shipping only for zones (only country zone because I've also foreign) and keep always table module...

This is relatively easy to accomplish with a $0.00 flat rate module.

Take the flat rate module - and make a "new" copy of the module and language file - calling (for example "free"), editing the language file to however you wish it to display... And add something like:

	  if ( ($this->enabled == true) && ($order->info['subtotal'] < 30) ) {
      $this->enabled = false;
      return;
      }	  

Which would make this module active over $30 - while giving your customer the option to continue with any other of your normal, paid, shipping modules.

There are several in the addons/app area, however they are hard to find.

Link to comment
Share on other sites

@greasemonkey thank you for you answer.

I tried to display free shipping (if over 30) and all other options, and then disabling zones with:

      if (($order->delivery['country_id'] == STORE_COUNTRY) && ($order->info['total']) > 29.90) {
        $check_flag = true;
      }
        
      if ($check_flag == false) {
        $this->enabled = false;
      }

It kinda works... But the radio button stop to working correctly and I can't figure it out.. Wanna check my checkout_shipping.php?

Link to comment
Share on other sites

v2.3.4 - I know it should be updated, but the website is currently live with a lot of traffic and also a lot of core changes, it would take a bit to get the last version (but of course everything should be always updated..)

 

I use ot_shipping.php for free shipping in orders over 29,90€.

Zones for national and internacional (free shipping is only for national) and Table for a express shipping only for national.

By default is total is less than 29,90€ is show both options (Zones and Table - which is correct) but then is total is more than 29,90€ it only show the free shipping (if national) but I wanted to show the table module even if free shipping is avaliable.

 

I tried to edit checkout_shipping.php to display all options it kinda works but then the radio buttons doesn't work properly. I think it's something related with with javascript code because I get:

Uncaught TypeError: Cannot set property 'checked' of undefined

And also tried to disable zones for national when the option free shipping shows (because it's the same delivery and there's no need to show to select that option when it's free..)

Link to comment
Share on other sites

Well.. I've disabled free shipping at ot_shipping.php and added flat with 0.00€ for national only and

    if ( ($this->enabled == true) && ($order->info['subtotal'] < 29.90) ) {
      $this->enabled = false;
      return;
    }	

and zones with:

      if ( ($this->enabled == true) && ($order->delivery['country_id'] == STORE_COUNTRY) && ($order->info['subtotal'] > 29.90) ) {
        $this->enabled = false;
        return;
      }   

It seems to work, I've to test now if it's everything correct.

Link to comment
Share on other sites

I've saw now that orders paid with PayPal are not showing the shipping_module at table orders.

I've the recent version of PayPal App (using Standard) but it's missing 'shipping_module' => $shipping['id'], as checkout_process.php has..

It shows the price of shipping at orders_total but not the shipping module selected.. To fix just need to add 

 'shipping_module' => $shipping['id']

In this case? will variable $shipping['id'] work or it should be

'shipping_module' => $order->info['payment_method']

To get the respective module used?

Edited by sinopia
edit
Link to comment
Share on other sites

I mean..

 

$order->info['shipping_method']  - which contain a string with description of shipping module;

$shipping['id'] - contains a string "spu_spu" for Store Pickup, "flat_flat" for Flat Rate shipping.

well $order->info['shipping_method'] works but show the description, I found to use $shipping['id'] - needed to add global $shipping:

    function confirmation() {
      global $cartID, $cart_PayPal_Standard_ID, $customer_id, $languages_id, $order, $order_total_modules, $shipping;

But it works fine.

Edited by sinopia
edit
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...