Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postage based on item weight? #364

Open
franhaselden opened this issue Apr 26, 2013 · 5 comments
Open

Postage based on item weight? #364

franhaselden opened this issue Apr 26, 2013 · 5 comments

Comments

@franhaselden
Copy link

Can anyone think of a way that postage could be calculated based on a weight attribute?

Example:

  1. I could somehow give every project an attribute of it's weight (100g for this, 400g for that).
  2. SimpleCart would add together the weight attributes of everything in the cart, so 500g
  3. Price brackets could be set up based on weights 100-200g = £x, 200-300g = £xx etc
  4. Postage number would be passed to PayPal.

Presently my postage rates are based on number of items.

My current postage setup.

Note on the below code, I have the spans for postage and giftwrap hidden unless there is 1 item in the cart. Postage rates are created based on adding £2 to the number of items in the cart, so:

1 item = £3
2 items = £4
3 items = £5

Seems to work quite well for me in terms of number of items, but as I'm selling heavier items I really need something better...

<script>
      simpleCart({
          shippingCustom: function () {
               $('.postage').show();
               $('.giftwrap').show();
                   if (simpleCart.quantity() == 0) {
                         $('.postage').hide();
                         $('.giftwrap').hide();
                   } else if (simpleCart.quantity() < 9) {
                           return (2 + simpleCart.quantity());
                   } else {
                         return 12;
                            }
                    }
              });
                </script>
@tag666
Copy link

tag666 commented May 17, 2013

just what i need as well !
at the moment postage is worked out as a % of the total, which is not ideal.

  1. different weights for different items.
  2. combine and calculate on cart update.

please somebody help

@franhaselden
Copy link
Author

Unfortunately I don't think anyone really cares about Simple Cart anymore. Shame, it was great. If anyone has a solution that does offer this kind of stuff, please let me know. I need to move away from SimpleCart as soon as I can.

Can anyone tell me how to unclose the issue? I didn't mean to.

@tag666
Copy link

tag666 commented May 17, 2013

-__- ...but you closed the issue, so nobody will respond to help you, me or anybody else who has this problem now.

@franhaselden franhaselden reopened this May 17, 2013
@chekobil
Copy link

I did this with the version 2, but changing the code in so many places that I don´t remember how I did.
You can see it working here http://elquiltro.es/index_tienda.php the shop is in "la quiero section", (there´s an image taking so much time to load ...) click on the circles to add items an then click in "terminar compra", here you can see listed the total weight and his price.
I don´t know how to send you the code from here, when I have time I want to make the same with the version 3.

@tag666
Copy link

tag666 commented May 22, 2013

tbh I can't believe this feature wasn't in version 1.

@franhaselden thanks for a fast reopen :).

@feliper thanks for help, i'm new to javascript, i will figure it out one day, but that could be a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants