Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31
  1. #21
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Mixed category shipping calculation

    I wrote this based on Postcards where there was a Parent cat with subcats that had the Products ...

    But, as you have some of these Categories that hold subcategories with Products, and some of these Categories where the Category itself holds the Products, I rewrote this to do the calculations for each group for Postcards, Books and Prints to identify based on the Category you identify for $chk_cat to know how to calculate for either condition.

    See if this new attachment works better for you ...
    Attached Files Attached Files
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  2. #22
    Join Date
    Oct 2014
    Location
    New Westminster, B.C. CANADA
    Posts
    34
    Plugin Contributions
    0

    Default Re: Mixed category shipping calculation

    Quote Originally Posted by Ajeh View Post
    I wrote this based on Postcards where there was a Parent cat with subcats that had the Products ...

    But, as you have some of these Categories that hold subcategories with Products, and some of these Categories where the Category itself holds the Products, I rewrote this to do the calculations for each group for Postcards, Books and Prints to identify based on the Category you identify for $chk_cat to know how to calculate for either condition.

    See if this new attachment works better for you ...

    Hi Ajeh, works great!
    Thank you.
    For adding different zones, do I clone this categoriesitem for each zone?

  3. #23
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Mixed category shipping calculation

    Yes, if you need different Zones then clone this shipping module ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #24
    Join Date
    Oct 2014
    Location
    New Westminster, B.C. CANADA
    Posts
    34
    Plugin Contributions
    0

    Default Re: Mixed category shipping calculation

    Quote Originally Posted by Ajeh View Post
    Yes, if you need different Zones then clone this shipping module ...
    Hi Ajeh,
    Seems to be going so far but have another question.
    I'm wanting to add another book in the book master category "1" which would use the default shipping metheod as it's of a different size and weight as the others. Using the master category id #'s to calculate shipping, is there a way to have 2 different shipping calculations within one master category?
    Or, can you turn a sub category into a master category for shipping purposes, and have it still be in a sub category? Eg: is it possible to have a master category "books", and within this category have the category "deluxe books" which calculates by one master category id, and "regular books" which calculates with the default shipping method?

    thx

  5. #25
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Mixed category shipping calculation

    While the master_categories_id is a categories_id, the Categories that hold subcategories are never master_categories_id as only a Category with Products can be a master_categories_id ...

    So let's step through this slowly and pretend I know nothing about your Categories and Products as if it were your store and not mine ...

    You want to add a Product, what is its products_id? to a Category, what is the categories_id? what is its master_categories_id? and you want it do use the default shipping, what is the default shipping?

    Currently, I am aware that you have the CategoriesItem2.zip that I made for you to manage Books, Prints and Prostcards ...

    For this new Product that you say is a Book with different shipping, what makes it different? We might be able to identify it by its products_id and adjust the shipping charges based on that, but you need to provide more detail and take baby steps in doing so as I do not know your shop and your shipping like you do ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #26
    Join Date
    Oct 2014
    Location
    New Westminster, B.C. CANADA
    Posts
    34
    Plugin Contributions
    0

    Default Re: Mixed category shipping calculation

    Quote Originally Posted by Ajeh View Post
    While the master_categories_id is a categories_id, the Categories that hold subcategories are never master_categories_id as only a Category with Products can be a master_categories_id ...

    So let's step through this slowly and pretend I know nothing about your Categories and Products as if it were your store and not mine ...

    You want to add a Product, what is its products_id? to a Category, what is the categories_id? what is its master_categories_id? and you want it do use the default shipping, what is the default shipping?

    Currently, I am aware that you have the CategoriesItem2.zip that I made for you to manage Books, Prints and Prostcards ...

    For this new Product that you say is a Book with different shipping, what makes it different? We might be able to identify it by its products_id and adjust the shipping charges based on that, but you need to provide more detail and take baby steps in doing so as I do not know your shop and your shipping like you do ...
    Hi Ajeh,
    Yes, I received the zip and it works great. Thank you.

    In the books category I hope to have regular books of a standard size, limited edition books of the same standard size, and Deluxe edition books which are larger, and need the unique shipping in the books category
    of the CategoriesItem. The Deluxe books are the unique ones. All the other books are small and can be put in a standard envelope:
    $5.60 shipping and handling for one with an additional .75 for each additional book.

    I would like them to be side by side in the books category rather than creating separate categories for each as some are the same book offered as regular or deluxe.

    Ideally the default shipping I would set at $5.60 each then .75 for each additional. This would cover most items, then use the specific shipping calculations you set up for the books, postcards and prints for the other unique items.

    Hope this makes sense, Thx

  7. #27
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Mixed category shipping calculation

    Any reason you cannot make a Category for:
    Books Small (or some other useful name)

    then Link these books to the Books Category?

    Then a new calculation can be made for the shipping of these Products that would use the master_categories_id for the Books Small category as the trigger ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #28
    Join Date
    Oct 2014
    Location
    New Westminster, B.C. CANADA
    Posts
    34
    Plugin Contributions
    0

    Default Re: Mixed category shipping calculation

    Quote Originally Posted by Ajeh View Post
    Any reason you cannot make a Category for:
    Books Small (or some other useful name)

    then Link these books to the Books Category?

    Then a new calculation can be made for the shipping of these Products that would use the master_categories_id for the Books Small category as the trigger ...
    Do you mean if someone then goes into the books category they will then have a choice of Books Small, and other books?
    The snag is some regular books and the deluxe limited edition books are just different versions of the same book. I'd prefer to have them side by side rather than in different categories so someone can see them together and chose one or the other.

    With what you're suggesting could I have, for example, an All Books Category, and a Deluxe books Category, and then link the Deluxe books in the All Books Category so people could see everything together under All Books?
    Can you make a Category for, as per your example, Books Small, for shipping purposes, have them linked to the Books Category but not have the the separate Books Small Category visible on it's own as a choice, only have the items visible linked in the Books Category?

  9. #29
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Mixed category shipping calculation

    You can do it that way, which is similar to your Post Cards category ... The Products are in their own Category, but then Linked to the All category ...

    Just make sure that the correct master_categories_id is set ...

    Once the books are arranged correctly, then the code can be adapted for the different shipping charge ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #30
    Join Date
    Oct 2014
    Location
    New Westminster, B.C. CANADA
    Posts
    34
    Plugin Contributions
    0

    Default Re: Mixed category shipping calculation

    Quote Originally Posted by Ajeh View Post
    You can do it that way, which is similar to your Post Cards category ... The Products are in their own Category, but then Linked to the All category ...

    Just make sure that the correct master_categories_id is set ...

    Once the books are arranged correctly, then the code can be adapted for the different shipping charge ...
    Okay, I think I've got it, just one more question hopefully.
    For adapting the code for a new master_category_id, I'm guessing I can go in the categoriesitem.php
    and copy one of the other specific charges you set up (such as books below), and modify it for the new category?


    // bof: calculate books shipping cost
    $chk_cat = '75'; // parent or main categories_id for books
    $chk_cart = 0;
    if (!zen_has_category_subcategories($chk_cat)) {
    // if $chk_cat has no subcategories and has products
    $chk_cat_products = zen_get_categories_products_list($chk_cat, false, false);
    $chk_cat_products_id_list += zen_get_categories_products_list($chk_cat);
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id', $chk_cat);
    } else {
    // if $chk_cat has subcategories and has products
    $subcategories_array = array();
    zen_get_subcategories($subcategories_array, $chk_cat);
    for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
    $chk_cat_products_id_list += zen_get_categories_products_list($subcategories_array[$i]);
    $chk_cart += $_SESSION['cart']->in_cart_check('master_categories_id', $subcategories_array[$i]);
    }
    }
    //1 = 17.50, 2 = 17.50 + .75, 3 = 17.50 + 1.50, 4 = 17.50 + 2.25
    //17.50 per book + .75 for each book over 1
    $ship_books = ($chk_cart > 0 ? 17.50 + (($chk_cart-1) * 0.75) : 0);
    //echo 'Books in Cart: ' . $chk_cart . ' shipping: ' . $ship_books . '<br>';
    // eof: calculate books shipping cost

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. mixed no shipping and per item shipping on same order
    By MDIWade in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 25 Jul 2011, 05:08 AM
  2. Mixed Shipping Rate in Same Order
    By rstar23 in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 6 Sep 2010, 03:26 PM
  3. Shipping Estimator: USPS shipping and mixed download/physical products
    By lat9 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 23 Nov 2009, 03:04 PM
  4. Mixed shipping
    By discodancer in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 13 Oct 2008, 11:49 PM
  5. Shipping calculation different for category
    By desireco in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 18 Jul 2008, 02:29 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR