Results 1 to 10 of 2252

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    26
    Plugin Contributions
    0

    Default Re: ozpost shipping module

    G'day Rod

    I posted in this thread a while ago and found my problem to be php5. Didn't know such a thing existed until you said so......

    Anyways onwards and upwards. I have a couple more queries if I may:

    a. I posted a thread in another room :
    http://www.zen-cart.com/forum/showthread.php?t=146069

    Essentially I want to use Ozpost only for certain product categories, and Fastways for others. Any neat tricks you know of to do this ?

    b. How do you deal with normalised box sizes. Say I had a standard box 20x20x10 for argument sake which could fit 1,2....10 things in it so the cost of the shipping is based upon box size rather then the cubing of the product. I am being difficult I know but thought I would ask

    Thanks



    Stumps

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: ozpost shipping module

    Quote Originally Posted by Stumpy74 View Post
    Essentially I want to use Ozpost only for certain product categories, and Fastways for others. Any neat tricks you know of to do this ?
    It can be done, but depending on your php skill level you may find it a bit daunting.

    The basic idea behind how to do it is this:

    Near the start of all good shipping modules is a piece of code something like this:

    if (zen_get_shipping_enabled($this->code)) $this->enabled = ((MODULE_SHIPPING_OZPOST_STATUS == 'True') ? true : false);

    This sets the module(s) $this->enabled variable to be true (module active) or false (module inactive), so somewhere just after this code you will need to perform a check to see which category the cart items belong to, and set the $this->enabled variable appropriately.

    In psuedocode you will be looking at something like

    if ITEM is in CATEGORY_FOR OZPOST then $this->enabled = TRUE
    else $this->enabled = FALSE

    likewise, in the fastaways module you'll need something like:

    if ITEM is in CATEGORY_FOR FASTAWAY then $this->enabled = TRUE
    else $this->enabled = FALSE

    This is basically all there is too it. The 'hard' part (which isn't really all that hard) is finding what category the items belong to. There are other threads that have a lot more detail on how to do this. Some of them even have practical examples that you will be able to use.

    I doubt that you'll ever find an 'easy' way to accomplish this because no two stores will have the same categories, and if they did the category ID's will almost certainly be different, so all I can really tell you is yes it can be done, the theory behind it is pretty simple, the implementation will only take a few lines of code, but this code will always be 'unique' for any given store.

    Having said that, this 'simple' solution does suffer a few shortcomings, for example, what if the cart contains one category item that needs to go via australia post and another category item that needs to go via Fastaways?

    Such a scenario will require zencart to present two different shipping costs to the customer at the same time, but zencart doesn't have the logic/capability to do this ... to make it do so will probably require a different database design, as well as many other significant changes.

    Quote Originally Posted by Stumpy74 View Post
    b. How do you deal with normalised box sizes. Say I had a standard box 20x20x10 for argument sake which could fit 1,2....10 things in it so the cost of the shipping is based upon box size rather then the cubing of the product. I am being difficult I know but thought I would ask
    How do *I* deal with it? Well, I don't. The reason being is that this is getting into the realm of "The holy grail of shipping modules".
    Perhaps if you review the conversation I was having with ALiepinieks
    earlier in this thread (early December 2009) you will come to appreciate that what appears to be a relatively simple requirement is actually a very complex (impossible???) task.

    Cheers
    Rod

 

 

Similar Threads

  1. v151 Product dimensions revert to 0 - using ozpost module
    By mpforum in forum General Questions
    Replies: 8
    Last Post: 18 Apr 2014, 09:49 AM
  2. Ozpost and module help
    By janelle in forum Addon Shipping Modules
    Replies: 2
    Last Post: 15 Jun 2012, 09:19 AM
  3. Ozpost Combine shipping !! Possible ?
    By toytemple in forum Addon Shipping Modules
    Replies: 7
    Last Post: 21 Jan 2010, 02:22 PM
  4. ozpost module problems
    By hspark in forum Addon Shipping Modules
    Replies: 19
    Last Post: 7 Dec 2009, 12:44 PM
  5. store pick-ip in ozpost shipping module
    By lazerweb in forum Addon Shipping Modules
    Replies: 2
    Last Post: 29 Jul 2008, 05:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg