Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Media rate - seen threads on it but not sure of the solution

    Hey everyone - I don't think I can fix this problem without php expertise. I want to add a category of used songbooks and I want to offer a media rate---- only for that category.... Problem is, if I add the media rate shipping option, it shows up as an option on every item I'm selling. .. you can bet some guy is going to buy a guitar and then select media rate for shipping. Don't laugh.... I'm a musician and we're all cheap! Anyways, if you can help, it's greatly appreciated.
    Last edited by mrcastle; 16 Mar 2010 at 11:10 PM. Reason: title was wrong

  2. #2
    Join Date
    Jul 2006
    Location
    SF Bay Area
    Posts
    867
    Plugin Contributions
    1

    Default Re: Media rate - seen threads on it but not sure of the solution

    I've fixed some similar problem (and think I posted it here quite a while ago) about how to check if everything in the cart is in the special category and then show the media mail rate and if an item is found from another category do not show the media mail rate.

    I recall it was a pretty simple hack to usps.php

  3. #3
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Re: Media rate - seen threads on it but not sure of the solution

    Thanks for your response. I couldn't find that feed and problem is my knowledge is limited to basic html.

    If you (or anyone else reading this) have an idea of where I can go to find the modification it's greatly appreciated.

  4. #4
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Re: Media rate - seen threads on it but not sure of the solution

    hi - you sent me a response about the media rate option I'm trying to add in my shipping. I have pretty limited funds but I'm willing to pay to get this option..... is this something you could help with or do you know some one that can help ?

    thanks,
    mitch

  5. #5
    Join Date
    Jul 2006
    Location
    SF Bay Area
    Posts
    867
    Plugin Contributions
    1

    Default Re: Media rate - seen threads on it but not sure of the solution

    If I can find it, you can have it for free. It may or may not meet your need. I'll look for it when I'm off work today and post.

    Otherwise, someone may pop in and say before then. I recall it was a pretty simple hack.

  6. #6
    Join Date
    Jul 2006
    Location
    SF Bay Area
    Posts
    867
    Plugin Contributions
    1

    Default Re: Media rate - seen threads on it but not sure of the solution

    OK, here is some bs for you.

    What it does:

    If everything in the cart is from the category where your items that can be shipped via media mail are, the media mail option will be shown.

    If there are any items from other categories, the media mail option is NOT shown.

    Please make the edits carefully.

    To the top of your usps.php file, add:

    Code:
    // Kiddos media mail hack
    $show_mediaMail = TRUE; // assume media mail is OK
    if (!defined('IS_ADMIN_FLAG'))
    	{
    	$s_cart = $_SESSION['cart']->get_products();
    
    	// now look for reasons to not use media mail
    	foreach($s_cart as $cartitem)
    		{
    		if($cartitem['category'] != '2') // change "2" to your media mail OK category
    			{
    			$show_mediaMail = FALSE;
    			}
    		}
    	}
    Now find a line that says:

    Code:
     function usps() {
        global $order, $db, $template, $current_page_base
    and change it to:

    Code:
    function usps() {
        global $order, $db, $template, $current_page_base, $show_mediaMail;
    then find:

    Code:
        	$this->types = array('EXPRESS' => 'Express Mail',
         	  'FIRST CLASS' => 'First-Class Mail',
         	  'PRIORITY' => 'Priority Mail',
          	  'PARCEL' => 'Parcel Post',
          	  'MEDIA' => 'Media Mail',
          	  'BPM' => 'Bound Printed Matter',
          	  'LIBRARY' => 'Library'
          	  );
    and REPLACE it with:

    Code:
    if($show_mediaMail)
    		{
        	$this->types = array('EXPRESS' => 'Express Mail',
         	  'FIRST CLASS' => 'First-Class Mail',
         	  'PRIORITY' => 'Priority Mail',
          	  'PARCEL' => 'Parcel Post',
          	  'MEDIA' => 'Media Mail',
          	  'BPM' => 'Bound Printed Matter',
          	  'LIBRARY' => 'Library'
          	  );
          	 } else
          	 	{
    			$this->types = array('EXPRESS' => 'Express Mail',
    			'FIRST CLASS' => 'First-Class Mail',
    			'PRIORITY' => 'Priority Mail',
    			'PARCEL' => 'Parcel Post',
    			'BPM' => 'Bound Printed Matter',
    			'LIBRARY' => 'Library'
    			);
          	 	}
    Now you will have much joy.

    Please make a backup of your usps.php file before editing it.

    If you are not so cozy editing, I can send you a copy of usps.php with this plus the current updates and patches.

  7. #7
    Join Date
    Jul 2006
    Location
    SF Bay Area
    Posts
    867
    Plugin Contributions
    1

    Default Re: Media rate - seen threads on it but not sure of the solution

    PS: I forget to mention you must change the line:

    Code:
    if($cartitem['category'] != '2') // change "2" to your media mail OK category
    to use whatever category you use for your media mailable items. Change the "2" to whatever is right for you.

  8. #8
    Join Date
    Jul 2006
    Location
    SF Bay Area
    Posts
    867
    Plugin Contributions
    1

    Default Re: Media rate - seen threads on it but not sure of the solution

    So did this work for you?

  9. #9
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Re: Media rate - seen threads on it but not sure of the solution

    Sorry Kiddo... was out of town. Just tried to do your install. Went into shipping and selected media mail as an option in my usps. Went into all of my categories and sure enough media mail is not an option... so far so good. Then I went into my used music books category (#9) and it doesn't offer media mail. Here's the text I altered in the usps.php file. Is it in the correct area at the top of the page ?





    <?php

    // Kiddos media mail hack $show_mediaMail = TRUE; // assume media mail is OK if

    (!defined('IS_ADMIN_FLAG')) { $s_cart = $_SESSION['cart']->get_products(); // now look for

    reasons to not use media mail foreach($s_cart as $cartitem) { if($cartitem['category'] !=

    '9') // change "2" to your media mail OK category { $show_mediaMail = FALSE; } } }

    /**
    * USPS Module for Zen Cart v1.3.x
    * RateV3 Updates to: January 4, 2010
    *
    * @package shippingMethod
    * @copyright Copyright 2003-2009 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: usps.php 15170 2010-01-04 20:12:08Z ajeh $
    */
    /**
    * USPS Shipping Module class
    *
    */
    class usps extends base {
    /**
    * Declare shipping module alias code
    *
    * @var string
    */
    var $code;
    /**
    * Shipping module display name
    *
    * @var string
    */
    var $title;
    /**
    * Shipping module display description
    *
    * @var string

  10. #10
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default one more item to note

    kiddo - on the category (#9) that is selected for media mail, it is still showing priority and parcel post as shipping options..... didn't know if that would make a difference figuring it out... mitch

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Attributes not working.... Read most of the threads but cant figure out why?
    By hapishyguy in forum Setting Up Categories, Products, Attributes
    Replies: 17
    Last Post: 21 Dec 2012, 11:13 PM
  2. Replies: 3
    Last Post: 17 Aug 2011, 07:20 PM
  3. Not sure what I did but right column is not there for ONE product only?
    By mommydesigns in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Mar 2007, 03:43 AM
  4. Not Sure if this belongs here but......
    By Jodz in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Nov 2006, 04:24 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