Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25
  1. #21
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Mileage based Shipping for One Category

    Quote Originally Posted by dharrison View Post
    Hi mc

    I have tried this line in both the mileageship.php and perweightunit.php files and once again I get the per weight unit showing up a £0

    Try and purchase https://sitstandforbusiness.com/ssfb...dule-p-29.html and you'll see what I mean.
    Site wouldn't present the text to edit, just a blank message box when attempting to edit. Yes, reloaded the page, yes navigated away from the page and came back, etc... so for this one stupid little thing to change (reverse the true/false as described but not shown) I'm responding with the entire message again below:


    In one file should have:
    Code:
    // bof enable only for certain category in cart
        if (IS_ADMIN_FLAG == false) {
          if (($_SESSION['cart']->in_cart_check('master_categories_id','78') > 0) ||
             ($_SESSION['cart']->in_cart_check('master_categories_id','99') > 0))
              {
              $this->enabled = true;
          } else {
              $this->enabled = false;
              }
            }
    // eof enable only for certain category in cart
    In the other it should be almost exactly the same but "reversed":
    Code:
    // bof enable only for certain category in cart
        if (IS_ADMIN_FLAG == false) {
          if (($_SESSION['cart']->in_cart_check('master_categories_id','78') > 0) ||
             ($_SESSION['cart']->in_cart_check('master_categories_id','99') > 0))
              {
              $this->enabled = false;
          } else {
              $this->enabled = true;
              }
            }
    // eof enable only for certain category in cart
    That is for product that have a master category of 78 and 99. While I haven't navigated the site enough to see if there is even a 78 in the category uri for any of them I have so far found 57 and 60 as a result of the limited testing performed and the below information.

    I'm not sure which shipping method this product is to represent. If it is "weight" based it's a no go, because it weighs nothing. If it is to be the other method, well, it appears as if no shipping price is applied so there is a shipping method that is presented, but it doesn't have a cost.

    As far as entering a shipping destination I haven't a clue what locations may/may not work for this store so I am not surprised at any lack of specific shipping calculations. Also, take not of a few things with the site: there is mixed content (annoying to try to test something that pops up a warning message on each screen), hovering over the cart causes the screen on at least my mobile device to move and actually prevent getting to the cart, when I added one of the mileage based products (as identified in the category name) and viewed the shipping estimator the first line after the close button indicated some sort of error being caught (that doesn't occur with the above product).

    As for the "line" of code when I went to this product: https://sitstandforbusiness.com/ssfb...form-p-62.html and added it to the cart, I did get a "weight" based Total shipping cost in £. So it tells me that there is something about the logic that is working, whether the product is setup correctly or not...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #22
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: Mileage based Shipping for One Category

    Hi mc

    Thanks for your reply and help.

    If I can explain what I'm trying to achieve here: Ok the two categories I would like the mileage shipping assigned to with are ids 78 and 60. category id 57 normal shipping applies.

    I have the following code in mileageship.php:


    Code:
      // bof enable only for certain category in cart
        if (IS_ADMIN_FLAG == false) {
          if (($_SESSION['cart']->in_cart_check('master_categories_id','78') > 0) || ($_SESSION['cart']->in_cart_check('master_categories_id','60') > 0))
              {
              $this->enabled = true;
          } else {
              $this->enabled = false;
              }
            }
    // eof enable only for certain category in cart
    The other module I have is perweightunit.php and for this I have the code as:

    Code:
         // bof disable only for certain category in cart
        if (IS_ADMIN_FLAG == false) {
          if (($_SESSION['cart']->in_cart_check('master_categories_id','78') > 0) || ($_SESSION['cart']->in_cart_check('master_categories_id','60') > 0))
              {
              $this->enabled = false;
          } else {
              $this->enabled = true;
              }
        }
    // eof disable only for certain category in cart
    So when I make a purchase from the product in category id 57 category it shows the normal £20 shipping :

    Attachment 17504


    The product in category id 78 shows the per mileage delivery (as its meant to):

    Attachment 17505

    However for the product in category id 60 (bench module) instead of getting the per mileage delivery, I get the £20 unit price popping up:

    Name:  cat60.jpg
Views: 20
Size:  46.9 KB

    We are nearly there, I just need to get these two categories using the mileage shipping
    Debbie Harrison
    DVH Design | Web Design blog

  3. #23
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Mileage based Shipping for One Category

    Is the product that shows as being "in" category 60 have a master category of 60 or is it linked to category 60?

    One can generally best tell by going to the product information page and then in the upper left corner is the category assignment. If the product is linked to other categories then it is possible to select a different category as its master.

    Considering that the product in question appears to be by some assembly related code, I couldn't tell you exactly which option(s) are to be set to support that product being in the cart without adding a bunch of test related queries/logging. Ie. Trouble-shooting.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #24
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: Mileage based Shipping for One Category

    Aha! Thats what it is!! Its linked to master category 17

    Because now it works

    Thank you so much MC and Frank
    Debbie Harrison
    DVH Design | Web Design blog

  5. #25
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Mileage based Shipping for One Category

    Quote Originally Posted by dharrison View Post
    Aha! Thats what it is!! Its linked to master category 17

    Because now it works

    Thank you so much MC and Frank
    Glad that sorted it out and that the difference between master_category_id and a product in a category seems to be better understood. :) If by the way, you later decide that you would like all product within a category to be shipped a particular way regardless of whether they are in this or that master category, then the code would be different... Also it can further complicate the shipping "method" because again if a product were shared in two different categories and each category had its own way of shipment, then which shipment method ought to be displayed? By having a single master category it cuts back on that type of potential mixed shipping... Glad to do a small part in solving the issue..
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. v154 Mileage based shipping module?
    By Fjolsvith in forum Addon Shipping Modules
    Replies: 32
    Last Post: 1 Dec 2018, 06:42 AM
  2. Module for local mileage based delivery?
    By esobalvarro in forum General Questions
    Replies: 0
    Last Post: 8 Feb 2010, 04:39 AM
  3. set different shipping rates based on zones only for one country.. need help..
    By daxchoki in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 13 Dec 2009, 06:19 PM
  4. Urgent - One type of shipping for only one category
    By beyre in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 16 Oct 2009, 05:01 PM
  5. Free Shipping based on quantity - for one product only
    By Schanz in forum Addon Shipping Modules
    Replies: 4
    Last Post: 11 Mar 2009, 12:16 AM

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