Results 1 to 10 of 31

Hybrid View

  1. #1
    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!]
    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. #2
    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

  3. #3
    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!]
    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. #4
    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?

  5. #5
    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!]
    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. #6
    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

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

    Default Re: Mixed category shipping calculation

    Yes, the idea is if you copy that chunk of code that addresses this for the one shipping charge for the original Book rule and make a new Book rule 2 with a different master_categories_id then it should work ...

    Keep in mind you are using: $ship_books

    then new Book 2 rule should have its own variable such as $ship_books2 (or some smart name) then be initialized below:
    Code:
          $ship_books = 0;
    and then added to the total shipping cost for $total_shipping_costs:
    Code:
          // final shipping costs calculated above plus Undefined Products
          $total_shipping_costs = $ship_postcards + $ship_books + $ship_prints + ($chk_undefined_products_cnt * MODULE_SHIPPING_CATEGORIESITEM_COST);
    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!]
    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!

 

 

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

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