Page 31 of 56 FirstFirst ... 21293031323341 ... LastLast
Results 301 to 310 of 552
  1. #301
    Join Date
    Aug 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by Ajeh View Post
    I have not used the Royal Mail shipping module but you should be able to customize it in a similar manner ...
    Hmm, I've been struggling with this for a while now and can't seem to get it working.
    I want to disable and hide the option of large letter shipping for a certain categories as they have items which are too thick to be posted at this rate.

    At the moment my item.php reads as follows...

    Code:
      // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
           $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
          }
    So I tried adding this code underneath...

    Code:
    // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
           $this->enabled = ((MODULE_SHIPPING_RM1STLARGELETTER_STATUS == 'True') ? true : false);
          }
          // disable for one master_categories_id
          if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','148') > 0)) {
              // show RM1STLARGELETTER
              $this->enabled = false;
          } else {
              // hide RM1STLARGELETTER
              $this->enabled = true;
           }
    Like you showed for your UPS version...but nothing happened.
    I know it that instance you said to put it in the UPS.php, but the rm1stlargeletter.php doesn't have this code in it to change...

    Code:
    // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
              $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
          }
    Sorry to be a pain, but I really want to get this sorted as I can't afford to lose out by undercharging, but equally don't want to put people off by over charging for shipping. I have really tried to understand it, but I know that one of you clever people will probably see what I am doing wrong straight away and hopefully be able to steer me to a solution.
    Thanks for any help you can offer.
    Cute 'N' Creepy
    "May night hold you safe in her velvet embrace"

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

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by everlost View Post
    Hmm, I've been struggling with this for a while now and can't seem to get it working.
    I want to disable and hide the option of large letter shipping for a certain categories as they have items which are too thick to be posted at this rate.
    In the code you provided is a line that reads in part:

    $_SESSION['cart']->in_cart_check('master_categories_id','148') > 0))

    Since you obtained this code from another example you may or may not have changed the master_categories_id number (148)... anyway, 1st thing to do is to ensure this number does actually match the category for where you want the module disabled.

    Other than this, the code provided *appears* ok.

    Cheers
    Rod

  3. #303
    Join Date
    Aug 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by RodG View Post
    In the code you provided is a line that reads in part:

    $_SESSION['cart']->in_cart_check('master_categories_id','148') > 0))

    Since you obtained this code from another example you may or may not have changed the master_categories_id number (148)... anyway, 1st thing to do is to ensure this number does actually match the category for where you want the module disabled.

    Other than this, the code provided *appears* ok.

    Cheers
    Rod
    The id number 148 is indeed the correct one for the category which I want to disable the shipping method for. It is good to know that it the code seems ok, but if I can get it actually working too that will make my day...
    Cute 'N' Creepy
    "May night hold you safe in her velvet embrace"

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

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by everlost View Post
    I know it that instance you said to put it in the UPS.php, but the rm1stlargeletter.php doesn't have this code in it to change...
    This code needs to be placed in the module that you wish to disable. I'm guessing in your case this would be the rm1stlargeletter.php module .... SO, my next question is, if this module doesn't have the code in it to change, then exactly where did you add this code?

    Cheers
    Rod.

  5. #305
    Join Date
    Aug 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I tried putting it in /includes/modules/shipping/item.php following post #9 by Ajeh.
    I admit I was desperately trying to make it work by myself but when I realised it didn't work I removed all the modified code and it is back to normal. Any suggestions as where I should stick (no rude suggestions please)...
    Cute 'N' Creepy
    "May night hold you safe in her velvet embrace"

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

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by everlost View Post
    I tried putting it in /includes/modules/shipping/item.php following post #9 by Ajeh.
    That'll work IF you were using the per item shipping module, but as per previous post, the code needs to be placed within the code that you are using.

    Quote Originally Posted by everlost View Post
    I admit I was desperately trying to make it work by myself but when I realised it didn't work I removed all the modified code and it is back to normal. Any suggestions as where I should stick (no rude suggestions please)...
    Assuming it is a module called "rm1stlargeletter" that you are using, then the code needs to be placed into the rm1stlargeletter.php code.

    This code SHOULD have a $this->enabled variable being set somewhere near the beginning of the code, so you just need to identify where and then place the additional code somewhere after that (similar to the example(s).

    Cheers
    Rod.

    ps. I'm about to call it a night, so unless Ajeh steps in while I'm sleeping you are probably on your own...

  7. #307
    Join Date
    Aug 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by RodG View Post
    That'll work IF you were using the per item shipping module, but as per previous post, the code needs to be placed within the code that you are using.



    Assuming it is a module called "rm1stlargeletter" that you are using, then the code needs to be placed into the rm1stlargeletter.php code.

    This code SHOULD have a $this->enabled variable being set somewhere near the beginning of the code, so you just need to identify where and then place the additional code somewhere after that (similar to the example(s).

    Cheers
    Rod.

    ps. I'm about to call it a night, so unless Ajeh steps in while I'm sleeping you are probably on your own...

    Ok Rod, well thanks for your help so far.
    I checked out the rm1stlargeletter.php and found the $this->enabled and placed the code under it (code I inserted is marked in red).

    Code:
    <?php
    /*
    
    GPL released as part of the big_royalmail_v2.2 package
    
    see CREDITS.txt for the contributors and support forum.
    
    */
    
    
      class rm1stlargeletter {
        var $code, $title, $description, $enabled, $num_zones ;
    
    
    // class constructor
        function rm1stlargeletter() {
    
          global $order, $total_weight ;
    
          $this->code = 'rm1stlargeletter';
          $this->title = MODULE_SHIPPING_RM1STLARGELETTER_TEXT_TITLE;
          $this->description = MODULE_SHIPPING_RM1STLARGELETTER_TEXT_DESCRIPTION;
          $this->sort_order = MODULE_SHIPPING_RM1STLARGELETTER_SORT_ORDER;
          $this->icon = (( defined('DIR_WS_ICONS') ? DIR_WS_ICONS : 'images/icons/' ) . 'shipping_ukrm.jpg');
          $this->tax_class = MODULE_SHIPPING_RM1STLARGELETTER_TAX_CLASS;
          $this->enabled = ((MODULE_SHIPPING_RM1STLARGELETTER_STATUS == 'True') ? true : false);
    
          // disable for one master_categories_id
          if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','148') > 0)) {
              // show RM1STLARGELETTER
              $this->enabled = false;
          } else {
              // hide RM1STLARGELETTER
              $this->enabled = true;
           }
    
          // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
          $this->num_zones = 1;
    
    // inspired by Jim Barrington (JollyJim)
    
          if( isset($order) && MODULE_SHIPPING_RM1STLARGELETTER_HIDE_SHIPPING_ERRORS == 'True' ){
    
            switch(isset($order->info['subtotal'])){
    
            case true:
              if( $order->info['subtotal'] < MODULE_SHIPPING_RM1STLARGELETTER_MIN_ORDERVALUE){
                  $this->enabled = false;
                return ;
              }else
              if(MODULE_SHIPPING_RM1STLARGELETTER_MAX_ORDERVALUE != -1 && $order->info['subtotal'] > MODULE_SHIPPING_RM1STLARGELETTER_MAX_ORDERVALUE){
                  $this->enabled = false;
                return ;
              }
    Still not working though...perhaps someone else will come along and give me some more pointers
    Cute 'N' Creepy
    "May night hold you safe in her velvet embrace"

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

    Default Re: Different shipping methods for different categories

    Below this line:
    Code:
          // disable for one master_categories_id
    what happens if you add:
    Code:
          // disable for one master_categories_id
         global $cart;
    
    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!

  9. #309
    Join Date
    Aug 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by Ajeh View Post
    Below this line:
    Code:
          // disable for one master_categories_id
    what happens if you add:
    Code:
          // disable for one master_categories_id
         global $cart;
    
    Nothing happens, it still shows large letter as an option for posting items in that category :-/
    Cute 'N' Creepy
    "May night hold you safe in her velvet embrace"

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

    Default Re: Different shipping methods for different categories

    Afraid I do not know what the rest of your code is doing based on the small piece that you are showing ...
    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!

 

 
Page 31 of 56 FirstFirst ... 21293031323341 ... LastLast

Similar Threads

  1. Re: Different shipping methods for different categories
    By kaddie in forum Built-in Shipping and Payment Modules
    Replies: 14
    Last Post: 19 Nov 2010, 04:37 AM
  2. Replies: 2
    Last Post: 27 Oct 2010, 01:45 PM
  3. Different shipping methods for different categories and mixed categories
    By neit in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 10 Aug 2010, 12:20 AM
  4. Separate Shipping Methods for Different Categories
    By MortalWombat in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 28 Jul 2010, 08:57 AM
  5. Different shipping methods for different product types?
    By talisman-studios in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Sep 2008, 04:59 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