Changing Weight to price based in zones.php

Open to all! Ask other shopowners for help.
DarioMartin

Re: Changing Weight to price based in zones.php

Post by DarioMartin »

burt wrote: Thu Dec 10, 2020 6:05 pm https://pastebin.com/y92PmfGa
Can I only give this a thumbs up once? PERFECT! It works perfectly - Thank You Burt. I am very seriously considering now going Pro simply to pay for the absolutely outstanding help you have quite freely given.

Thank you.

To anyone else reading this, the solution provided by Burt works perfectly and gives the ability to charge shipping by Weight, Price or Quantity across multiple zones.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Changing Weight to price based in zones.php

Post by burt »

You tried to create it on your own under your own steam, but it did not quite work.
That is what I love to see (that you tried), yet many people will sit on their hands and wait and wait and wait for someone else.

You tried. You gave your time to trying. I am happy to give a bit of my time in return.
I am not here to build for you.
I am here to build with you. Let's help each other.
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Changing Weight to price based in zones.php

Post by Kofod95 »

Just to chime in om this. I had the same issue with shipping modules with underscores. Burt's version does not have that, and that was also how I fixed it (removing the underscores in favor of a module and class name with only one word).

Would I understand the explanation to why underscores are not allowed, for in that case, I'm currious?

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Changing Weight to price based in zones.php

Post by heatherbell »

Kofod95 wrote: Thu Feb 18, 2021 10:54 am Would I understand the explanation to why underscores are not allowed, for in that case, I'm currious?
With thanks to @ecartz for this:
The way that osCommerce handles the shipping is to join the module and method names with an underscore. E.g. free_free or table_table. With the idea that sometimes the method might not have the same name as the module. E.g. fedex_groundslow, fedex_nextdayair. So if the module name has an underscore, e.g. my_table, then you get something like my_table_my_table and it thinks the module is my and the method is either table_my_table or table.
taler55
Posts: 4
Joined: Tue Mar 05, 2024 10:13 pm
Phoenix Version:

Changing weight from ounces to grams in postal module

Post by taler55 »

Hello!
Please help me to set weight of items in grams and accordingly all postal expenses based on grams as well. Can't find how to change ounces to grams

Thanking in advance
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Changing Weight to price based in zones.php

Post by burt »

Apparently 1 ounce = 28.3495 g

Therefore if you have saved all your products weight in ounces, multiply by 28.3495

EG:
Red Apples - let's say you have it at 18 ounces.
18 x 28.3495 = 510.3g

How many products do you need to update?
I am not here to build for you.
I am here to build with you. Let's help each other.
taler55
Posts: 4
Joined: Tue Mar 05, 2024 10:13 pm
Phoenix Version:

Re: Changing Weight to price based in zones.php

Post by taler55 »

Thank you.
All my weights are in grams , bur postage module treats those as ounces, accordingly, postage for a small letter looks like for a bid parcel.
Is it possible to set gram as a standard weight for the shop, including both the products and postage?
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Changing Weight to price based in zones.php

Post by burt »

Then you need to amend your shipping table, but you have not said what shipping module(s) you are using.
The concept would be similar, assuming you are using zones.php

Admin > Modules > Shipping

You'll see something like

3:8.50,7:10.50,99:20.00

Multiply the bit before each colon [marked in red for your benefit] by 28.3495 (and round appropriately), eg;

85:8.50,199:10.50,2806:20.00
I am not here to build for you.
I am here to build with you. Let's help each other.
taler55
Posts: 4
Joined: Tue Mar 05, 2024 10:13 pm
Phoenix Version:

Re: Changing Weight to price based in zones.php

Post by taler55 »

Thank you for the tip, will try.

P.S. Why you still use ounces? Because of the USA? Nowhere in Europe you'll find them....
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Changing Weight to price based in zones.php

Post by raiwa »

Code: Select all

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2020 osCommerce

  Released under the GNU General Public License
*/

  class table_zone_1 extends abstract_shipping_module {

 
[/quote]
You can’use underscore in shipping modules file and class name.
Try with: “tableZoneOne”
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply