Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 37
  1. #21
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Set a flat shipping cost for a single item

    it seems the pID is the issue for the shipping not turnning on/off with a click as the pID is "1" and the pID to change the status for the item "in this items case is the pID of 131 so the pID is not updating for the shipping icon.

    currently using :

    <?php
    if ($products->fields['product_is_always_free_shipping'] == '1') {
    echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=0&pID=' . $products->fields['product_is_always_free_shipping'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image(DIR_WS_IMAGES . 'free_shipping_set.png', IMAGE_ICON_STATUS_ON) . '</a>';
    } else {
    echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products->fields['product_is_always_free_shipping'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>';
    }
    ?>

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

    Default Re: Set a flat shipping cost for a single item

    The pID needs to be the products_id and you are using the setting for the:
    product_is_always_free_shipping

    which will always be 1 or 0 ...
    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!

  3. #23
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Set a flat shipping cost for a single item

    ok, so I have

    <?php
    if ($products->fields['product_is_always_free_shipping'] == '1') {
    echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=0&pID=' . $products->fields['products_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image(DIR_WS_IMAGES . 'free_shipping_set.png', IMAGE_ICON_STATUS_ON) . '</a>';
    } else {
    echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=setflag&flag=1&pID=' . $products->fields['products_id'] . '&cPath=' . $cPath . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', IMAGE_ICON_STATUS_OFF) . '</a>';
    }
    ?>

    why is the truck still trigering the item status on/off

    and in categories.php I have

    break;
    case 'setflag':
    if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
    if (isset($_GET['pID'])) {
    zen_set_product_is_always_free_shipping($_GET['pID'], $_GET['flag']);

    }
    }
    Last edited by gloerick; 28 Mar 2012 at 04:01 PM.

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

    Default Re: Set a flat shipping cost for a single item

    Did you change the:
    case 'setflag':

    or did you just duplicate it? and now have two sections for:
    case 'setflag':

    If you duplicated it, then it is not "hearing" your duplicate ... it is hearing the original code in the first:
    case 'setflag':
    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!

  5. #25
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Set a flat shipping cost for a single item

    yes I duplicated it and changed the zen_set

    break;
    case 'setflag':
    if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
    if (isset($_GET['pID'])) {
    zen_set_product_status($_GET['pID'], $_GET['flag']);

    }
    }
    break;
    case 'setflag':
    if ( ($_GET['flag'] == '0') || ($_GET['flag'] == '1') ) {
    if (isset($_GET['pID'])) {
    zen_set_product_is_always_free_shipping($_GET['pID'], $_GET['flag']);

    }
    }


    Like I said, I am not a programer, so I do not see what is wrong when I changed teh zen_set from staus to shipping

  6. #26
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Set a flat shipping cost for a single item

    tried setting

    break;
    case 'setflagshipping':

    AND

    zen_href_link(FILENAME_CATEGORIES, 'action=setflagshipping&flag=0&pID='

    to give the setflag a uniqe name.

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

    Default Re: Set a flat shipping cost for a single item

    Did you make a function for:
    zen_set_product_is_always_free_shipping
    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
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Set a flat shipping cost for a single item

    your tourchering me huh, you know I most likley did not,
    and no, no idea I had to or how to.

    can you please guide me to get it working ?

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

    Default Re: Set a flat shipping cost for a single item

    Create a new file in:
    /admin/includes/functions/extra_functions

    call it something like:
    always_free_shipping_functions.php

    and add the code:
    Code:
    <?php
    ////
    // Sets the status of a product
      function zen_set_product_is_always_free_shipping($products_id, $always_free_shipping_status) {
        global $db;
        if ($always_free_shipping_status == '1') {
          return $db->Execute("update " . TABLE_PRODUCTS . "
                               set product_is_always_free_shipping = 1, products_last_modified = now()
                               where products_id = '" . (int)$products_id . "'");
    
        } elseif ($always_free_shipping_status == '0') {
          return $db->Execute("update " . TABLE_PRODUCTS . "
                               set product_is_always_free_shipping = 0, products_last_modified = now()
                               where products_id = '" . (int)$products_id . "'");
    
        } else {
          return -1;
        }
      }
    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
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: Set a flat shipping cost for a single item

    copy this from the general.php ?

    // Sets the status of a product
    function zen_set_product_status($products_id, $status) {
    global $db;
    if ($status == '1') {
    return $db->Execute("update " . TABLE_PRODUCTS . "
    set products_status = 1, products_last_modified = now()
    where products_id = '" . (int)$products_id . "'");
    } elseif ($status == '0') {
    return $db->Execute("update " . TABLE_PRODUCTS . "
    set products_status = 0, products_last_modified = now()
    where products_id = '" . (int)$products_id . "'");
    } else {
    return -1;
    }
    }


    all I did was search for zen_set_product_status

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. v139h Calculating Shipping - First Item a Set Cost, Each Additional Item $1.00 Per Item
    By Beachcovers in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 31 Mar 2012, 04:00 AM
  2. Create shipping cost for a single product?
    By Platinum Place in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 12 Jan 2011, 02:59 AM
  3. How Can I Set a Flat Rate for shipping on 1 item and rest by weight ?
    By vividbreeze in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 1 Jan 2010, 05:26 AM
  4. Shipping - Different Flat Rate Freight Cost For Each Item
    By Donn in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 1 May 2009, 03:06 PM
  5. I need to set a flat rate for one item.
    By HighHobbies in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 24 Jun 2008, 02:08 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