Thread: Easy Code Help

Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default Easy Code Help

    Not sure where to stick this post. I need some easy code help. I have hacked the order_total module ot_loworderfee. The change works how I want, but it makes the admin side of all order_total modules page unuseable.

    The change that is causing a problem is at the top of the file. I replaced
    Code:
    $this->title = MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE
    with the following

    Code:
    if ( ($_SESSION['cart']->in_cart_check('products_model','variableA') > 0) ) {
              $this->title = MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE2;
              }
          if ( ($_SESSION['cart']->in_cart_check('products_model','variableB') > 0) ) {
              $this->title = MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE2;
              }
        if ( ($_SESSION['cart']->in_cart_check('products_model','variableC') > 0) ) {
              $this->title = MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE;
              }
    The change makes it so that the Module Title text on the checkout page changes based on whether certain product models are in the cart.

    Anything in the changed code that could be causing the blooper on the Admin side?

    -lindasdd

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Easy Code Help

    $_SESSION['cart'] doesn't exist while inside the admin.
    So you'll need to wrap all of that code inside another IF statement like:
    Code:
    if (IS_ADMIN_FLAG === FALSE) {
      (your code here) 
    }
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default Re: Easy Code Help

    Beautiful ! And so obvious once pointed out.

    Thank you for your help.

    -lindasdd

 

 

Similar Threads

  1. Replies: 2
    Last Post: 26 Mar 2012, 04:13 PM
  2. Help with Product availability by Zip Code or Postal Code
    By enigma777 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Jun 2008, 10:07 PM
  3. Help Easy Populate Not So Easy :)
    By hcd888 in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 29 May 2008, 01:49 PM

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