Page 6 of 16 FirstFirst ... 45678 ... LastLast
Results 51 to 60 of 154
  1. #51
    Join Date
    Sep 2005
    Posts
    100
    Plugin Contributions
    0

    Default

    Ok, things are definitely getting stored in the database table but they are not being displayed on the individual product page.

    I've added this to the template page:
    Code:
    <?php echo ((SHOW_PRODUCT_PRINT_INFO_KEY_FEATURES == '1' and !empty($key_features)) ? TEXT_PRODUCT_KEY_FEATURES . $key_features : ''); ?>
    The end result shows:

    Key Features: Object

    "Key Features:" is correct but "Object" isn't. Instead I should be seeing the list of features I typed in.

    Any ideas? I'm guessing I have something wrong in the main_template_vars file, since there is code for "$key_features" there too.

    any help would be great!

    thanks!

    june

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

    Default

    where do you define $key_features?
    Chances are it's simply the object used to run a SQL SELECT statement? If so, you need to extract the data it SELECTed in order to display the real data.
    .

    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. #53
    Join Date
    Sep 2005
    Posts
    100
    Plugin Contributions
    0

    Default

    here is where $key_features appears:

    collect_info.php
    Code:
    elseif (zen_not_null($_POST)) {
       $pInfo->objectInfo($_POST);
       $products_name = $_POST['products_name'];
       $products_description = $_POST['products_description'];
       $products_url = $_POST['products_url'];
      $key_features = $_POST['key_features_id'];
      $author = $_POST['author_id'];
      $isbn = $_POST['isbn_id'];
      $pages = $_POST['pages_id'];
      }
     $key_features_array = array(array('id' => '', 'text' => TEXT_NONE));
      $key_features = $db->Execute("select products_id, key_features_id
                      from " . TABLE_PRODUCT_PRINT_EXTRA . " order by key_features_id");
      while (!$key_features->EOF) {
       $key_features_array[] = array('id' => $key_features->fields['products_id'],
                       'text' => $key_features->fields['key_features_id']);
       $key_features->MoveNext();
    main_template_vars.php
    Code:
     $sql = "select * from " . TABLE_PRODUCT_PRINT_EXTRA . "
          where key_features_id = '" . $print_extras->fields['key_features_id'] . "'";
    
      $key_features = $db->Execute($sql);
    Code:
     $key_features = $product_info->fields['key_features_id'];
    tpl_product_print_info_display.php
    Code:
    <h2 class="pageHeadingP">Key Features</h2>
      <p><?php echo ((SHOW_PRODUCT_PRINT_INFO_KEY_FEATURES == '1' and !empty($key_features)) ? TEXT_PRODUCT_KEY_FEATURES . $key_features : ''); ?></p>
    And I'm not sure what I've done but "Key Features:" is no longer displaying either.

    Any idea of where I might have gone wrong? If you need more context for the code, just let me know. I'm not sure if any of the code above is where the info is actually "extracted." I'm still learning php.

    thanks!

    june

  4. #54
    Join Date
    Sep 2005
    Posts
    38
    Plugin Contributions
    0

    Default

    Darkwander,

    Where you able to see how to change the fields that I had mentionsed?

    Thanks

  5. #55
    Join Date
    Sep 2005
    Posts
    100
    Plugin Contributions
    0

    Default

    ok, so I'm trying to narrow down my problem. below is some code from tpl_product_print_info_display:

    Code:
    <?php echo (( SHOW_PRODUCT_RRINT_INFO_AUTHOR == '1' and !empty($author)) ? TEXT_PRODUCT_AUTHOR . $author : 'Something'); ?>
    Right now "something" is the only thing that displays. So that means:

    1. SHOW_PRODUCT_RRINT_INFO_AUTHOR is turned on
    2. $author isn't empty
    3. the broken pieces of code include TEXT_PRODUCT_AUTHOR and $author.

    I'm kind of confused as to why it is not displaying either of those things in #3.

    Any could someone tell me what "?" in the middle means?

    thanks!

    june

  6. #56
    Join Date
    Sep 2005
    Posts
    100
    Plugin Contributions
    0

    Default

    Sorry, most the stuff in my last post is wrong! I just learned that my code contains a compact if statement. I'm not use to writing if statements that way. So, "something" is displaying because one or both of the determing factors are false.

    I isolated each determining factor and they are both false. eek!

    When I echo $author alone it displays a "0"
    When I echo TEXT_PRODUCT_AUTHOR alone it displays "Author:" (which is correct)

    well, back to the drawing board. heh.

    -june

  7. #57
    Join Date
    Sep 2005
    Posts
    100
    Plugin Contributions
    0

    Default

    I just discovered that its outputting the info for the first record in the table, no matter what product you are looking at. The first product in the table was a listing that was mostly empty...hence the "0"

    I'll let you know when I figure out the rest of the problem. ;)

    thanks!

    june

  8. #58
    Join Date
    Sep 2005
    Posts
    38
    Plugin Contributions
    0

    Default

    I am trying to take out the "Units in Stock" out of my product pages. IN the Product - General type this can easly be done with the edit layout feature in the Admin section. However, there is not such features for the General- Book product type.

    Is there a way to put all the layout attributes in the product - Book section or how do I take out the "Units in Stock" from showing up?

    Thanks

  9. #59
    Join Date
    Sep 2005
    Posts
    38
    Plugin Contributions
    0

    Default

    Nevermind. I just figured out that that changing the main attributed from the Product - General carries over to the sub Categories.

    Sorry for the post

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

    Default

    Actually ... that is dependant on how a Product Type is designed.

    A 100% true Product Type would have all of the settings that you see in Product General ... this allows the settings to be 100% unique per product type so you can configure all the little nuances of a Product Type separately from another Product Typs ... :)
    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!

 

 
Page 6 of 16 FirstFirst ... 45678 ... LastLast

Similar Threads

  1. Is there a way of adding a product but stopping it from adding to new products?
    By philpalmerdevon in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 19 Jan 2009, 02:07 PM
  2. When adding new parts, adding part number to preview screen
    By GTHENRY in forum Basic Configuration
    Replies: 1
    Last Post: 18 Jun 2008, 07:53 PM
  3. product_types.php details
    By MarkRS in forum Setting Up Categories, Products, Attributes
    Replies: 12
    Last Post: 30 Sep 2006, 06:40 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