Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cost/Weight Shipping


LeeFoster

Recommended Posts

I am currently working on getting this add on working with Phoenix, it's almost there except for one issue. 

https://apps.oscommerce.com/BSHzP&cost-weight-matrix-shipping-rates

I have set up 2 values for cost £50 and £100, the theory being that once the cart goes over £100 that shipping option should no longer be there. In case you didn't guess it's still there and showing the lowest shipping amount.

Testing on Phoenix 1.0.7.1

PHP 7.3.3

Local Xampp server

Link to comment
Share on other sites

Added the below code and it now hides the shipping option in the cart

$cart_total = $cart->show_total();
		  $table_costtable = preg_split("/[,]/" , MODULE_SHIPPING_UKFIRST_UT_COSTTABLE);
      $size = sizeof($table_costtable);
for ($i=0; $i<$size; $i++) {
				
if ($cart_total > $table_costtable[$size-1]) {

$this->enabled = false;

}
      }

 I now get this error in the shipping modules section of admin.

Quote

Fatal error: Uncaught Error: Call to a member function show_total()

I know it's because the function doesn't exist there but how do I get around it?

Link to comment
Share on other sites

Just now, hungryfrank said:

if this is in a function u can add carts to the globals

global $order, $cart;

I added $cart to the globals which is why it works on the front end. Unfortunately this doesnt carry over to admin.

Link to comment
Share on other sites

Remove $cart from global and write

if (isset($_SESSION['cart']) {
  $cart =& $_SESSION['cart'];
} else {
  $cart = new shopping_cart();
}

But it might be better not to use cart in admin at all. 

Always back up before making changes.

Link to comment
Share on other sites

7 hours ago, ecartz said:

Remove $cart from global and write


if (isset($_SESSION['cart']) {
  $cart =& $_SESSION['cart'];
} else {
  $cart = new shopping_cart();
}

But it might be better not to use cart in admin at all. 

Made the change and now get this error

Quote

Fatal error: Cannot declare class shoppingCart, because the name is already in use in \includes\system\versioned\1.0.0.0\shopping_cart.php on line 13

 

Link to comment
Share on other sites

  • 2 years later...

Double-check the settings in the administration panel to ensure that the cost and weight ranges are set up correctly. Specifically, make sure that the shipping option for £100 has a maximum cost of £100 and a minimum cost of £50.

Verify that the correct version of the module is installed and that it is compatible with Phoenix 1.0.7.1. You may want to check the documentation for the module or contact the developer for assistance.

Clear the cache and refresh the page to ensure that any changes made to the configuration settings are being recognized by the system.

If the issue persists, try disabling any other shipping modules that may be conflicting with the Cost Weight Matrix module. This will help to isolate the problem and determine if there are any conflicts.

Check the error logs to see if there are any error messages related to the module or shipping calculations. This may provide additional clues as to what the issue might be.

If none of these steps resolve the issue, you may need to seek additional support from the developer of the module or the Phoenix community.

 
Edited by [email protected]
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...